diff options
Diffstat (limited to 'gin/per_isolate_data.cc')
-rw-r--r-- | gin/per_isolate_data.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc index 1320904..56b2c53 100644 --- a/gin/per_isolate_data.cc +++ b/gin/per_isolate_data.cc @@ -25,9 +25,17 @@ PerIsolateData* PerIsolateData::From(Isolate* isolate) { return static_cast<PerIsolateData*>(isolate->GetData()); } -void PerIsolateData::RegisterObjectTemplate( - WrapperInfo* info, Local<ObjectTemplate> object_template) { - object_templates_[info] = Eternal<ObjectTemplate>(isolate_, object_template); +void PerIsolateData::SetObjectTemplate(WrapperInfo* info, + Local<ObjectTemplate> templ) { + object_templates_[info] = Eternal<ObjectTemplate>(isolate_, templ); +} + +v8::Local<v8::ObjectTemplate> PerIsolateData::GetObjectTemplate( + WrapperInfo* info) { + ObjectTemplateMap::iterator it = object_templates_.find(info); + if (it == object_templates_.end()) + return v8::Local<v8::ObjectTemplate>(); + return it->second.Get(isolate_); } } // namespace gin |