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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1457053004: Fix in-page logic for allow_universal_access_from_files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from review Created 5 years, 1 month 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: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index ce13a1605d44d5078abbbaa310eb403700cf2e61..194a0e87499083a111e4e0f7db41cbe078dba168 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1382,6 +1382,9 @@ bool NavigationControllerImpl::IsURLInPageNavigation(
}
WebPreferences prefs = rfh->GetRenderViewHost()->GetWebkitPreferences();
+ const url::Origin& committed_origin = static_cast<RenderFrameHostImpl*>(rfh)
+ ->frame_tree_node()
+ ->current_origin();
bool is_same_origin = last_committed_url.is_empty() ||
// TODO(japhet): We should only permit navigations
// originating from about:blank to be in-page if the
@@ -1393,7 +1396,7 @@ bool NavigationControllerImpl::IsURLInPageNavigation(
last_committed_url.GetOrigin() == url.GetOrigin() ||
!prefs.web_security_enabled ||
(prefs.allow_universal_access_from_file_urls &&
- last_committed_url.SchemeIs(url::kFileScheme));
+ committed_origin.scheme() == url::kFileScheme);
if (!is_same_origin && renderer_says_in_page) {
bad_message::ReceivedBadMessage(rfh->GetProcess(),
bad_message::NC_IN_PAGE_NAVIGATION);
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698