Index: chrome/renderer/extensions/dispatcher.cc |
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc |
index e6c06a64272d60b68b2d4350b0ea72f8d2ac82ff..586e2bf00d7771b2b71bc64dbff1f4483dd6e515 100644 |
--- a/chrome/renderer/extensions/dispatcher.cc |
+++ b/chrome/renderer/extensions/dispatcher.cc |
@@ -950,32 +950,14 @@ void Dispatcher::DidCreateScriptContext( |
GetOrCreateChrome(v8_context); |
- // Loading JavaScript is expensive, so only run the full API bindings |
- // generation mechanisms in extension pages (NOT all web pages). |
- switch (context_type) { |
- case Feature::UNSPECIFIED_CONTEXT: |
- case Feature::WEB_PAGE_CONTEXT: |
- // TODO(kalman): see comment below about ExtensionAPI. |
- InstallBindings(module_system.get(), v8_context, "app"); |
- InstallBindings(module_system.get(), v8_context, "webstore"); |
- break; |
- case Feature::BLESSED_EXTENSION_CONTEXT: |
- case Feature::UNBLESSED_EXTENSION_CONTEXT: |
- case Feature::CONTENT_SCRIPT_CONTEXT: { |
- if (extension && !extension->is_platform_app()) |
- module_system->Require("miscellaneous_bindings"); |
- module_system->Require("json"); // see paranoid comment in json.js |
- |
- // TODO(kalman): move this code back out of the switch and execute it |
- // regardless of |context_type|. ExtensionAPI knows how to return the |
- // correct APIs, however, until it doesn't have a 2MB overhead we can't |
- // load it in every process. |
- RegisterSchemaGeneratedBindings(module_system.get(), |
- context, |
- v8_context); |
- break; |
- } |
- } |
+ if (extension && !extension->is_platform_app()) |
not at google - send to devlin
2013/03/22 18:13:48
I'm happy every time I see this!
|
+ module_system->Require("miscellaneous_bindings"); |
+ module_system->Require("json"); // see paranoid comment in json.js |
not at google - send to devlin
2013/03/22 18:13:48
hm, this might end up being a problem. maybe. I ju
cduvall
2013/03/22 20:26:45
Done.
|
+ RegisterSchemaGeneratedBindings(module_system.get(), |
+ context, |
+ v8_context); |
+ InstallBindings(module_system.get(), v8_context, "app"); |
+ InstallBindings(module_system.get(), v8_context, "webstore"); |
not at google - send to devlin
2013/03/22 18:13:48
with this patch these two lines might actually be
cduvall
2013/03/22 20:26:45
Done.
|
bool is_within_platform_app = IsWithinPlatformApp(frame); |
// Inject custom JS into the platform app context. |