Remove all uses of PassRefPtr in WebCore/xml
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 06:00:54 +0000 (06:00 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 06:00:54 +0000 (06:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149114

Reviewed by Darin Adler.

* dom/DecodedDataDocumentParser.h:
* dom/DocumentParser.h:
* dom/RawDataDocumentParser.h:
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::append):
* html/parser/HTMLDocumentParser.h:
* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::append):
* html/parser/TextDocumentParser.h:
* xml/NativeXPathNSResolver.cpp:
(WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
* xml/NativeXPathNSResolver.h:
(WebCore::NativeXPathNSResolver::create):
* xml/XMLErrors.cpp:
(WebCore::createXHTMLParserErrorHeader):
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
* xml/XMLHttpRequestProgressEventThrottle.h:
* xml/XMLSerializer.h:
* xml/XPathEvaluator.cpp:
(WebCore::XPathEvaluator::createExpression):
(WebCore::XPathEvaluator::createNSResolver):
(WebCore::XPathEvaluator::evaluate):
* xml/XPathEvaluator.h:
* xml/XPathNodeSet.h: Fix style errors.
(WebCore::XPath::NodeSet::NodeSet):
(WebCore::XPath::NodeSet::append):
* xml/XPathPath.cpp:
(WebCore::XPath::Filter::evaluate):
(WebCore::XPath::LocationPath::evaluate):
* xml/XPathValue.h: ditto.
(WebCore::XPath::Value::Value):
(WebCore::XPath::Value::Data::create):
(WebCore::XPath::Value::Data::Data):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::transformToDocument):
(WebCore::XSLTProcessor::transformToFragment):
* xml/XSLTProcessor.h:
(WebCore::XSLTProcessor::setXSLStyleSheet):
(WebCore::XSLTProcessor::importStylesheet):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):
* xml/parser/XMLDocumentParser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DecodedDataDocumentParser.h
Source/WebCore/dom/DocumentParser.h
Source/WebCore/dom/RawDataDocumentParser.h
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/html/parser/HTMLDocumentParser.h
Source/WebCore/html/parser/TextDocumentParser.cpp
Source/WebCore/html/parser/TextDocumentParser.h
Source/WebCore/xml/NativeXPathNSResolver.cpp
Source/WebCore/xml/NativeXPathNSResolver.h
Source/WebCore/xml/XMLErrors.cpp
Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h
Source/WebCore/xml/XMLSerializer.h
Source/WebCore/xml/XPathEvaluator.cpp
Source/WebCore/xml/XPathEvaluator.h
Source/WebCore/xml/XPathNodeSet.h
Source/WebCore/xml/XPathPath.cpp
Source/WebCore/xml/XPathValue.h
Source/WebCore/xml/XSLTProcessor.cpp
Source/WebCore/xml/XSLTProcessor.h
Source/WebCore/xml/parser/XMLDocumentParser.cpp
Source/WebCore/xml/parser/XMLDocumentParser.h

index 1ed1d25..6a86452 100644 (file)
@@ -1,3 +1,58 @@
+2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Remove all uses of PassRefPtr in WebCore/xml
+        https://bugs.webkit.org/show_bug.cgi?id=149114
+
+        Reviewed by Darin Adler.
+
+        * dom/DecodedDataDocumentParser.h:
+        * dom/DocumentParser.h:
+        * dom/RawDataDocumentParser.h:
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocumentParser::append):
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::append):
+        * html/parser/HTMLDocumentParser.h:
+        * html/parser/TextDocumentParser.cpp:
+        (WebCore::TextDocumentParser::append):
+        * html/parser/TextDocumentParser.h:
+        * xml/NativeXPathNSResolver.cpp:
+        (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
+        * xml/NativeXPathNSResolver.h:
+        (WebCore::NativeXPathNSResolver::create):
+        * xml/XMLErrors.cpp:
+        (WebCore::createXHTMLParserErrorHeader):
+        * xml/XMLHttpRequestProgressEventThrottle.cpp:
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
+        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
+        * xml/XMLHttpRequestProgressEventThrottle.h:
+        * xml/XMLSerializer.h:
+        * xml/XPathEvaluator.cpp:
+        (WebCore::XPathEvaluator::createExpression):
+        (WebCore::XPathEvaluator::createNSResolver):
+        (WebCore::XPathEvaluator::evaluate):
+        * xml/XPathEvaluator.h:
+        * xml/XPathNodeSet.h: Fix style errors.
+        (WebCore::XPath::NodeSet::NodeSet):
+        (WebCore::XPath::NodeSet::append):
+        * xml/XPathPath.cpp:
+        (WebCore::XPath::Filter::evaluate):
+        (WebCore::XPath::LocationPath::evaluate):
+        * xml/XPathValue.h: ditto.
+        (WebCore::XPath::Value::Value):
+        (WebCore::XPath::Value::Data::create):
+        (WebCore::XPath::Value::Data::Data):
+        * xml/XSLTProcessor.cpp:
+        (WebCore::XSLTProcessor::transformToDocument):
+        (WebCore::XSLTProcessor::transformToFragment):
+        * xml/XSLTProcessor.h:
+        (WebCore::XSLTProcessor::setXSLStyleSheet):
+        (WebCore::XSLTProcessor::importStylesheet):
+        * xml/parser/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::append):
+        * xml/parser/XMLDocumentParser.h:
+
 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
 
         Polish code for r189579.
