Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / xml / XPathResult.h
index 8ace2fd..b074bb8 100644 (file)
 #ifndef XPathResult_h
 #define XPathResult_h
 
-#include "bindings/v8/ScriptWrappable.h"
+#include "bindings/core/v8/ScriptWrappable.h"
 #include "core/xml/XPathValue.h"
-#include "heap/Handle.h"
+#include "platform/heap/Handle.h"
 #include "wtf/Forward.h"
 #include "wtf/RefCounted.h"
 
-namespace WebCore {
+namespace blink {
 
 class Document;
 class ExceptionState;
 class Node;
 
-class XPathResult : public RefCountedWillBeGarbageCollectedFinalized<XPathResult>, public ScriptWrappable {
+namespace XPath {
+struct EvaluationContext;
+}
+
+class XPathResult final : public RefCountedWillBeGarbageCollected<XPathResult>, public ScriptWrappable {
+    DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(XPathResult);
+    DEFINE_WRAPPERTYPEINFO();
 public:
     enum XPathResultType {
         ANY_TYPE = 0,
@@ -54,11 +60,10 @@ public:
         FIRST_ORDERED_NODE_TYPE = 9
     };
 
-    static PassRefPtrWillBeRawPtr<XPathResult> create(Document* document, const XPath::Value& value)
+    static PassRefPtrWillBeRawPtr<XPathResult> create(XPath::EvaluationContext& context, const XPath::Value& value)
     {
-        return adoptRefWillBeNoop(new XPathResult(document, value));
+        return adoptRefWillBeNoop(new XPathResult(context, value));
     }
-    ~XPathResult();
 
     void convertTo(unsigned short type, ExceptionState&);
 
@@ -76,19 +81,20 @@ public:
 
     const XPath::Value& value() const { return m_value; }
 
-    void trace(Visitor*) { }
+    void trace(Visitor*);
 
 private:
-    XPathResult(Document*, const XPath::Value&);
+    XPathResult(XPath::EvaluationContext&, const XPath::Value&);
+    XPath::NodeSet& nodeSet() { return *m_nodeSet; }
 
     XPath::Value m_value;
     unsigned m_nodeSetPosition;
-    XPath::NodeSet m_nodeSet; // FIXME: why duplicate the node set stored in m_value?
+    OwnPtrWillBeMember<XPath::NodeSet> m_nodeSet; // FIXME: why duplicate the node set stored in m_value?
     unsigned short m_resultType;
-    RefPtr<Document> m_document;
+    RefPtrWillBeMember<Document> m_document;
     uint64_t m_domTreeVersion;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // XPathResult_h