OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gin/modules/module_registry.h" | 5 #include "gin/modules/module_registry.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 WrapperInfo g_wrapper_info = { kEmbedderNativeGin }; | 89 WrapperInfo g_wrapper_info = { kEmbedderNativeGin }; |
90 | 90 |
91 Local<FunctionTemplate> GetDefineTemplate(Isolate* isolate) { | 91 Local<FunctionTemplate> GetDefineTemplate(Isolate* isolate) { |
92 PerIsolateData* data = PerIsolateData::From(isolate); | 92 PerIsolateData* data = PerIsolateData::From(isolate); |
93 Local<FunctionTemplate> templ = data->GetFunctionTemplate( | 93 Local<FunctionTemplate> templ = data->GetFunctionTemplate( |
94 &g_wrapper_info); | 94 &g_wrapper_info); |
95 if (templ.IsEmpty()) { | 95 if (templ.IsEmpty()) { |
96 templ = FunctionTemplate::New(isolate, Define); | 96 templ = FunctionTemplate::New(isolate, Define); |
| 97 templ->RemovePrototype(); |
97 data->SetFunctionTemplate(&g_wrapper_info, templ); | 98 data->SetFunctionTemplate(&g_wrapper_info, templ); |
98 } | 99 } |
99 return templ; | 100 return templ; |
100 } | 101 } |
101 | 102 |
102 } // namespace | 103 } // namespace |
103 | 104 |
104 ModuleRegistry::ModuleRegistry(Isolate* isolate) | 105 ModuleRegistry::ModuleRegistry(Isolate* isolate) |
105 : modules_(isolate, Object::New(isolate)) { | 106 : modules_(isolate, Object::New(isolate)) { |
106 } | 107 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 for (size_t i = 0; i < pending_modules.size(); ++i) { | 280 for (size_t i = 0; i < pending_modules.size(); ++i) { |
280 std::unique_ptr<PendingModule> pending(pending_modules[i]); | 281 std::unique_ptr<PendingModule> pending(pending_modules[i]); |
281 pending_modules[i] = NULL; | 282 pending_modules[i] = NULL; |
282 if (AttemptToLoad(isolate, std::move(pending))) | 283 if (AttemptToLoad(isolate, std::move(pending))) |
283 keep_trying = true; | 284 keep_trying = true; |
284 } | 285 } |
285 } | 286 } |
286 } | 287 } |
287 | 288 |
288 } // namespace gin | 289 } // namespace gin |
OLD | NEW |