OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gin/function_template.h" | 5 #include "gin/function_template.h" |
6 | 6 |
7 #include "gin/per_isolate_data.h" | 7 #include "gin/object_template_builder.h" |
8 | 8 |
9 namespace gin { | 9 namespace gin { |
10 | 10 |
11 WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin }; | 11 namespace internal { |
12 | 12 |
13 void InitFunctionTemplates(PerIsolateData* isolate_data) { | 13 WrapperInfo CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin }; |
14 if (!isolate_data->GetObjectTemplate( | |
15 &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) { | |
16 return; | |
17 } | |
18 | 14 |
19 v8::Handle<v8::ObjectTemplate> templ( | 15 v8::Local<v8::ObjectTemplate> CallbackHolderBase::GetObjectTemplate( |
20 v8::ObjectTemplate::New(isolate_data->isolate())); | 16 v8::Isolate* isolate) { |
21 templ->SetInternalFieldCount(kNumberOfInternalFields); | 17 return ObjectTemplateBuilder(isolate).Build(); |
22 isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo, | |
23 templ); | |
24 } | 18 } |
25 | 19 |
| 20 } // namespace internal |
| 21 |
26 } // namespace gin | 22 } // namespace gin |
OLD | NEW |