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

Unified Diff: extensions/browser/url_request_util.cc

Issue 2249423002: Do not immediately block cross-renderer extension resource loads for non-web-triggered transitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip extension-specific checks for webviews. Created 4 years, 4 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/browser/url_request_util.cc
diff --git a/extensions/browser/url_request_util.cc b/extensions/browser/url_request_util.cc
index 2450fa3e32eae6287d72999f3eee7b32c30a133b..39f6f847743732371773708bd4d535615f624194 100644
--- a/extensions/browser/url_request_util.cc
+++ b/extensions/browser/url_request_util.cc
@@ -40,17 +40,13 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request,
info->GetChildID(), &partition_id);
std::string resource_path = request->url().path();
- // |owner_extension == extension| needs to be checked because extension
- // resources should only be accessible to WebViews owned by that extension.
- if (is_guest && owner_extension == extension &&
- WebviewInfo::IsResourceWebviewAccessible(extension, partition_id,
- resource_path)) {
- *allowed = true;
- return true;
- }
-
- if (!ui::PageTransitionIsWebTriggerable(info->GetPageTransition())) {
nasko 2016/08/17 16:31:44 As per my response in the bug, I think this should
robwu 2016/08/18 08:09:58 I restored this check and moved it to the end out
- *allowed = false;
+ if (is_guest) {
+ // Extension resources should only be accessible to WebViews owned by that
+ // extension.
+ if (owner_extension != extension)
+ return false;
nasko 2016/08/17 16:31:44 Why this rewrite in this patch? I think the goal i
robwu 2016/08/18 08:09:58 Without this change, the following test would fail
+ *allowed = WebviewInfo::IsResourceWebviewAccessible(extension, partition_id,
+ resource_path);
return true;
}
« 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