From cb6c2bb25fa9cb9aaa7713fb829f77d660899b39 Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Tue, 17 Dec 2013 21:47:04 +0000 Subject: [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 --- gin/function_template.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'gin/function_template.cc') 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 templ( - v8::ObjectTemplate::New(isolate_data->isolate())); - templ->SetInternalFieldCount(kNumberOfInternalFields); - isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo, - templ); -} +} // namespace internal } // namespace gin -- cgit v1.1