index 82f8bd1..dfe4e9b 100644 (file)
@@ -41,7 +41,7 @@ protected:
 
 private:
     // append is used by DocumentWriter::replaceDocument.
-    virtual void append(PassRefPtr<StringImpl>) override = 0;
+    virtual void append(RefPtr<StringImpl>&&) override = 0;
 
     // appendBytes and flush are used by DocumentWriter (the loader).
     virtual void appendBytes(DocumentWriter&, const char* bytes, size_t length) override;
index 4771af1..0afd9ff 100644 (file)
@@ -53,7 +53,7 @@ public:
     // FIXME: append() should be private, but DocumentWriter::replaceDocument uses it for now.
     // FIXME: This really should take a std::unique_ptr to signify that it expects to take
     // ownership of the buffer. The parser expects the PassRefPtr to hold the only ref of the StringImpl.
-    virtual void append(PassRefPtr<StringImpl>) = 0;
+    virtual void append(RefPtr<StringImpl>&&) = 0;
 
     virtual void finish() = 0;
 
index 834d426..e0686d9 100644 (file)
@@ -56,7 +56,7 @@ private:
         ASSERT_NOT_REACHED();
     }
 
-    virtual void append(PassRefPtr<StringImpl>) override
+    virtual void append(RefPtr<StringImpl>&&) override
     {
         ASSERT_NOT_REACHED();
     }
index 1447a46..b5d1d18 100644 (file)
@@ -50,7 +50,7 @@ public:
     }
 
 private:
-    virtual void append(PassRefPtr<StringImpl>) override;
+    virtual void append(RefPtr<StringImpl>&&) override;
     virtual void finish() override;
 
     // FIXME: Why do we need this?
@@ -339,9 +339,9 @@ void FTPDirectoryDocumentParser::createBasicDocument()
     document()->processViewport("width=device-width", ViewportArguments::ViewportMeta);
 }
 
-void FTPDirectoryDocumentParser::append(PassRefPtr<StringImpl> inputSource)
+void FTPDirectoryDocumentParser::append(RefPtr<StringImpl>&& inputSource)
 {
-    String source(inputSource);
+    String source(WTF::move(inputSource));
 
     // Make sure we have the table element to append to by loading the template set in the pref, or
     // creating a very basic document with the appropriate table
index 93c5f93..63b3b40 100644 (file)
@@ -356,7 +356,7 @@ void HTMLDocumentParser::insert(const SegmentedString& source)
     endIfDelayed();
 }
 
