Index: Source/bindings/core/v8/ScriptWrappable.h |
diff --git a/Source/bindings/core/v8/ScriptWrappable.h b/Source/bindings/core/v8/ScriptWrappable.h |
index c3e968b003e8bd7a557e05d88714ff66181108bf..d3825dc401c60da1b829cd5a59f0c637b7cfc3ed 100644 |
--- a/Source/bindings/core/v8/ScriptWrappable.h |
+++ b/Source/bindings/core/v8/ScriptWrappable.h |
@@ -148,6 +148,14 @@ public: |
initializeScriptWrappableHelper(object); |
} |
+ // Returns the WrapperTypeInfo of the instance. |
+ // |
+ // This method must be overridden by using DEFINE_WRAPPERTYPEINFO macro. |
haraken
2014/08/29 05:24:04
by using => by
Yuki
2014/09/01 06:06:39
Done.
Yuki
2014/09/01 06:06:39
Done.
|
+ virtual const WrapperTypeInfo* wrapperTypeInfo() const = 0; |
+ |
+ // Creates and returns a new wrapper object. |
+ virtual v8::Handle<v8::Object> wrap(v8::Handle<v8::Object> creationContext, v8::Isolate*); |
+ |
void setWrapper(v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperConfiguration& configuration) |
{ |
ASSERT(!containsWrapper()); |
@@ -338,6 +346,22 @@ private: |
} |
}; |
+// Defines 'wrapperTypeInfo' virtual method which returns the WrapperTypeInfo of |
+// the instance. Also declares a static member of type WrapperTypeInfo, of which |
+// the definition is given by the IDL code generator. |
+// |
+// All the derived classes of ScriptWrappable, regardless of directly or |
+// indirectly, must write this macro in the class definition except for the case |
+// that the class is NoInterfaceObject. |
haraken
2014/08/29 05:24:04
Help me understand: What's the relationship betwee
Yuki
2014/09/01 06:06:39
Added more comment.
|
+#define DEFINE_WRAPPERTYPEINFO() \ |
+public: \ |
+ virtual const WrapperTypeInfo* wrapperTypeInfo() const OVERRIDE \ |
+ { \ |
+ return &s_wrapperTypeInfo; \ |
+ } \ |
+private: \ |
+ static const WrapperTypeInfo& s_wrapperTypeInfo |
+ |
} // namespace blink |
#endif // ScriptWrappable_h |