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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2316573002: PlzNavigate: Support ResourceTiming API (Closed)
Patch Set: Created 4 years, 3 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 fbd8279f491e1b8f8686c548166e01c4fa128fa0..758e9b467d30c05bc7753e2cc4758205a77fdbdb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5475,6 +5475,20 @@ void RenderFrameImpl::NavigateInternal(
if (browser_side_navigation)
request.setCheckForBrowserSideNavigation(false);
+ // PlzNavigate: Store the previous ResourceResponses in the request.
+ DCHECK(request_params.redirects.size() ==
+ request_params.resource_response_infos.size());
+ for (size_t i = 0; i < request_params.redirects.size(); ++i) {
+ const GURL& url = request_params.redirects[i];
+ const ResourceResponseInfo& info =
+ request_params.resource_response_infos[i];
+ WebURLResponse response;
+ WebURLLoaderImpl::PopulateURLResponse(url, info, &response, false);
+ request.appendPreviousResponse(response);
+ }
+ request.setPreviousNavigationStart(
+ (common_params.navigation_start - base::TimeTicks()).InSecondsF());
+
// If we are reloading, then use the history state of the current frame.
// Otherwise, if we have history state, then we need to navigate to it, which
// corresponds to a back/forward navigation event. Update the parameters

Powered by Google App Engine
This is Rietveld 408576698