blob: 07882e8796e8ac3c9aab37d91677aa44300fd3f6 [file] [log] [blame]
[email protected]314cde12013-11-23 20:26:511// 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.
4
5#include "gin/function_template.h"
6
7#include "gin/per_isolate_data.h"
8
9namespace gin {
10
[email protected]81f8b91b2013-11-26 21:02:5111WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin };
[email protected]314cde12013-11-23 20:26:5112
[email protected]81f8b91b2013-11-26 21:02:5113WrapperInfo* internal::CallbackHolderBase::GetWrapperInfo() {
14 return &kWrapperInfo;
[email protected]314cde12013-11-23 20:26:5115}
16
[email protected]81f8b91b2013-11-26 21:02:5117void InitFunctionTemplates(PerIsolateData* isolate_data) {
18 if (!isolate_data->GetObjectTemplate(
19 &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) {
20 return;
21 }
22
[email protected]91cd4fe2013-11-28 09:31:5823 v8::Handle<v8::ObjectTemplate> templ(
24 v8::ObjectTemplate::New(isolate_data->isolate()));
[email protected]81f8b91b2013-11-26 21:02:5125 templ->SetInternalFieldCount(kNumberOfInternalFields);
26 isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo,
27 templ);
[email protected]314cde12013-11-23 20:26:5128}
29
30} // namespace gin