Index: chrome/renderer/js_only_v8_extensions.cc |
diff --git a/chrome/renderer/js_only_v8_extensions.cc b/chrome/renderer/js_only_v8_extensions.cc |
index 6d94b9265b098247da8da39c51f9e6b18922091f..ff36a2bcfcd7afb141e1a27af533397f4477bae1 100644 |
--- a/chrome/renderer/js_only_v8_extensions.cc |
+++ b/chrome/renderer/js_only_v8_extensions.cc |
@@ -13,13 +13,17 @@ using bindings_utils::GetStringResource; |
// BaseJsV8Extension |
const char* BaseJsV8Extension::kName = "chrome/base"; |
v8::Extension* BaseJsV8Extension::Get() { |
- return new v8::Extension(kName, GetStringResource<IDR_DEVTOOLS_BASE_JS>(), |
- 0, NULL); |
+ static v8::Extension* extension = |
+ new v8::Extension(kName, GetStringResource<IDR_DEVTOOLS_BASE_JS>(), |
+ 0, NULL); |
+ return extension; |
} |
// JsonSchemaJsV8Extension |
const char* JsonSchemaJsV8Extension::kName = "chrome/jsonschema"; |
v8::Extension* JsonSchemaJsV8Extension::Get() { |
- return new v8::Extension(kName, GetStringResource<IDR_JSON_SCHEMA_JS>(), |
- 0, NULL); |
+ static v8::Extension* extension = |
+ new v8::Extension(kName, GetStringResource<IDR_JSON_SCHEMA_JS>(), |
+ 0, NULL); |
+ return extension; |
} |