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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2901223003: PlzNavigate: Fix wrong SourceLocation. (Closed)
Patch Set: Rebase + Fix conflicts. 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: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 3ad3d19795f3f9bf7be811c06cae00022fd3a6c8..fcf4fe12c7b01dfcb9d81f37c7ac2e98587e4e47 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1256,6 +1256,7 @@ bool FrameLoader::ShouldClose(bool is_reload) {
NavigationPolicy FrameLoader::ShouldContinueForNavigationPolicy(
const ResourceRequest& request,
+ Document* origin_document,
const SubstituteData& substitute_data,
DocumentLoader* loader,
ContentSecurityPolicyDisposition
@@ -1291,8 +1292,8 @@ NavigationPolicy FrameLoader::ShouldContinueForNavigationPolicy(
bool replaces_current_history_item =
frame_load_type == kFrameLoadTypeReplaceCurrentItem;
policy = Client()->DecidePolicyForNavigation(
- request, loader, type, policy, replaces_current_history_item,
- is_client_redirect, form,
+ request, origin_document, loader, type, policy,
+ replaces_current_history_item, is_client_redirect, form,
should_check_main_world_content_security_policy);
if (policy == kNavigationPolicyCurrentTab ||
policy == kNavigationPolicyIgnore ||
@@ -1325,10 +1326,15 @@ NavigationPolicy FrameLoader::ShouldContinueForRedirectNavigationPolicy(
kCheckContentSecurityPolicy,
settings && settings->GetBrowserSideNavigationEnabled(),
ContentSecurityPolicy::CheckHeaderType::kCheckReportOnly);
+
return ShouldContinueForNavigationPolicy(
- request, substitute_data, loader,
- should_check_main_world_content_security_policy, type, policy,
- frame_load_type, is_client_redirect, form);
+ request,
+ // |origin_document| is not set. It doesn't really matter here. It is
+ // useful for PlzNavigate (aka browser-side-navigation). It is used
+ // during the first navigation and not during redirects.
+ nullptr, // origin_document
+ substitute_data, loader, should_check_main_world_content_security_policy,
+ type, policy, frame_load_type, is_client_redirect, form);
}
NavigationPolicy FrameLoader::CheckLoadCanStart(
@@ -1362,7 +1368,8 @@ NavigationPolicy FrameLoader::CheckLoadCanStart(
ModifyRequestForCSP(resource_request, nullptr);
return ShouldContinueForNavigationPolicy(
- resource_request, frame_load_request.GetSubstituteData(), nullptr,
+ resource_request, frame_load_request.OriginDocument(),
+ frame_load_request.GetSubstituteData(), nullptr,
frame_load_request.ShouldCheckMainWorldContentSecurityPolicy(),
navigation_type, navigation_policy, type,
frame_load_request.ClientRedirect() ==
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698