Index: extensions/renderer/dispatcher.cc |
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc |
index 44b2fd0f96e818a1bf056574ab16224c2ad99ab8..6e087ac39f6effd9aca1ea099043f7e90ea26562 100644 |
--- a/extensions/renderer/dispatcher.cc |
+++ b/extensions/renderer/dispatcher.cc |
@@ -257,6 +257,16 @@ void Dispatcher::DidCreateScriptContext( |
extension_id = ""; |
} |
+ bool is_within_platform_app = extension && extension->is_platform_app(); |
+ |
+ // If we are navigating to a platform app URL, the extension must first have |
+ // been activated. If not, IsWithinPlatformApp will incorrectly return false, |
+ // and we will be missing information about what features the app has. |
+ // (Note: This DCHECK is invalid for non-app extensions, which do not get |
+ // activated in "unblessed" contexts such as content scripts and iframes.) |
+ if (is_within_platform_app) |
+ DCHECK(IsExtensionActive(extension_id)); |
not at google - send to devlin
2014/07/07 14:45:55
Good idea. A slightly stronger check would be to m
Matt Giuca
2014/07/10 08:04:56
Done.
|
+ |
Feature::Context context_type = |
ClassifyJavaScriptContext(extension, |
extension_group, |
@@ -296,7 +306,6 @@ void Dispatcher::DidCreateScriptContext( |
UpdateBindingsForContext(context); |
- bool is_within_platform_app = IsWithinPlatformApp(); |
// Inject custom JS into the platform app context. |
if (is_within_platform_app) { |
module_system->Require("platformApp"); |