diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-17 21:47:04 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-17 21:47:04 +0000 |
commit | cb6c2bb25fa9cb9aaa7713fb829f77d660899b39 (patch) | |
tree | ee85fec3be3152fcb7ad8c8caa8dac19072a37e8 /gin/function_template.cc | |
parent | 22c17bcb2e798ed74c25cd366b40d8483c7eaf24 (diff) | |
download | chromium_src-cb6c2bb25fa9cb9aaa7713fb829f77d660899b39.zip chromium_src-cb6c2bb25fa9cb9aaa7713fb829f77d660899b39.tar.gz chromium_src-cb6c2bb25fa9cb9aaa7713fb829f77d660899b39.tar.bz2 |
[gin] Introduce Wrappable::GetObjectTemplate
Instead of explicitly registering object templates for all wrapper
infos, add a method on wrappable that returns the template when
needed.
BUG=none
R=aa@chromium.org,abarth@chromium.org
Review URL: https://codereview.chromium.org/113893005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/function_template.cc')
-rw-r--r-- | gin/function_template.cc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/gin/function_template.cc b/gin/function_template.cc index 5dd5ecd..243ac12 100644 --- a/gin/function_template.cc +++ b/gin/function_template.cc @@ -4,23 +4,12 @@ #include "gin/function_template.h" -#include "gin/per_isolate_data.h" - namespace gin { -WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin }; +namespace internal { -void InitFunctionTemplates(PerIsolateData* isolate_data) { - if (!isolate_data->GetObjectTemplate( - &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) { - return; - } +WrapperInfo CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin }; - v8::Handle<v8::ObjectTemplate> templ( - v8::ObjectTemplate::New(isolate_data->isolate())); - templ->SetInternalFieldCount(kNumberOfInternalFields); - isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo, - templ); -} +} // namespace internal } // namespace gin |