Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: Source/bindings/core/v8/ScriptWrappable.h

Issue 478243002: bindings: Adds virtual ScriptWrappable::wrap method. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced and sent out to the code review. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptWrappable.cpp » ('j') | Source/bindings/core/v8/ScriptWrappable.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698