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

Unified Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2870843003: Complete UI thread blob/filesystem URL blocking and remove IO thread check.
Patch Set: Remove unnecessary headers Created 3 years, 7 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: extensions/browser/extension_navigation_throttle.cc
diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc
index bb5137148c7c948ae3f85f0053051e87ae883751..d26441f8f357652a6888425b57d7e63fbd57a1ef 100644
--- a/extensions/browser/extension_navigation_throttle.cc
+++ b/extensions/browser/extension_navigation_throttle.cc
@@ -53,14 +53,17 @@ ExtensionNavigationThrottle::WillStartRequest() {
if (is_nested_url && origin.scheme() == extensions::kExtensionScheme &&
!is_extension) {
// Relax this restriction for apps that use <webview>. See
- // https://crbug.com/652077.
+ // https://crbug.com/652077. Be careful to require the request to be
+ // made from a <webview> guest process if the app has a webview
+ // permission (https://crbug.com/656752).
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(origin.host());
bool has_webview_permission =
extension &&
extension->permissions_data()->HasAPIPermission(
extensions::APIPermission::kWebView);
- if (!has_webview_permission)
+ bool from_guest = guest_view::GuestViewBase::IsGuest(web_contents);
+ if (!has_webview_permission || !from_guest)
alexmos 2017/05/10 17:12:19 I was thinking whether we can go one step further
ncarter (slow) 2017/05/10 17:47:10 I'm aware of a few deficiencies with this logic, a
alexmos 2017/05/10 20:20:56 That's a really good question. I agree that with
alexmos 2017/05/24 18:48:19 Nick, should we take another look at this before t
return content::NavigationThrottle::CANCEL;
}

Powered by Google App Engine
This is Rietveld 408576698