Revert of https://codereview.chromium.org/94133003/
[chromium-blink-merge.git] / gin / function_template.cc
blob07882e8796e8ac3c9aab37d91677aa44300fd3f6
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
3 // found in the LICENSE file.
5 #include "gin/function_template.h"
7 #include "gin/per_isolate_data.h"
9 namespace gin {
11 WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin };
13 WrapperInfo* internal::CallbackHolderBase::GetWrapperInfo() {
14 return &kWrapperInfo;
17 void InitFunctionTemplates(PerIsolateData* isolate_data) {
18 if (!isolate_data->GetObjectTemplate(
19 &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) {
20 return;
23 v8::Handle<v8::ObjectTemplate> templ(
24 v8::ObjectTemplate::New(isolate_data->isolate()));
25 templ->SetInternalFieldCount(kNumberOfInternalFields);
26 isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo,
27 templ);
30 } // namespace gin