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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 371563005: Extensions: DCHECK that all app pages are blessed before use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698