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/per_isolate_data.h" |
8 | 8 |
9 namespace gin { | 9 namespace gin { |
10 | 10 |
11 WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin }; | |
12 | |
13 WrapperInfo* internal::CallbackHolderBase::GetWrapperInfo() { | |
14 return &kWrapperInfo; | |
15 } | |
16 | |
17 void InitFunctionTemplates(PerIsolateData* isolate_data) { | 11 void InitFunctionTemplates(PerIsolateData* isolate_data) { |
18 if (!isolate_data->GetObjectTemplate( | 12 if (!isolate_data->GetObjectTemplate( |
19 &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) { | 13 &WrappableTraits<internal::CallbackHolderBase>:: |
Aaron Boodman
2013/12/06 06:36:24
I'm going to automate function template registrati
| |
14 kWrapperInfo).IsEmpty()) { | |
20 return; | 15 return; |
21 } | 16 } |
22 | 17 |
23 v8::Handle<v8::ObjectTemplate> templ( | 18 v8::Handle<v8::ObjectTemplate> templ( |
24 v8::ObjectTemplate::New(isolate_data->isolate())); | 19 v8::ObjectTemplate::New(isolate_data->isolate())); |
25 templ->SetInternalFieldCount(kNumberOfInternalFields); | 20 templ->SetInternalFieldCount(kNumberOfInternalFields); |
26 isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo, | 21 isolate_data->SetObjectTemplate( |
27 templ); | 22 &WrappableTraits<internal::CallbackHolderBase>::kWrapperInfo, templ); |
28 } | 23 } |
29 | 24 |
30 } // namespace gin | 25 } // namespace gin |
OLD | NEW |