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

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

Issue 979443002: PlzNavigate: send history params at commit time to the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 10 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
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 75e61001c501bc9a5320b5e493187b67c4437afa..ab80d5432c579df4a497ec80b160898287a60cc6 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -61,7 +61,8 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
FrameTreeNode* frame_tree_node,
const NavigationEntryImpl& entry,
FrameMsg_Navigate_Type::Value navigation_type,
- base::TimeTicks navigation_start) {
+ base::TimeTicks navigation_start,
+ const HistoryNavigationParams& history_params) {
std::string method = entry.GetHasPostData() ? "POST" : "GET";
// Copy existing headers and add necessary headers that may not be present
@@ -94,18 +95,15 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest(
frame_tree_node,
- CommonNavigationParams(entry.GetURL(), entry.GetReferrer(),
- entry.GetTransitionType(), navigation_type,
- !entry.IsViewSourceMode(),ui_timestamp,
- report_type, entry.GetBaseURLForDataURL(),
- entry.GetHistoryURLForDataURL()),
+ CommonNavigationParams(
+ entry.GetURL(), entry.GetReferrer(), entry.GetTransitionType(),
+ navigation_type, !entry.IsViewSourceMode(), ui_timestamp, report_type,
+ entry.GetBaseURLForDataURL(), entry.GetHistoryURLForDataURL()),
BeginNavigationParams(method, headers.ToString(),
- LoadFlagFromNavigationType(navigation_type),
- false),
- CommitNavigationParams(entry.GetPageState(),
- entry.GetIsOverridingUserAgent(),
+ LoadFlagFromNavigationType(navigation_type), false),
+ CommitNavigationParams(entry.GetIsOverridingUserAgent(),
navigation_start),
- request_body, true, &entry));
+ history_params, request_body, true, &entry));
return navigation_request.Pass();
}
@@ -114,7 +112,9 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
FrameTreeNode* frame_tree_node,
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
- scoped_refptr<ResourceRequestBody> body) {
+ scoped_refptr<ResourceRequestBody> body,
+ int current_history_list_offset,
+ int current_history_list_length) {
// TODO(clamy): Check if some PageState should be provided here.
// TODO(clamy): See how we should handle override of the user agent when the
// navigation may start in a renderer and commit in another one.
@@ -122,7 +122,9 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
// renderer and sent to the browser instead of being measured here.
scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest(
frame_tree_node, common_params, begin_params,
- CommitNavigationParams(PageState(), false, base::TimeTicks::Now()),
+ CommitNavigationParams(false, base::TimeTicks::Now()),
+ HistoryNavigationParams(PageState(), -1, -1, current_history_list_offset,
+ current_history_list_length, false),
body, false, nullptr));
return navigation_request.Pass();
}
@@ -132,6 +134,7 @@ NavigationRequest::NavigationRequest(
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
const CommitNavigationParams& commit_params,
+ const HistoryNavigationParams& history_params,
scoped_refptr<ResourceRequestBody> body,
bool browser_initiated,
const NavigationEntryImpl* entry)
@@ -139,6 +142,7 @@ NavigationRequest::NavigationRequest(
common_params_(common_params),
begin_params_(begin_params),
commit_params_(commit_params),
+ history_params_(history_params),
browser_initiated_(browser_initiated),
state_(NOT_STARTED),
restore_type_(NavigationEntryImpl::RESTORE_NONE),
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698