-void HTMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
+void HTMLDocumentParser::append(RefPtr<StringImpl>&& inputSource)
 {
     if (isStopped())
         return;
@@ -365,7 +365,7 @@ void HTMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
     // but we need to ensure it isn't deleted yet.
     Ref<HTMLDocumentParser> protect(*this);
 
-    String source(inputSource);
+    String source(WTF::move(inputSource));
 
     if (m_preloadScanner) {
         if (m_input.current().isEmpty() && !isWaitingForScripts()) {
index 47984c6..023c76b 100644 (file)
@@ -66,7 +66,7 @@ protected:
     explicit HTMLDocumentParser(HTMLDocument&);
 
     virtual void insert(const SegmentedString&) override final;
-    virtual void append(PassRefPtr<StringImpl>) override;
+    virtual void append(RefPtr<StringImpl>&&) override;
     virtual void finish() override;
 
     HTMLTreeBuilder& treeBuilder();
index 5fa62a3..acd4b63 100644 (file)
@@ -36,11 +36,11 @@ TextDocumentParser::TextDocumentParser(HTMLDocument& document)
 {
 }
 
-void TextDocumentParser::append(PassRefPtr<StringImpl> text)
+void TextDocumentParser::append(RefPtr<StringImpl>&& text)
 {
     if (!m_haveInsertedFakePreElement)
         insertFakePreElement();
-    HTMLDocumentParser::append(text);
+    HTMLDocumentParser::append(WTF::move(text));
 }
 
 void TextDocumentParser::insertFakePreElement()
index 5f5a09e..d3dec3f 100644 (file)
@@ -39,7 +39,7 @@ public:
 private:
     explicit TextDocumentParser(HTMLDocument&);
 
-    virtual void append(PassRefPtr<StringImpl>) override;
+    virtual void append(RefPtr<StringImpl>&&) override;
 
     void insertFakePreElement();
 
index 599da50..1e2e79b 100644 (file)
@@ -32,8 +32,8 @@
 
 namespace WebCore {
 
-NativeXPathNSResolver::NativeXPathNSResolver(PassRefPtr<Node> node)
-    : m_node(node)
+NativeXPathNSResolver::NativeXPathNSResolver(RefPtr<Node>&& node)
+    : m_node(WTF::move(node))
 {
 }
 
index 434c12e..6871228 100644 (file)
@@ -35,13 +35,13 @@ class Node;
 
 class NativeXPathNSResolver : public XPathNSResolver {
 public:
-    static Ref<NativeXPathNSResolver> create(PassRefPtr<Node> node) { return adoptRef(*new NativeXPathNSResolver(node)); }
+    static Ref<NativeXPathNSResolver> create(RefPtr<Node>&& node) { return adoptRef(*new NativeXPathNSResolver(WTF::move(node))); }
     virtual ~NativeXPathNSResolver();
 
     virtual String lookupNamespaceURI(const String& prefix);
 
 private:
-    explicit NativeXPathNSResolver(PassRefPtr<Node>);
+    explicit NativeXPathNSResolver(RefPtr<Node>&&);
     RefPtr<Node> m_node;
 };
 
index 673c5fb..8b26016 100644 (file)
@@ -84,7 +84,7 @@ void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi
     m_errorMessages.append(message);
 }
 
-static inline PassRefPtr<Element> createXHTMLParserErrorHeader(Document* doc, const String& errorMessages)
+static inline RefPtr<Element> createXHTMLParserErrorHeader(Document* doc, const String& errorMessages)
 {
     RefPtr<Element> reportElement = doc->createElement(QualifiedName(nullAtom, "parsererror", xhtmlNamespaceURI), true);
 
@@ -108,7 +108,7 @@ static inline PassRefPtr<Element> createXHTMLParserErrorHeader(Document* doc, co
     reportElement->parserAppendChild(h3.get());
     h3->parserAppendChild(doc->createTextNode("Below is a rendering of the page up to the first error."));
 
-    return reportElement.release();
+    return reportElement;
 }
 
 void XMLErrors::insertErrorMessageBlock()
index cf1ccb3..ab1708f 100644 (file)
@@ -81,15 +81,15 @@ void XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent(bool le
     m_hasThrottledProgressEvent = true;
 }
 
-void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtr<Event> event, ProgressEventAction progressEventAction)
+void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(RefPtr<Event>&& event, ProgressEventAction progressEventAction)
 {
     if (progressEventAction == FlushProgressEvent)
         flushProgressEvent();
 
-    dispatchEvent(event);
+    dispatchEvent(WTF::move(event));
 }
 
-void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtr<Event> event)
+void XMLHttpRequestProgressEventThrottle::dispatchEvent(RefPtr<Event>&& event)
 {
     ASSERT(event);
     if (m_deferEvents) {
@@ -97,9 +97,9 @@ void XMLHttpRequestProgressEventThrottle::dispatchEvent(PassRefPtr<Event> event)
             // Readystatechange events are state-less so avoid repeating two identical events in a row on resume.
             return;
         }
-        m_deferredEvents.append(event);
+        m_deferredEvents.append(WTF::move(event));
     } else
-        m_target->dispatchEvent(event);
+        m_target->dispatchEvent(WTF::move(event));
 }
 
 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicString& type)
