summaryrefslogtreecommitdiffstats
path: root/gin/gin.gyp
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-21 18:38:51 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-21 18:38:51 +0000
commit93f9f360fc88ea3bae8e74b7b22ad25d1ddaec85 (patch)
tree35d4b253f7d95749f54c3ed179bb8c99834a3f79 /gin/gin.gyp
parent69ef3fe6c0e79036f8e6f1b740b0cd96137e461e (diff)
downloadchromium_src-93f9f360fc88ea3bae8e74b7b22ad25d1ddaec85.zip
chromium_src-93f9f360fc88ea3bae8e74b7b22ad25d1ddaec85.tar.gz
chromium_src-93f9f360fc88ea3bae8e74b7b22ad25d1ddaec85.tar.bz2
[Gin] Add a mechanism for wrapping C++ object
This CL adds a mechanism for wrapping C++ objects to Gin. The approach in this CL is similar to Blink's ScriptWrappable class, with a couple of differences: 1) gin::Wrappable has a vtable whereas Blink's ScriptWrappable class does not. Having a vtable in this base class lets us simplify a large number of concerns. We've talked about adding a vtable to ScriptWrappable but have avoided it because Blink creates many thousands of wrapped objects. When we refactor Blink to use Gin, we can still support the non-vtable approach, but most clients of Gin will want the simpler approach. 2) In Gin, we've bound together the notion of being reference counted with the notion of being wrappable from JavaScript. In Blink, those concepts are separate because we don't want to introduce a virtual destructor for ScriptWrappable. However, because gin::Wrappable already has a vtable, adding a virtual destructor is relatively cheap. Actually wrapping a C++ object still takes too much typing, but we can improve that in future CLs. R=jochen@chromium.org BUG=317398 Review URL: https://codereview.chromium.org/79203004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/gin.gyp')
-rw-r--r--gin/gin.gyp23
1 files changed, 13 insertions, 10 deletions
diff --git a/gin/gin.gyp b/gin/gin.gyp
index e0ec34c..4b08dfc 100644
--- a/gin/gin.gyp
+++ b/gin/gin.gyp
@@ -19,14 +19,6 @@
'../v8/tools/gyp/v8.gyp:v8',
],
'sources': [
- 'modules/console.cc',
- 'modules/console.h',
- 'modules/file_module_provider.cc',
- 'modules/file_module_provider.h',
- 'modules/module_registry.cc',
- 'modules/module_registry.h',
- 'modules/module_runner_delegate.cc',
- 'modules/module_runner_delegate.h',
'arguments.cc',
'arguments.h',
'array_buffer.cc',
@@ -39,17 +31,27 @@
'dictionary.h',
'gin.cc',
'gin.h',
+ 'modules/console.cc',
+ 'modules/console.h',
+ 'modules/file_module_provider.cc',
+ 'modules/file_module_provider.h',
+ 'modules/module_registry.cc',
+ 'modules/module_registry.h',
+ 'modules/module_runner_delegate.cc',
+ 'modules/module_runner_delegate.h',
'per_context_data.cc',
'per_context_data.h',
'per_isolate_data.cc',
'per_isolate_data.h',
+ 'public/gin_embedders.h',
+ 'public/wrapper_info.h',
'runner.cc',
'runner.h',
'try_catch.cc',
'try_catch.h',
+ 'wrappable.cc',
+ 'wrappable.h',
'wrapper_info.cc',
- 'public/gin_embedders.h',
- 'public/wrapper_info.h',
],
},
{
@@ -100,6 +102,7 @@
'test/run_all_unittests.cc',
'test/run_js_tests.cc',
'runner_unittest.cc',
+ 'wrappable_unittest.cc',
],
},
],