From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/xml/XPathValue.h | 42 ++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'Source/WebCore/xml/XPathValue.h') diff --git a/Source/WebCore/xml/XPathValue.h b/Source/WebCore/xml/XPathValue.h index ff80e1cd9..d91c77d10 100644 --- a/Source/WebCore/xml/XPathValue.h +++ b/Source/WebCore/xml/XPathValue.h @@ -24,13 +24,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef XPathValue_h -#define XPathValue_h +#pragma once #include "XPathNodeSet.h" namespace WebCore { - namespace XPath { class Value { @@ -44,9 +42,15 @@ namespace WebCore { Value(const String& value) : m_type(StringValue), m_data(Data::create(value)) { } Value(const char* value) : m_type(StringValue), m_data(Data::create(value)) { } - explicit Value(NodeSet value) : m_type(NodeSetValue), m_data(Data::create(std::move(value))) { } - explicit Value(Node* value) : m_type(NodeSetValue), m_data(Data::create(value)) { } - explicit Value(PassRefPtr value) : m_type(NodeSetValue), m_data(Data::create(value)) { } + explicit Value(NodeSet&& value) + : m_type(NodeSetValue), m_data(Data::create(WTFMove(value))) + { } + explicit Value(Node* value) + : m_type(NodeSetValue), m_data(Data::create(value)) + { } + explicit Value(RefPtr&& value) + : m_type(NodeSetValue), m_data(Data::create(WTFMove(value))) + { } Type type() const { return m_type; } @@ -68,19 +72,25 @@ namespace WebCore { Value(void*) = delete; struct Data : public RefCounted { - static PassRefPtr create() { return adoptRef(new Data); } - static PassRefPtr create(const String& string) { return adoptRef(new Data(string)); } - static PassRefPtr create(NodeSet nodeSet) { return adoptRef(new Data(std::move(nodeSet))); } - static PassRefPtr create(PassRefPtr node) { return adoptRef(new Data(node)); } + static Ref create() { return adoptRef(*new Data); } + static Ref create(const String& string) { return adoptRef(*new Data(string)); } + static Ref create(NodeSet&& nodeSet) { return adoptRef(*new Data(WTFMove(nodeSet))); } + static Ref create(RefPtr&& node) { return adoptRef(*new Data(WTFMove(node))); } String string; NodeSet nodeSet; private: Data() { } - explicit Data(const String& string) : string(string) { } - explicit Data(NodeSet nodeSet) : nodeSet(std::move(nodeSet)) { } - explicit Data(PassRefPtr node) : nodeSet(node) { } + explicit Data(const String& string) + : string(string) + { } + explicit Data(NodeSet&& nodeSet) + : nodeSet(WTFMove(nodeSet)) + { } + explicit Data(RefPtr&& node) + : nodeSet(WTFMove(node)) + { } }; Type m_type; @@ -89,7 +99,5 @@ namespace WebCore { RefPtr m_data; }; - } -} - -#endif // XPath_Value_H + } // namespace XPath +} // namespace WebCore -- cgit v1.2.1