@@ -153,7 +153,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents()
     // The progress event will be in the m_deferredEvents vector if the load was finished while suspended.
     // If not, just send the most up-to-date progress on resume.
     if (deferredProgressEvent)
-        dispatchEvent(deferredProgressEvent);
+        dispatchEvent(WTF::move(deferredProgressEvent));
 }
 
 void XMLHttpRequestProgressEventThrottle::fired()
index e65340f..29f4d65 100644 (file)
@@ -28,7 +28,6 @@
 #define XMLHttpRequestProgressEventThrottle_h
 
 #include "Timer.h"
-#include "wtf/PassRefPtr.h"
 #include "wtf/Vector.h"
 #include <wtf/Forward.h>
 
@@ -50,7 +49,7 @@ public:
     virtual ~XMLHttpRequestProgressEventThrottle();
 
     void dispatchThrottledProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
-    void dispatchReadyStateChangeEvent(PassRefPtr<Event>, ProgressEventAction = DoNotFlushProgressEvent);
+    void dispatchReadyStateChangeEvent(RefPtr<Event>&&, ProgressEventAction = DoNotFlushProgressEvent);
     void dispatchProgressEvent(const AtomicString&);
 
     void suspend();
@@ -62,7 +61,7 @@ private:
     virtual void fired();
     void dispatchDeferredEvents();
     void flushProgressEvent();
-    void dispatchEvent(PassRefPtr<Event>);
+    void dispatchEvent(RefPtr<Event>&&);
 
     bool hasEventToDispatch() const;
 
