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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: PlzNavigate: identify same-page browser-initiated navigation. Created 4 years 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0179a9c1a5568f865c138447966a8f0d0b83418a..175980755b65c02dc8682d49f7fa4c225c35a590 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -551,7 +551,8 @@ bool IsTopLevelNavigation(WebFrame* frame) {
WebURLRequest CreateURLRequestForNavigation(
const CommonNavigationParams& common_params,
std::unique_ptr<StreamOverrideParameters> stream_override,
- bool is_view_source_mode_enabled) {
+ bool is_view_source_mode_enabled,
+ bool is_same_document_navigation) {
WebURLRequest request(common_params.url);
if (is_view_source_mode_enabled)
request.setCachePolicy(WebCachePolicy::ReturnCacheDataElseLoad);
@@ -569,6 +570,8 @@ WebURLRequest CreateURLRequestForNavigation(
}
}
+ request.setIsSameDocumentNavigation(is_same_document_navigation);
+
request.setLoFiState(
static_cast<WebURLRequest::LoFiState>(common_params.lofi_state));
@@ -5063,7 +5066,8 @@ void RenderFrameImpl::OnFailedNavigation(
CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code);
WebURLRequest failed_request = CreateURLRequestForNavigation(
common_params, std::unique_ptr<StreamOverrideParameters>(),
- frame_->isViewSourceModeEnabled());
+ frame_->isViewSourceModeEnabled(),
+ false); // is_same_document_navigation
if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
// The browser expects this frame to be loading an error page. Inform it
@@ -5744,7 +5748,8 @@ void RenderFrameImpl::NavigateInternal(
WebHistoryItem item_for_history_navigation;
WebURLRequest request =
CreateURLRequestForNavigation(common_params, std::move(stream_params),
- frame_->isViewSourceModeEnabled());
+ frame_->isViewSourceModeEnabled(),
+ request_params.is_same_document_navigation);
request.setFrameType(IsTopLevelNavigation(frame_)
? blink::WebURLRequest::FrameTypeTopLevel
: blink::WebURLRequest::FrameTypeNested);

Powered by Google App Engine
This is Rietveld 408576698