Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: chrome/renderer/js_only_v8_extensions.cc

Issue 159542: Add a WebKit API that registers a V8 extension to be loaded into content (Closed)
Patch Set: final Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/renderer_extension_bindings.cc ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « chrome/renderer/extensions/renderer_extension_bindings.cc ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698