Home | History | Annotate | Download | only in gin
      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.
      4 
      5 #include "gin/function_template.h"
      6 
      7 #include "gin/per_isolate_data.h"
      8 
      9 namespace gin {
     10 
     11 WrapperInfo internal::CallbackHolderBase::kWrapperInfo = { kEmbedderNativeGin };
     12 
     13 void InitFunctionTemplates(PerIsolateData* isolate_data) {
     14   if (!isolate_data->GetObjectTemplate(
     15           &internal::CallbackHolderBase::kWrapperInfo).IsEmpty()) {
     16     return;
     17   }
     18 
     19   v8::Handle<v8::ObjectTemplate> templ(
     20       v8::ObjectTemplate::New(isolate_data->isolate()));
     21   templ->SetInternalFieldCount(kNumberOfInternalFields);
     22   isolate_data->SetObjectTemplate(&internal::CallbackHolderBase::kWrapperInfo,
     23                                   templ);
     24 }
     25 
     26 }  // namespace gin
     27