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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 24243007: Allow webview API in an unblessed extension process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed style error Created 7 years, 3 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
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 672cf866c0e7c974431b6e7f90432b3c9706a4e6..fd28ede69d3fd06021028144a347b1df0c9094cb 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -1113,7 +1113,16 @@ void Dispatcher::DidCreateScriptContext(
module_system->Require("windowControls");
}
- if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
+ // Currently only platform apps and whitelisted component extensions support
+ // the <webview> tag, because the "denyWebView" module will affect the
+ // performance of DOM modifications (http://crbug.com/196453).
+ // We used to limit WebView to |BLESSED_EXTENSION_CONTEXT| within platform
+ // apps. An ext/app runs in a blessed extension context, if it is the active
+ // extension in the current process, in other words, if it is loaded in a top
+ // frame. To support webview in a non-frame extension, we have to allow
+ // unblessed extension context as well.
+ if (context_type == Feature::BLESSED_EXTENSION_CONTEXT ||
+ context_type == Feature::UNBLESSED_EXTENSION_CONTEXT) {
// Note: setting up the WebView class here, not the chrome.webview API.
// The API will be automatically set up when first used.
if (extension->HasAPIPermission(APIPermission::kWebView)) {
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | content/browser/browser_plugin/browser_plugin_guest_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698