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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2652123002: PlzNavigate: Attempt to fix blink layout tests which fail due to duplicate output from WebFrameClie… (Closed)
Patch Set: Created 3 years, 11 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d005abc8ee4b5192f990e7cb6ce681db76665d1c..265cfbfb59aba84b77560c0b67c037aea8c5e150 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -555,7 +555,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,
+ int nav_entry_id) {
WebURLRequest request(common_params.url);
if (is_view_source_mode_enabled)
request.setCachePolicy(WebCachePolicy::ReturnCacheDataElseLoad);
@@ -590,6 +591,7 @@ WebURLRequest CreateURLRequestForNavigation(
request.setInputPerfMetricReportPolicy(
static_cast<WebURLRequest::InputToLoadPerfMetricReportPolicy>(
common_params.report_type));
+ request.setNavigationInitiatedByRenderer(nav_entry_id == 0);
return request;
}
@@ -5209,7 +5211,7 @@ 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(), request_params.nav_entry_id);
if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
// The browser expects this frame to be loading an error page. Inform it
@@ -5900,7 +5902,8 @@ void RenderFrameImpl::NavigateInternal(
WebHistoryItem item_for_history_navigation;
WebURLRequest request =
CreateURLRequestForNavigation(common_params, std::move(stream_params),
- frame_->isViewSourceModeEnabled());
+ frame_->isViewSourceModeEnabled(),
+ request_params.nav_entry_id);
request.setFrameType(IsTopLevelNavigation(frame_)
? blink::WebURLRequest::FrameTypeTopLevel
: blink::WebURLRequest::FrameTypeNested);

Powered by Google App Engine
This is Rietveld 408576698