From b4acaf8b4e3092096deebc23f1b60bea0773379a Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Thu, 12 Dec 2013 09:40:50 +0000 Subject: [gin] Declare a wrappable's kWrapperInfo on the class deriving from Wrappable Otherwise, we need to put INIT_WRAPPABLE() in namespace gin no matter where the derived class is declared. I pulled this out from https://codereview.chromium.org/111083005/ BUG=none R=dcarney@chromium.org TBR=aa@chromium.org Review URL: https://codereview.chromium.org/113163007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240271 0039d316-1c4b-4281-b951-d872f2087c98 --- gin/wrappable_unittest.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gin/wrappable_unittest.cc') diff --git a/gin/wrappable_unittest.cc b/gin/wrappable_unittest.cc index 7ffc0ca..3499eed 100644 --- a/gin/wrappable_unittest.cc +++ b/gin/wrappable_unittest.cc @@ -17,6 +17,8 @@ namespace gin { class MyObject : public Wrappable { public: + static WrapperInfo kWrapperInfo; + static gin::Handle Create(v8::Isolate* isolate) { return CreateHandle(isolate, new MyObject()); } @@ -32,14 +34,18 @@ class MyObject : public Wrappable { }; class MyObject2 : public Wrappable { + public: + static WrapperInfo kWrapperInfo; }; class MyObjectBlink : public Wrappable { + public: + static WrapperInfo kWrapperInfo; }; -INIT_WRAPPABLE(gin::MyObject); -INIT_WRAPPABLE(gin::MyObject2); -INIT_WRAPPABLE(gin::MyObjectBlink); +WrapperInfo MyObject::kWrapperInfo = { kEmbedderNativeGin }; +WrapperInfo MyObject2::kWrapperInfo = { kEmbedderNativeGin }; +WrapperInfo MyObjectBlink::kWrapperInfo = { kEmbedderNativeGin }; void RegisterTemplates(v8::Isolate* isolate) { PerIsolateData* data = PerIsolateData::From(isolate); -- cgit v1.1