index ef5c2f1..90cd13b 100644 (file)
@@ -21,7 +21,7 @@
 #define XMLSerializer_h
 
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index b2a0f23..de0aa0d 100644 (file)
@@ -37,19 +37,19 @@ namespace WebCore {
 
 using namespace XPath;
 
-PassRefPtr<XPathExpression> XPathEvaluator::createExpression(const String& expression,
+RefPtr<XPathExpression> XPathEvaluator::createExpression(const String& expression,
                                                              XPathNSResolver* resolver,
                                                              ExceptionCode& ec)
 {
     return XPathExpression::createExpression(expression, resolver, ec);
 }
 
-PassRefPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* nodeResolver)
+Ref<XPathNSResolver> XPathEvaluator::createNSResolver(Node* nodeResolver)
 {
     return NativeXPathNSResolver::create(nodeResolver);
 }
 
-PassRefPtr<XPathResult> XPathEvaluator::evaluate(const String& expression,
+RefPtr<XPathResult> XPathEvaluator::evaluate(const String& expression,
                                                  Node* contextNode,
                                                  XPathNSResolver* resolver,
                                                  unsigned short type,
@@ -58,13 +58,13 @@ PassRefPtr<XPathResult> XPathEvaluator::evaluate(const String& expression,
 {
     if (!isValidContextNode(contextNode)) {
         ec = NOT_SUPPORTED_ERR;
-        return 0;
+        return nullptr;
     }
 
     ec = 0;
     RefPtr<XPathExpression> expr = createExpression(expression, resolver, ec);
     if (ec)
-        return 0;
+        return nullptr;
     
     return expr->evaluate(contextNode, type, result, ec);
 }
index 6448225..b16c248 100644 (file)
@@ -28,8 +28,8 @@
 #define XPathEvaluator_h
 
 #include <wtf/Forward.h>
+#include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
-#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
@@ -44,9 +44,9 @@ namespace WebCore {
     public:
         static Ref<XPathEvaluator> create() { return adoptRef(*new XPathEvaluator); }
         
-        PassRefPtr<XPathExpression> createExpression(const String& expression, XPathNSResolver*, ExceptionCode&);
-        PassRefPtr<XPathNSResolver> createNSResolver(Node* nodeResolver);
-        PassRefPtr<XPathResult> evaluate(const String& expression, Node* contextNode,
+        RefPtr<XPathExpression> createExpression(const String& expression, XPathNSResolver*, ExceptionCode&);
+        Ref<XPathNSResolver> createNSResolver(Node* nodeResolver);
+        RefPtr<XPathResult> evaluate(const String& expression, Node* contextNode,
             XPathNSResolver*, unsigned short type, XPathResult*, ExceptionCode&);
 
     private:
index 3d89b8d..4d59bea 100644 (file)
@@ -36,7 +36,9 @@ namespace WebCore {
         class NodeSet {
         public:
             NodeSet() : m_isSorted(true), m_subtreesAreDisjoint(false) { }
-            explicit NodeSet(PassRefPtr<Node> node) : m_isSorted(true), m_subtreesAreDisjoint(false), m_nodes(1, node) { }
+            explicit NodeSet(RefPtr<Node>&& node)
+                : m_isSorted(true), m_subtreesAreDisjoint(false), m_nodes(1, WTF::move(node))
+            { }
             
             size_t size() const { return m_nodes.size(); }
             bool isEmpty() const { return m_nodes.isEmpty(); }
@@ -45,7 +47,7 @@ namespace WebCore {
             void clear() { m_nodes.clear(); }
 
             // NodeSet itself does not verify that nodes in it are unique.
-            void append(PassRefPtr<Node> node) { m_nodes.append(node); }
+            void append(RefPtr<Node>&& node) { m_nodes.append(WTF::move(node)); }
             void append(const NodeSet& nodeSet) { m_nodes.appendVector(nodeSet.m_nodes); }
 
             // Returns the set's first node in document order, or nullptr if the set is empty.
index 7668115..ed37015 100644 (file)
@@ -61,7 +61,7 @@ Value Filter::evaluate() const
             ++evaluationContext.position;
             
             if (evaluatePredicate(*predicate))
-                newNodes.append(node);
+                newNodes.append(node.copyRef());
         }
         nodes = WTF::move(newNodes);
     }
@@ -130,7 +130,7 @@ void LocationPath::evaluate(NodeSet& nodes) const
 
             for (auto& match : matches) {
                 if (!needToCheckForDuplicateNodes || newNodesSet.add(match.get()).isNewEntry)
-                    newNodes.append(match);
+                    newNodes.append(match.copyRef());
             }
         }
         
index 4db2ed3..8dbb234 100644 (file)
@@ -44,9 +44,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(WTF::move(value))) { }
-            explicit Value(Node* value) : m_type(NodeSetValue), m_data(Data::create(value)) { }
-            explicit Value(PassRefPtr<Node> value) : m_type(NodeSetValue), m_data(Data::create(value)) { }
+            explicit Value(NodeSet&& value)
+                : m_type(NodeSetValue), m_data(Data::create(WTF::move(value)))
+            { }
+            explicit Value(Node* value)
+                : m_type(NodeSetValue), m_data(Data::create(value))
+            { }
+            explicit Value(RefPtr<Node>&& value)
+                : m_type(NodeSetValue), m_data(Data::create(WTF::move(value)))
+            { }
 
             Type type() const { return m_type; }
 
@@ -68,19 +74,25 @@ namespace WebCore {
             Value(void*) = delete;
 
             struct Data : public RefCounted<Data> {
-                static PassRefPtr<Data> create() { return adoptRef(new Data); }
-                static PassRefPtr<Data> create(const String& string) { return adoptRef(new Data(string)); }
-                static PassRefPtr<Data> create(NodeSet nodeSet) { return adoptRef(new Data(WTF::move(nodeSet))); }
-                static PassRefPtr<Data> create(PassRefPtr<Node> node) { return adoptRef(new Data(node)); }
+                static Ref<Data> create() { return adoptRef(*new Data); }
+                static Ref<Data> create(const String& string) { return adoptRef(*new Data(string)); }
+                static Ref<Data> create(NodeSet&& nodeSet) { return adoptRef(*new Data(WTF::move(nodeSet))); }
+                static Ref<Data> create(RefPtr<Node>&& node) { return adoptRef(*new Data(WTF::move(node))); }
 
                 String string;
                 NodeSet nodeSet;
 
             private:
                 Data() { }
-                explicit Data(const String& string) : string(string) { }
-                explicit Data(NodeSet nodeSet) : nodeSet(WTF::move(nodeSet)) { }
-                explicit Data(PassRefPtr<Node> node) : nodeSet(node) { }
+                explicit Data(const String& string)
+                    : string(string)
+                { }
+                explicit Data(NodeSet&& nodeSet)
+                    : nodeSet(WTF::move(nodeSet))
+                { }
+                explicit Data(RefPtr<Node>&& node)
+                    : nodeSet(WTF::move(node))
+                { }
             };
 
             Type m_type;
index 1f0958b..b4fbdef 100644 (file)
@@ -109,23 +109,23 @@ Ref<Document> XSLTProcessor::createDocumentFromSource(const String& sourceString
     return result.releaseNonNull();
 }
 
-PassRefPtr<Document> XSLTProcessor::transformToDocument(Node* sourceNode)
+RefPtr<Document> XSLTProcessor::transformToDocument(Node* sourceNode)
 {
     if (!sourceNode)
-        return 0;
+        return nullptr;
 
     String resultMIMEType;
     String resultString;
     String resultEncoding;
     if (!transformToString(*sourceNode, resultMIMEType, resultString, resultEncoding))
-        return 0;
+        return nullptr;
     return createDocumentFromSource(resultString, resultEncoding, resultMIMEType, sourceNode, 0);
 }
 
-PassRefPtr<DocumentFragment> XSLTProcessor::transformToFragment(Node* sourceNode, Document* outputDoc)
+RefPtr<DocumentFragment> XSLTProcessor::transformToFragment(Node* sourceNode, Document* outputDoc)
 {
     if (!sourceNode || !outputDoc)
-        return 0;
+        return nullptr;
 
     String resultMIMEType;
     String resultString;
@@ -136,7 +136,7 @@ PassRefPtr<DocumentFragment> XSLTProcessor::transformToFragment(Node* sourceNode
         resultMIMEType = "text/html";
 
     if (!transformToString(*sourceNode, resultMIMEType, resultString, resultEncoding))
-        return 0;
+        return nullptr;
     return createFragmentForTransformToFragment(resultString, resultMIMEType, outputDoc);
 }
 
index 682328f..48b2780 100644 (file)
@@ -44,18 +44,18 @@ public:
     static Ref<XSLTProcessor> create() { return adoptRef(*new XSLTProcessor); }
     ~XSLTProcessor();
 
-    void setXSLStyleSheet(PassRefPtr<XSLStyleSheet> styleSheet) { m_stylesheet = styleSheet; }
+    void setXSLStyleSheet(RefPtr<XSLStyleSheet>&& styleSheet) { m_stylesheet = WTF::move(styleSheet); }
     bool transformToString(Node& source, String& resultMIMEType, String& resultString, String& resultEncoding);
     Ref<Document> createDocumentFromSource(const String& source, const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode, Frame* frame);
     
     // DOM methods
-    void importStylesheet(PassRefPtr<Node> style)
+    void importStylesheet(RefPtr<Node>&& style)
     {
         if (style)
-            m_stylesheetRootNode = style;
+            m_stylesheetRootNode = WTF::move(style);
     }
-    PassRefPtr<DocumentFragment> transformToFragment(Node* source, Document* ouputDoc);
-    PassRefPtr<Document> transformToDocument(Node* source);
+    RefPtr<DocumentFragment> transformToFragment(Node* source, Document* ouputDoc);
+    RefPtr<Document> transformToDocument(Node* source);
     
     void setParameter(const String& namespaceURI, const String& localName, const String& value);
     String getParameter(const String& namespaceURI, const String& localName) const;
index 5508df3..808ceef 100644 (file)
@@ -105,9 +105,9 @@ void XMLDocumentParser::insert(const SegmentedString&)
     ASSERT_NOT_REACHED();
 }
 
-void XMLDocumentParser::append(PassRefPtr<StringImpl> inputSource)
+void XMLDocumentParser::append(RefPtr<StringImpl>&& inputSource)
 {
-    SegmentedString source(inputSource);
+    SegmentedString source(WTF::move(inputSource));
     if (m_sawXSLTransform || !m_sawFirstElement)
         m_originalSourceForTransform.append(source);
 
index 6fdce6d..8f43f90 100644 (file)
@@ -98,7 +98,7 @@ class Text;
 
         // From DocumentParser
         virtual void insert(const SegmentedString&) override;
-        virtual void append(PassRefPtr<StringImpl>) override;
+        virtual void append(RefPtr<StringImpl>&&) override;
         virtual void finish() override;
         virtual bool isWaitingForScripts() const override;
         virtual void stopParsing() override;