Chromium Code Reviews| Index: gin/per_isolate_data.cc |
| diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc |
| index 13209046cd9b4e896f67987c7f054fd9e55c9ee3..0f7a13c0a6ecbb21347d584ad6cb27ecaf51a67d 100644 |
| --- a/gin/per_isolate_data.cc |
| +++ b/gin/per_isolate_data.cc |
| @@ -25,9 +25,18 @@ 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::RegisterObjectTemplate(WrapperInfo* info, |
| + Local<ObjectTemplate> templ) { |
| + object_templates_[info] = Eternal<ObjectTemplate>(isolate_, templ); |
| +} |
| + |
| +bool PerIsolateData::GetObjectTemplate(WrapperInfo* info, |
|
Aaron Boodman
2013/11/11 19:01:08
You can avoid the two return values by having this
abarth-chromium
2013/11/11 20:17:42
Ok.
|
| + Local<ObjectTemplate>* out) { |
| + ObjectTemplateMap::iterator it = object_templates_.find(info); |
| + if (it == object_templates_.end()) |
| + return false; |
| + *out = it->second.Get(isolate_); |
| + return true; |
| } |
| } // namespace gin |