summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/frame_host/navigation_controller_impl_unittest.cc4
-rw-r--r--content/browser/frame_host/navigation_entry_impl.cc125
-rw-r--r--content/browser/frame_host/navigation_entry_impl.h23
-rw-r--r--content/browser/frame_host/navigation_request.cc26
-rw-r--r--content/browser/frame_host/navigation_request.h14
-rw-r--r--content/browser/frame_host/navigator_impl.cc9
-rw-r--r--content/browser/frame_host/navigator_impl.h1
-rw-r--r--content/browser/frame_host/render_frame_host_impl.cc26
-rw-r--r--content/browser/frame_host/render_frame_host_impl.h6
-rw-r--r--content/browser/frame_host/render_frame_host_manager.h2
-rw-r--r--content/browser/renderer_host/render_view_host_impl.h1
-rw-r--r--content/common/frame_messages.h33
-rw-r--r--content/common/navigation_params.cc99
-rw-r--r--content/common/navigation_params.h149
-rw-r--r--content/public/test/render_view_test.cc15
-rw-r--r--content/renderer/accessibility/renderer_accessibility_browsertest.cc13
-rw-r--r--content/renderer/navigation_state_impl.cc10
-rw-r--r--content/renderer/navigation_state_impl.h10
-rw-r--r--content/renderer/render_frame_impl.cc70
-rw-r--r--content/renderer/render_frame_impl.h10
-rw-r--r--content/renderer/render_view_browsertest.cc176
-rw-r--r--content/renderer/render_view_impl.cc14
-rw-r--r--content/renderer/render_view_impl.h1
23 files changed, 405 insertions, 432 deletions
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index c18ca9b..60dadb28 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -240,8 +240,8 @@ class NavigationControllerTest
const IPC::Message* message =
process()->sink().GetFirstMessageMatching(FrameMsg_Navigate::ID);
CHECK(message);
- Tuple<CommonNavigationParams, StartNavigationParams, CommitNavigationParams,
- HistoryNavigationParams> nav_params;
+ Tuple<CommonNavigationParams, StartNavigationParams,
+ RequestNavigationParams> nav_params;
FrameMsg_Navigate::Read(message, &nav_params);
return get<0>(nav_params).url;
}
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index c7a84de..82b97f9 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -7,7 +7,6 @@
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "content/browser/frame_host/navigation_controller_impl.h"
#include "content/common/navigation_params.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
@@ -387,38 +386,6 @@ NavigationEntryImpl* NavigationEntryImpl::Clone() const {
return copy;
}
-void NavigationEntryImpl::ResetForCommit() {
- // Any state that only matters when a navigation entry is pending should be
- // cleared here.
- // TODO(creis): This state should be moved to NavigationRequest once
- // PlzNavigate is enabled.
- SetBrowserInitiatedPostData(nullptr);
- set_source_site_instance(nullptr);
- set_is_renderer_initiated(false);
- set_transferred_global_request_id(GlobalRequestID());
- set_should_replace_entry(false);
-
- set_should_clear_history_list(false);
- set_frame_tree_node_id(-1);
-
-#if defined(OS_ANDROID)
- // Reset the time stamp so that the metrics are not reported if this entry is
- // loaded again in the future.
- set_intent_received_timestamp(base::TimeTicks());
-#endif
-}
-
-void NavigationEntryImpl::SetScreenshotPNGData(
- scoped_refptr<base::RefCountedBytes> png_data) {
- screenshot_ = png_data;
- if (screenshot_.get())
- UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size());
-}
-
-GURL NavigationEntryImpl::GetHistoryURLForDataURL() const {
- return GetBaseURLForDataURL().is_empty() ? GURL() : GetVirtualURL();
-}
-
CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
FrameMsg_Navigate_Type::Value navigation_type) const {
FrameMsg_UILoadMetricsReportType::Value report_type =
@@ -436,8 +403,27 @@ CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams(
GetHistoryURLForDataURL());
}
-CommitNavigationParams NavigationEntryImpl::ConstructCommitNavigationParams(
- base::TimeTicks navigation_start) const {
+StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams()
+ const {
+ std::vector<unsigned char> browser_initiated_post_data;
+ if (GetBrowserInitiatedPostData()) {
+ browser_initiated_post_data.assign(
+ GetBrowserInitiatedPostData()->front(),
+ GetBrowserInitiatedPostData()->front() +
+ GetBrowserInitiatedPostData()->size());
+ }
+
+ return StartNavigationParams(
+ GetHasPostData(), extra_headers(), browser_initiated_post_data,
+ should_replace_entry(), transferred_global_request_id().child_id,
+ transferred_global_request_id().request_id);
+}
+
+RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams(
+ base::TimeTicks navigation_start,
+ int pending_history_list_offset,
+ int current_history_list_offset,
+ int current_history_list_length) const {
// Set the redirect chain to the navigation's redirects, unless returning to a
// completed navigation (whose previous redirects don't apply).
std::vector<GURL> redirects;
@@ -445,44 +431,55 @@ CommitNavigationParams NavigationEntryImpl::ConstructCommitNavigationParams(
redirects = GetRedirectChain();
}
- return CommitNavigationParams(GetIsOverridingUserAgent(), navigation_start,
- redirects, GetCanLoadLocalResources(),
- GetFrameToNavigate(), base::Time::Now());
-}
-
-HistoryNavigationParams NavigationEntryImpl::ConstructHistoryNavigationParams(
- NavigationControllerImpl* controller) const {
- int pending_history_list_offset = controller->GetIndexOfEntry(this);
- int current_history_list_offset = controller->GetLastCommittedEntryIndex();
- int current_history_list_length = controller->GetEntryCount();
+ int pending_offset_to_send = pending_history_list_offset;
+ int current_offset_to_send = current_history_list_offset;
+ int current_length_to_send = current_history_list_length;
if (should_clear_history_list()) {
// Set the history list related parameters to the same values a
// NavigationController would return before its first navigation. This will
// fully clear the RenderView's view of the session history.
- pending_history_list_offset = -1;
- current_history_list_offset = -1;
- current_history_list_length = 0;
+ pending_offset_to_send = -1;
+ current_offset_to_send = -1;
+ current_length_to_send = 0;
}
- return HistoryNavigationParams(
- GetPageState(), GetPageID(), pending_history_list_offset,
- current_history_list_offset, current_history_list_length,
+ return RequestNavigationParams(
+ GetIsOverridingUserAgent(), navigation_start, redirects,
+ GetCanLoadLocalResources(), GetFrameToNavigate(), base::Time::Now(),
+ GetPageState(), GetPageID(), pending_offset_to_send,
+ current_offset_to_send, current_length_to_send,
should_clear_history_list());
}
-StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams()
- const {
- std::vector<unsigned char> browser_initiated_post_data;
- if (GetBrowserInitiatedPostData()) {
- browser_initiated_post_data.assign(
- GetBrowserInitiatedPostData()->front(),
- GetBrowserInitiatedPostData()->front() +
- GetBrowserInitiatedPostData()->size());
- }
+void NavigationEntryImpl::ResetForCommit() {
+ // Any state that only matters when a navigation entry is pending should be
+ // cleared here.
+ // TODO(creis): This state should be moved to NavigationRequest once
+ // PlzNavigate is enabled.
+ SetBrowserInitiatedPostData(nullptr);
+ set_source_site_instance(nullptr);
+ set_is_renderer_initiated(false);
+ set_transferred_global_request_id(GlobalRequestID());
+ set_should_replace_entry(false);
- return StartNavigationParams(
- GetHasPostData(), extra_headers(), browser_initiated_post_data,
- should_replace_entry(), transferred_global_request_id().child_id,
- transferred_global_request_id().request_id);
+ set_should_clear_history_list(false);
+ set_frame_tree_node_id(-1);
+
+#if defined(OS_ANDROID)
+ // Reset the time stamp so that the metrics are not reported if this entry is
+ // loaded again in the future.
+ set_intent_received_timestamp(base::TimeTicks());
+#endif
+}
+
+void NavigationEntryImpl::SetScreenshotPNGData(
+ scoped_refptr<base::RefCountedBytes> png_data) {
+ screenshot_ = png_data;
+ if (screenshot_.get())
+ UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size());
+}
+
+GURL NavigationEntryImpl::GetHistoryURLForDataURL() const {
+ return GetBaseURLForDataURL().is_empty() ? GURL() : GetVirtualURL();
}
} // namespace content
diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h
index 0528da0..0d7b3eb 100644
--- a/content/browser/frame_host/navigation_entry_impl.h
+++ b/content/browser/frame_host/navigation_entry_impl.h
@@ -18,10 +18,8 @@
#include "content/public/common/ssl_status.h"
namespace content {
-class NavigationControllerImpl;
-struct CommitNavigationParams;
struct CommonNavigationParams;
-struct HistoryNavigationParams;
+struct RequestNavigationParams;
struct StartNavigationParams;
class CONTENT_EXPORT NavigationEntryImpl
@@ -124,6 +122,17 @@ class CONTENT_EXPORT NavigationEntryImpl
// tab) and one that draws them from a different pool (for use in a new tab).
NavigationEntryImpl* Clone() const;
+ // Helper functions to construct NavigationParameters for a navigation to this
+ // NavigationEntry.
+ CommonNavigationParams ConstructCommonNavigationParams(
+ FrameMsg_Navigate_Type::Value navigation_type) const;
+ StartNavigationParams ConstructStartNavigationParams() const;
+ RequestNavigationParams ConstructRequestNavigationParams(
+ base::TimeTicks navigation_start,
+ int pending_offset_to_send,
+ int current_offset_to_send,
+ int current_length_to_send) const;
+
// Once a navigation entry is committed, we should no longer track several
// pieces of non-persisted state, as documented on the members below.
void ResetForCommit();
@@ -262,14 +271,6 @@ class CONTENT_EXPORT NavigationEntryImpl
// Returns the history URL for a data URL to use in Blink.
GURL GetHistoryURLForDataURL() const;
- CommonNavigationParams ConstructCommonNavigationParams(
- FrameMsg_Navigate_Type::Value navigation_type) const;
- CommitNavigationParams ConstructCommitNavigationParams(
- base::TimeTicks navigation_start) const;
- HistoryNavigationParams ConstructHistoryNavigationParams(
- NavigationControllerImpl* controller) const;
- StartNavigationParams ConstructStartNavigationParams() const;
-
#if defined(OS_ANDROID)
base::TimeTicks intent_received_timestamp() const {
return intent_received_timestamp_;
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 62349d7..e5973ee 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -89,9 +89,11 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
frame_tree_node, entry.ConstructCommonNavigationParams(navigation_type),
BeginNavigationParams(method, headers.ToString(),
LoadFlagFromNavigationType(navigation_type), false),
- entry.ConstructCommitNavigationParams(navigation_start),
- entry.ConstructHistoryNavigationParams(controller), request_body, true,
- &entry));
+ entry.ConstructRequestNavigationParams(
+ navigation_start, controller->GetIndexOfEntry(&entry),
+ controller->GetLastCommittedEntryIndex(),
+ controller->GetEntryCount()),
+ request_body, true, &entry));
return navigation_request.Pass();
}
@@ -108,11 +110,13 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
// navigation may start in a renderer and commit in another one.
// TODO(clamy): See if the navigation start time should be measured in the
// 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(),
- HistoryNavigationParams(PageState(), -1, -1, current_history_list_offset,
- current_history_list_length, false),
- body, false, nullptr));
+ // TODO(clamy): The pending history list offset should be properly set.
+ RequestNavigationParams request_params;
+ request_params.current_history_list_offset = current_history_list_offset;
+ request_params.current_history_list_length = current_history_list_length;
+ scoped_ptr<NavigationRequest> navigation_request(
+ new NavigationRequest(frame_tree_node, common_params, begin_params,
+ request_params, body, false, nullptr));
return navigation_request.Pass();
}
@@ -120,16 +124,14 @@ NavigationRequest::NavigationRequest(
FrameTreeNode* frame_tree_node,
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
scoped_refptr<ResourceRequestBody> body,
bool browser_initiated,
const NavigationEntryImpl* entry)
: frame_tree_node_(frame_tree_node),
common_params_(common_params),
begin_params_(begin_params),
- commit_params_(commit_params),
- history_params_(history_params),
+ request_params_(request_params),
browser_initiated_(browser_initiated),
state_(NOT_STARTED),
restore_type_(NavigationEntryImpl::RESTORE_NONE),
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
index 80c5fc7..cfb94bf 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -17,7 +17,7 @@
namespace content {
class FrameTreeNode;
-class NavigationController;
+class NavigationControllerImpl;
class NavigationURLLoader;
class ResourceRequestBody;
class SiteInstanceImpl;
@@ -88,10 +88,8 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
const BeginNavigationParams& begin_params() const { return begin_params_; }
- const CommitNavigationParams& commit_params() const { return commit_params_; }
-
- const HistoryNavigationParams& history_params() const {
- return history_params_;
+ const RequestNavigationParams& request_params() const {
+ return request_params_;
}
NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
@@ -125,8 +123,7 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
NavigationRequest(FrameTreeNode* frame_tree_node,
const CommonNavigationParams& common_params,
const BeginNavigationParams& begin_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
scoped_refptr<ResourceRequestBody> body,
bool browser_initiated,
const NavigationEntryImpl* navitation_entry);
@@ -149,8 +146,7 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
// redirects.
CommonNavigationParams common_params_;
const BeginNavigationParams begin_params_;
- const CommitNavigationParams commit_params_;
- const HistoryNavigationParams history_params_;
+ const RequestNavigationParams request_params_;
const bool browser_initiated_;
NavigationState state_;
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index bb4de6d..6d58505 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -317,8 +317,10 @@ bool NavigatorImpl::NavigateToEntry(
dest_render_frame_host->Navigate(
entry.ConstructCommonNavigationParams(navigation_type),
entry.ConstructStartNavigationParams(),
- entry.ConstructCommitNavigationParams(navigation_start),
- entry.ConstructHistoryNavigationParams(controller_));
+ entry.ConstructRequestNavigationParams(
+ navigation_start, controller_->GetIndexOfEntry(&entry),
+ controller_->GetLastCommittedEntryIndex(),
+ controller_->GetEntryCount()));
} else {
// No need to navigate again. Just resume the deferred request.
dest_render_frame_host->GetProcess()->ResumeDeferredNavigation(
@@ -700,8 +702,7 @@ void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node,
render_frame_host->CommitNavigation(response, body.Pass(),
navigation_request->common_params(),
- navigation_request->commit_params(),
- navigation_request->history_params());
+ navigation_request->request_params());
}
// PlzNavigate
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index bf075ff..debf309 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -15,7 +15,6 @@
#include "url/gurl.h"
class GURL;
-struct FrameMsg_Navigate_Params;
namespace content {
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index a1bc386..88bfbe0 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1541,8 +1541,7 @@ bool RenderFrameHostImpl::CanCommitURL(const GURL& url) {
void RenderFrameHostImpl::Navigate(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params) {
+ const RequestNavigationParams& request_params) {
TRACE_EVENT0("navigation", "RenderFrameHostImpl::Navigate");
// Browser plugin guests are not allowed to navigate outside web-safe schemes,
// so do not grant them the ability to request additional URLs.
@@ -1562,8 +1561,8 @@ void RenderFrameHostImpl::Navigate(
// file access. If this is a different process, we will need to grant the
// access again. The files listed in the page state are validated when they
// are received from the renderer to prevent abuse.
- if (history_params.page_state.IsValid()) {
- render_view_host_->GrantFileAccessFromPageState(history_params.page_state);
+ if (request_params.page_state.IsValid()) {
+ render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
}
// Only send the message if we aren't suspended at the start of a cross-site
@@ -1574,15 +1573,15 @@ void RenderFrameHostImpl::Navigate(
// second navigation occurs, RenderFrameHostManager will cancel this pending
// RFH and create a new pending RFH.
DCHECK(!suspended_nav_params_.get());
- suspended_nav_params_.reset(new NavigationParams(
- common_params, start_params, commit_params, history_params));
+ suspended_nav_params_.reset(
+ new NavigationParams(common_params, start_params, request_params));
} else {
// Get back to a clean state, in case we start a new navigation without
// completing a RFH swap or unload handler.
SetState(RenderFrameHostImpl::STATE_DEFAULT);
Send(new FrameMsg_Navigate(routing_id_, common_params, start_params,
- commit_params, history_params));
+ request_params));
}
// Force the throbber to start. We do this because Blink's "started
@@ -1605,8 +1604,7 @@ void RenderFrameHostImpl::NavigateToURL(const GURL& url) {
url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::NORMAL,
true, base::TimeTicks::Now(), FrameMsg_UILoadMetricsReportType::NO_REPORT,
GURL(), GURL());
- Navigate(common_params, StartNavigationParams(), CommitNavigationParams(),
- HistoryNavigationParams());
+ Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
}
void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params,
@@ -1718,8 +1716,7 @@ void RenderFrameHostImpl::CommitNavigation(
ResourceResponse* response,
scoped_ptr<StreamHandle> body,
const CommonNavigationParams& common_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params) {
+ const RequestNavigationParams& request_params) {
DCHECK((response && body.get()) ||
!NavigationRequest::ShouldMakeNetworkRequest(common_params.url));
// TODO(clamy): Check if we have to add security checks for the browser plugin
@@ -1733,7 +1730,7 @@ void RenderFrameHostImpl::CommitNavigation(
const ResourceResponseHead head = response ?
response->head : ResourceResponseHead();
Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
- commit_params, history_params));
+ request_params));
// TODO(clamy): Check if we should start the throbber for non javascript urls
// here.
@@ -1948,13 +1945,12 @@ void RenderFrameHostImpl::SetNavigationsSuspended(
SetState(RenderFrameHostImpl::STATE_DEFAULT);
DCHECK(!proceed_time.is_null());
- suspended_nav_params_->commit_params.browser_navigation_start =
+ suspended_nav_params_->request_params.browser_navigation_start =
proceed_time;
Send(new FrameMsg_Navigate(routing_id_,
suspended_nav_params_->common_params,
suspended_nav_params_->start_params,
- suspended_nav_params_->commit_params,
- suspended_nav_params_->history_params));
+ suspended_nav_params_->request_params));
suspended_nav_params_.reset();
}
}
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index fa4756f..aeefa13 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -327,8 +327,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
// rather than sending it.
void Navigate(const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
// Load the specified URL; this is a shortcut for Navigate().
void NavigateToURL(const GURL& url);
@@ -441,8 +440,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
void CommitNavigation(ResourceResponse* response,
scoped_ptr<StreamHandle> body,
const CommonNavigationParams& common_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
// Sets up the Mojo connection between this instance and its associated render
// frame if it has not yet been set up.
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h
index f7c15e2..89eeef6 100644
--- a/content/browser/frame_host/render_frame_host_manager.h
+++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -20,8 +20,6 @@
#include "content/public/common/referrer.h"
#include "ui/base/page_transition_types.h"
-struct FrameMsg_Navigate_Params;
-
namespace content {
class BrowserContext;
class CrossProcessFrameConnector;
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index b64ba93..69d6f47 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -29,7 +29,6 @@
class SkBitmap;
class FrameMsg_Navigate;
-struct FrameMsg_Navigate_Params;
struct MediaPlayerAction;
struct ViewHostMsg_CreateWindow_Params;
struct ViewMsg_PostMessage_Params;
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 38cd6ba..127daf0 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -223,16 +223,22 @@ IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams)
IPC_STRUCT_TRAITS_MEMBER(has_user_gesture)
IPC_STRUCT_TRAITS_END()
-IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams)
+IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams)
+ IPC_STRUCT_TRAITS_MEMBER(is_post)
+ IPC_STRUCT_TRAITS_MEMBER(extra_headers)
+ IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
+ IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
+ IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id)
+ IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams)
IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent)
IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start)
IPC_STRUCT_TRAITS_MEMBER(redirects)
IPC_STRUCT_TRAITS_MEMBER(can_load_local_resources)
IPC_STRUCT_TRAITS_MEMBER(frame_to_navigate)
IPC_STRUCT_TRAITS_MEMBER(request_time)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(content::HistoryNavigationParams)
IPC_STRUCT_TRAITS_MEMBER(page_state)
IPC_STRUCT_TRAITS_MEMBER(page_id)
IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset)
@@ -241,15 +247,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::HistoryNavigationParams)
IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list)
IPC_STRUCT_TRAITS_END()
-IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams)
- IPC_STRUCT_TRAITS_MEMBER(is_post)
- IPC_STRUCT_TRAITS_MEMBER(extra_headers)
- IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
- IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
- IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id)
- IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id)
-IPC_STRUCT_TRAITS_END()
-
IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState)
IPC_STRUCT_TRAITS_MEMBER(origin)
IPC_STRUCT_TRAITS_MEMBER(sandbox_flags)
@@ -363,11 +360,10 @@ IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy,
// Tells the renderer to perform the specified navigation, interrupting any
// existing navigation.
-IPC_MESSAGE_ROUTED4(FrameMsg_Navigate,
+IPC_MESSAGE_ROUTED3(FrameMsg_Navigate,
content::CommonNavigationParams, /* common_params */
content::StartNavigationParams, /* start_params */
- content::CommitNavigationParams, /* commit_params */
- content::HistoryNavigationParams /* history_params */)
+ content::RequestNavigationParams /* request_params */)
// Instructs the renderer to invoke the frame's beforeunload event handler.
// Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
@@ -502,12 +498,11 @@ IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
// Tells the renderer that a navigation is ready to commit. The renderer should
// request |stream_url| to get access to the stream containing the body of the
// response.
-IPC_MESSAGE_ROUTED5(FrameMsg_CommitNavigation,
+IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation,
content::ResourceResponseHead, /* response */
GURL, /* stream_url */
content::CommonNavigationParams, /* common_params */
- content::CommitNavigationParams, /* commit_params */
- content::HistoryNavigationParams /* history_params */)
+ content::RequestNavigationParams /* request_params */)
#if defined(ENABLE_PLUGINS)
// Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 18628b4..0e8df3c 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -40,8 +40,7 @@ CommonNavigationParams::~CommonNavigationParams() {
}
BeginNavigationParams::BeginNavigationParams()
- : load_flags(0),
- has_user_gesture(false) {
+ : load_flags(0), has_user_gesture(false) {
}
BeginNavigationParams::BeginNavigationParams(std::string method,
@@ -54,46 +53,63 @@ BeginNavigationParams::BeginNavigationParams(std::string method,
has_user_gesture(has_user_gesture) {
}
-CommitNavigationParams::CommitNavigationParams()
- : is_overriding_user_agent(false),
- browser_navigation_start(base::TimeTicks::Now()),
- can_load_local_resources(false),
- request_time(base::Time::Now()) {
+StartNavigationParams::StartNavigationParams()
+ : is_post(false),
+ should_replace_current_entry(false),
+ transferred_request_child_id(-1),
+ transferred_request_request_id(-1) {
}
-CommitNavigationParams::CommitNavigationParams(
- bool is_overriding_user_agent,
- base::TimeTicks navigation_start,
- const std::vector<GURL>& redirects,
- bool can_load_local_resources,
- const std::string& frame_to_navigate,
- base::Time request_time)
- : is_overriding_user_agent(is_overriding_user_agent),
- browser_navigation_start(navigation_start),
- redirects(redirects),
- can_load_local_resources(can_load_local_resources),
- frame_to_navigate(frame_to_navigate),
- request_time(request_time) {
+StartNavigationParams::StartNavigationParams(
+ bool is_post,
+ const std::string& extra_headers,
+ const std::vector<unsigned char>& browser_initiated_post_data,
+ bool should_replace_current_entry,
+ int transferred_request_child_id,
+ int transferred_request_request_id)
+ : is_post(is_post),
+ extra_headers(extra_headers),
+ browser_initiated_post_data(browser_initiated_post_data),
+ should_replace_current_entry(should_replace_current_entry),
+ transferred_request_child_id(transferred_request_child_id),
+ transferred_request_request_id(transferred_request_request_id) {
}
-CommitNavigationParams::~CommitNavigationParams() {}
+StartNavigationParams::~StartNavigationParams() {
+}
-HistoryNavigationParams::HistoryNavigationParams()
- : page_id(-1),
+RequestNavigationParams::RequestNavigationParams()
+ : is_overriding_user_agent(false),
+ browser_navigation_start(base::TimeTicks::Now()),
+ can_load_local_resources(false),
+ request_time(base::Time::Now()),
+ page_id(-1),
pending_history_list_offset(-1),
current_history_list_offset(-1),
current_history_list_length(0),
should_clear_history_list(false) {
}
-HistoryNavigationParams::HistoryNavigationParams(
+RequestNavigationParams::RequestNavigationParams(
+ bool is_overriding_user_agent,
+ base::TimeTicks navigation_start,
+ const std::vector<GURL>& redirects,
+ bool can_load_local_resources,
+ const std::string& frame_to_navigate,
+ base::Time request_time,
const PageState& page_state,
int32 page_id,
int pending_history_list_offset,
int current_history_list_offset,
int current_history_list_length,
bool should_clear_history_list)
- : page_state(page_state),
+ : is_overriding_user_agent(is_overriding_user_agent),
+ browser_navigation_start(navigation_start),
+ redirects(redirects),
+ can_load_local_resources(can_load_local_resources),
+ frame_to_navigate(frame_to_navigate),
+ request_time(request_time),
+ page_state(page_state),
page_id(page_id),
pending_history_list_offset(pending_history_list_offset),
current_history_list_offset(current_history_list_offset),
@@ -101,43 +117,16 @@ HistoryNavigationParams::HistoryNavigationParams(
should_clear_history_list(should_clear_history_list) {
}
-HistoryNavigationParams::~HistoryNavigationParams() {
-}
-
-StartNavigationParams::StartNavigationParams()
- : is_post(false),
- should_replace_current_entry(false),
- transferred_request_child_id(-1),
- transferred_request_request_id(-1) {
-}
-
-StartNavigationParams::StartNavigationParams(
- bool is_post,
- const std::string& extra_headers,
- const std::vector<unsigned char>& browser_initiated_post_data,
- bool should_replace_current_entry,
- int transferred_request_child_id,
- int transferred_request_request_id)
- : is_post(is_post),
- extra_headers(extra_headers),
- browser_initiated_post_data(browser_initiated_post_data),
- should_replace_current_entry(should_replace_current_entry),
- transferred_request_child_id(transferred_request_child_id),
- transferred_request_request_id(transferred_request_request_id) {
-}
-
-StartNavigationParams::~StartNavigationParams() {
+RequestNavigationParams::~RequestNavigationParams() {
}
NavigationParams::NavigationParams(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params)
+ const RequestNavigationParams& request_params)
: common_params(common_params),
start_params(start_params),
- commit_params(commit_params),
- history_params(history_params) {
+ request_params(request_params) {
}
NavigationParams::~NavigationParams() {
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h
index 9b3fccf..ce34bcc 100644
--- a/content/common/navigation_params.h
+++ b/content/common/navigation_params.h
@@ -21,12 +21,13 @@ class RefCountedMemory;
}
namespace content {
-class NavigationEntry;
// The following structures hold parameters used during a navigation. In
// particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and
// FrameHostMsg_BeginNavigation.
+// Provided by the browser or the renderer -------------------------------------
+
// Used by all navigation IPCs.
struct CONTENT_EXPORT CommonNavigationParams {
CommonNavigationParams();
@@ -76,7 +77,15 @@ struct CONTENT_EXPORT CommonNavigationParams {
GURL history_url_for_data_url;
};
-// PlzNavigate: parameters needed to start a navigation on the IO thread.
+// Provided by the renderer ----------------------------------------------------
+//
+// This struct holds parameters sent by the renderer to the browser. It is only
+// used in PlzNavigate (since in the current architecture, the renderer does not
+// inform the browser of navigations until they commit).
+
+// This struct is not used outside of the PlzNavigate project.
+// PlzNavigate: parameters needed to start a navigation on the IO thread,
+// following a renderer-initiated navigation request.
struct CONTENT_EXPORT BeginNavigationParams {
// TODO(clamy): See if it is possible to reuse this in
// ResourceMsg_Request_Params.
@@ -99,17 +108,73 @@ struct CONTENT_EXPORT BeginNavigationParams {
bool has_user_gesture;
};
-// Used by FrameMsg_Navigate.
-// PlzNavigate: sent to the renderer when the navigation is ready to commit.
-struct CONTENT_EXPORT CommitNavigationParams {
- CommitNavigationParams();
- CommitNavigationParams(bool is_overriding_user_agent,
- base::TimeTicks navigation_start,
- const std::vector<GURL>& redirects,
- bool can_load_local_resources,
- const std::string& frame_to_navigate,
- base::Time request_time);
- ~CommitNavigationParams();
+// Provided by the browser -----------------------------------------------------
+//
+// These structs are sent by the browser to the renderer to start/commit a
+// navigation depending on whether browser-side navigation is enabled.
+// Parameters used both in the current architecture and PlzNavigate should be
+// put in RequestNavigationParams. Parameters only used by the current
+// architecture should go in StartNavigationParams.
+
+// Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to
+// start a browser-initiated navigation besides those in CommonNavigationParams.
+// The difference with the RequestNavigationParams below is that they are only
+// used in the current architecture of navigation, and will not be used by
+// PlzNavigate.
+// PlzNavigate: These are not used.
+struct CONTENT_EXPORT StartNavigationParams {
+ StartNavigationParams();
+ StartNavigationParams(
+ bool is_post,
+ const std::string& extra_headers,
+ const std::vector<unsigned char>& browser_initiated_post_data,
+ bool should_replace_current_entry,
+ int transferred_request_child_id,
+ int transferred_request_request_id);
+ ~StartNavigationParams();
+
+ // Whether the navigation is a POST request (as opposed to a GET).
+ bool is_post;
+
+ // Extra headers (separated by \n) to send during the request.
+ std::string extra_headers;
+
+ // If is_post is true, holds the post_data information from browser. Empty
+ // otherwise.
+ std::vector<unsigned char> browser_initiated_post_data;
+
+ // Informs the RenderView the pending navigation should replace the current
+ // history entry when it commits. This is used for cross-process redirects so
+ // the transferred navigation can recover the navigation state.
+ bool should_replace_current_entry;
+
+ // The following two members identify a previous request that has been
+ // created before this navigation is being transferred to a new render view.
+ // This serves the purpose of recycling the old request.
+ // Unless this refers to a transferred navigation, these values are -1 and -1.
+ int transferred_request_child_id;
+ int transferred_request_request_id;
+};
+
+// Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to
+// start a browser-initiated navigation besides those in CommonNavigationParams.
+// PlzNavigate: sent to the renderer to make it issue a stream request for a
+// navigation that is ready to commit.
+struct CONTENT_EXPORT RequestNavigationParams {
+ RequestNavigationParams();
+ RequestNavigationParams(bool is_overriding_user_agent,
+ base::TimeTicks navigation_start,
+ const std::vector<GURL>& redirects,
+ bool can_load_local_resources,
+ const std::string& frame_to_navigate,
+ base::Time request_time,
+ const PageState& page_state,
+ int32 page_id,
+ int pending_history_list_offset,
+ int current_history_list_offset,
+ int current_history_list_length,
+ bool should_clear_history_list);
+ ~RequestNavigationParams();
// Whether or not the user agent override string should be used.
bool is_overriding_user_agent;
@@ -132,19 +197,6 @@ struct CONTENT_EXPORT CommitNavigationParams {
// infrastructure to set up DocumentState associated with the RenderView.
// TODO(ppi): make it go away.
base::Time request_time;
-};
-
-// Used by FrameMsg_Navigate.
-// PlzNavigate: sent to the renderer when the navigation is ready to commit.
-struct CONTENT_EXPORT HistoryNavigationParams {
- HistoryNavigationParams();
- HistoryNavigationParams(const PageState& page_state,
- int32 page_id,
- int pending_history_list_offset,
- int current_history_list_offset,
- int current_history_list_length,
- bool should_clear_history_list);
- ~HistoryNavigationParams();
// Opaque history state (received by ViewHostMsg_UpdateState).
PageState page_state;
@@ -170,54 +222,19 @@ struct CONTENT_EXPORT HistoryNavigationParams {
bool should_clear_history_list;
};
-// Parameters needed at the start of a navigation. Used by FrameMsg_Navigate.
-// PlzNavigate: these parameters are not used in navigation.
-struct CONTENT_EXPORT StartNavigationParams {
- StartNavigationParams();
- StartNavigationParams(
- bool is_post,
- const std::string& extra_headers,
- const std::vector<unsigned char>& browser_initiated_post_data,
- bool should_replace_current_entry,
- int transferred_request_child_id,
- int transferred_request_request_id);
- ~StartNavigationParams();
-
- // Whether the navigation is a POST request (as opposed to a GET).
- bool is_post;
-
- // Extra headers (separated by \n) to send during the request.
- std::string extra_headers;
-
- // If is_post is true, holds the post_data information from browser. Empty
- // otherwise.
- std::vector<unsigned char> browser_initiated_post_data;
-
- // Informs the RenderView the pending navigation should replace the current
- // history entry when it commits. This is used for cross-process redirects so
- // the transferred navigation can recover the navigation state.
- bool should_replace_current_entry;
-
- // The following two members identify a previous request that has been
- // created before this navigation is being transferred to a new render view.
- // This serves the purpose of recycling the old request.
- // Unless this refers to a transferred navigation, these values are -1 and -1.
- int transferred_request_child_id;
- int transferred_request_request_id;
-};
-
+// Helper struct keeping track in one place of all the parameters the browser
+// needs to provide to the renderer.
struct NavigationParams {
NavigationParams(const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
~NavigationParams();
CommonNavigationParams common_params;
StartNavigationParams start_params;
- CommitNavigationParams commit_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
};
+
} // namespace content
#endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index f0e0f8c..c8e488d 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -368,8 +368,7 @@ void RenderViewTest::Reload(const GURL& url) {
GURL(), GURL());
RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(),
- HistoryNavigationParams());
+ RequestNavigationParams());
FrameLoadWaiter(impl->GetMainRenderFrame()).Wait();
}
@@ -447,13 +446,15 @@ void RenderViewTest::GoToOffset(int offset, const PageState& state) {
GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
FrameMsg_Navigate_Type::NORMAL, true, base::TimeTicks(),
FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL());
- HistoryNavigationParams history_params(
- state, impl->page_id_ + offset, pending_offset,
- impl->history_list_offset_, history_list_length, false);
+ RequestNavigationParams request_params;
+ request_params.page_state = state;
+ request_params.page_id = impl->page_id_ + offset;
+ request_params.pending_history_list_offset = pending_offset;
+ request_params.current_history_list_offset = impl->history_list_offset_;
+ request_params.current_history_list_length = history_list_length;
impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(),
- history_params);
+ request_params);
// The load actually happens asynchronously, so we pump messages to process
// the pending continuation.
diff --git a/content/renderer/accessibility/renderer_accessibility_browsertest.cc b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
index 92d8dc0..6672943 100644
--- a/content/renderer/accessibility/renderer_accessibility_browsertest.cc
+++ b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
@@ -190,16 +190,15 @@ TEST_F(RendererAccessibilityTest,
// because the element it was referring to no longer exists,
// so the event here is from loading this new page.
CommonNavigationParams common_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.url = GURL("data:text/html,<p>Hello, again.</p>");
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_TYPED;
- history_params.current_history_list_length = 1;
- history_params.current_history_list_offset = 0;
- history_params.pending_history_list_offset = 1;
- history_params.page_id = -1;
- frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), history_params);
+ request_params.current_history_list_length = 1;
+ request_params.current_history_list_offset = 0;
+ request_params.pending_history_list_offset = 1;
+ request_params.page_id = -1;
+ frame()->OnNavigate(common_params, StartNavigationParams(), request_params);
accessibility->SendPendingAccessibilityEvents();
EXPECT_TRUE(sink_->GetUniqueMessageMatching(
AccessibilityHostMsg_Events::ID));
diff --git a/content/renderer/navigation_state_impl.cc b/content/renderer/navigation_state_impl.cc
index d240eac..38d1eed 100644
--- a/content/renderer/navigation_state_impl.cc
+++ b/content/renderer/navigation_state_impl.cc
@@ -12,15 +12,15 @@ NavigationStateImpl::~NavigationStateImpl() {
NavigationStateImpl* NavigationStateImpl::CreateBrowserInitiated(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const HistoryNavigationParams& history_params) {
- return new NavigationStateImpl(common_params, start_params, history_params,
+ const RequestNavigationParams& request_params) {
+ return new NavigationStateImpl(common_params, start_params, request_params,
false);
}
NavigationStateImpl* NavigationStateImpl::CreateContentInitiated() {
return new NavigationStateImpl(CommonNavigationParams(),
StartNavigationParams(),
- HistoryNavigationParams(), true);
+ RequestNavigationParams(), true);
}
ui::PageTransition NavigationStateImpl::GetTransitionType() {
@@ -38,14 +38,14 @@ bool NavigationStateImpl::IsContentInitiated() {
NavigationStateImpl::NavigationStateImpl(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
bool is_content_initiated)
: request_committed_(false),
was_within_same_page_(false),
is_content_initiated_(is_content_initiated),
common_params_(common_params),
start_params_(start_params),
- history_params_(history_params) {
+ request_params_(request_params) {
}
} // namespace content
diff --git a/content/renderer/navigation_state_impl.h b/content/renderer/navigation_state_impl.h
index d6b4e05..07b7688 100644
--- a/content/renderer/navigation_state_impl.h
+++ b/content/renderer/navigation_state_impl.h
@@ -19,7 +19,7 @@ class CONTENT_EXPORT NavigationStateImpl : public NavigationState {
static NavigationStateImpl* CreateBrowserInitiated(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
static NavigationStateImpl* CreateContentInitiated();
@@ -30,8 +30,8 @@ class CONTENT_EXPORT NavigationStateImpl : public NavigationState {
const CommonNavigationParams& common_params() const { return common_params_; }
const StartNavigationParams& start_params() const { return start_params_; }
- const HistoryNavigationParams& history_params() const {
- return history_params_;
+ const RequestNavigationParams& request_params() const {
+ return request_params_;
}
bool request_committed() const { return request_committed_; }
void set_request_committed(bool value) { request_committed_ = value; }
@@ -44,7 +44,7 @@ class CONTENT_EXPORT NavigationStateImpl : public NavigationState {
private:
NavigationStateImpl(const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
bool is_content_initiated);
bool request_committed_;
@@ -67,7 +67,7 @@ class CONTENT_EXPORT NavigationStateImpl : public NavigationState {
// swaps because FrameLoader::loadWithNavigationAction treats loads before a
// FrameLoader has committedFirstRealDocumentLoad as a replacement. (Added for
// http://crbug.com/178380).
- const HistoryNavigationParams history_params_;
+ const RequestNavigationParams request_params_;
DISALLOW_COPY_AND_ASSIGN(NavigationStateImpl);
};
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5872c9a..193a115 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1042,17 +1042,16 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
void RenderFrameImpl::OnNavigate(
const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params) {
+ const RequestNavigationParams& request_params) {
TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_,
"url", common_params.url.possibly_invalid_spec());
bool is_reload = RenderViewImpl::IsReload(common_params.navigation_type);
- bool is_history_navigation = history_params.page_state.IsValid();
+ bool is_history_navigation = request_params.page_state.IsValid();
WebURLRequest::CachePolicy cache_policy =
WebURLRequest::UseProtocolCachePolicy;
if (!RenderFrameImpl::PrepareRenderViewForNavigation(
- common_params.url, is_history_navigation, history_params, &is_reload,
+ common_params.url, is_history_navigation, request_params, &is_reload,
&cache_policy)) {
Send(new FrameHostMsg_DidDropNavigation(routing_id_));
return;
@@ -1061,12 +1060,12 @@ void RenderFrameImpl::OnNavigate(
GetContentClient()->SetActiveURL(common_params.url);
WebFrame* frame = frame_;
- if (!commit_params.frame_to_navigate.empty()) {
+ if (!request_params.frame_to_navigate.empty()) {
// TODO(nasko): Move this lookup to the browser process.
frame = render_view_->webview()->findFrameByName(
- WebString::fromUTF8(commit_params.frame_to_navigate));
+ WebString::fromUTF8(request_params.frame_to_navigate));
CHECK(frame) << "Invalid frame name passed: "
- << commit_params.frame_to_navigate;
+ << request_params.frame_to_navigate;
}
if (is_reload && !render_view_->history_controller()->GetCurrentEntry()) {
@@ -1076,8 +1075,8 @@ void RenderFrameImpl::OnNavigate(
cache_policy = WebURLRequest::ReloadIgnoringCacheData;
}
- render_view_->pending_navigation_params_.reset(new NavigationParams(
- common_params, start_params, commit_params, history_params));
+ render_view_->pending_navigation_params_.reset(
+ new NavigationParams(common_params, start_params, request_params));
// If we are reloading, then WebKit will use the history state of the current
// page, so we should just ignore any given history state. Otherwise, if we
@@ -1096,9 +1095,9 @@ void RenderFrameImpl::OnNavigate(
frame->reload(ignore_cache);
} else if (is_history_navigation) {
// We must know the page ID of the page we are navigating back to.
- DCHECK_NE(history_params.page_id, -1);
+ DCHECK_NE(request_params.page_id, -1);
scoped_ptr<HistoryEntry> entry =
- PageStateToHistoryEntry(history_params.page_state);
+ PageStateToHistoryEntry(request_params.page_state);
if (entry) {
// Ensure we didn't save the swapped out URL in UpdateState, since the
// browser should never be telling us to navigate to swappedout://.
@@ -1140,14 +1139,14 @@ void RenderFrameImpl::OnNavigate(
}
// A session history navigation should have been accompanied by state.
- CHECK_EQ(history_params.page_id, -1);
+ CHECK_EQ(request_params.page_id, -1);
// Record this before starting the load, we need a lower bound of this time
// to sanitize the navigationStart override set below.
base::TimeTicks renderer_navigation_start = base::TimeTicks::Now();
frame->loadRequest(request);
- UpdateFrameNavigationTiming(frame, commit_params.browser_navigation_start,
+ UpdateFrameNavigationTiming(frame, request_params.browser_navigation_start,
renderer_navigation_start);
}
@@ -2447,7 +2446,7 @@ void RenderFrameImpl::didFailProvisionalLoad(blink::WebLocalFrame* frame,
// TODO(davidben): This should also take the failed navigation's replacement
// state into account, if a location.replace() failed.
bool replace =
- navigation_state->history_params().page_id != -1 ||
+ navigation_state->request_params().page_id != -1 ||
ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(),
ui::PAGE_TRANSITION_AUTO_SUBFRAME);
@@ -2456,10 +2455,9 @@ void RenderFrameImpl::didFailProvisionalLoad(blink::WebLocalFrame* frame,
if (!navigation_state->IsContentInitiated()) {
render_view_->pending_navigation_params_.reset(new NavigationParams(
navigation_state->common_params(), navigation_state->start_params(),
- CommitNavigationParams(false, base::TimeTicks(), std::vector<GURL>(),
- false, std::string(),
- document_state->request_time()),
- navigation_state->history_params()));
+ navigation_state->request_params()));
+ render_view_->pending_navigation_params_->request_params.request_time =
+ document_state->request_time();
}
// Load an error page.
@@ -2542,14 +2540,14 @@ void RenderFrameImpl::didCommitProvisionalLoad(
// Note that we need to check if the page ID changed. In the case of a
// reload, the page ID doesn't change, and UpdateSessionHistory gets the
// previous URL and the current page ID, which would be wrong.
- if (navigation_state->history_params().page_id != -1 &&
- navigation_state->history_params().page_id != render_view_->page_id_ &&
+ if (navigation_state->request_params().page_id != -1 &&
+ navigation_state->request_params().page_id != render_view_->page_id_ &&
!navigation_state->request_committed()) {
// This is a successful session history navigation!
- render_view_->page_id_ = navigation_state->history_params().page_id;
+ render_view_->page_id_ = navigation_state->request_params().page_id;
render_view_->history_list_offset_ =
- navigation_state->history_params().pending_history_list_offset;
+ navigation_state->request_params().pending_history_list_offset;
}
}
@@ -3849,7 +3847,7 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
params.original_request_url = GetOriginalRequestURL(ds);
params.history_list_was_cleared =
- navigation_state->history_params().should_clear_history_list;
+ navigation_state->request_params().should_clear_history_list;
params.report_type = static_cast<FrameMsg_UILoadMetricsReportType::Value>(
frame->dataSource()->request().inputPerfMetricReportPolicy());
@@ -3876,7 +3874,7 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
else
params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
- DCHECK(!navigation_state->history_params().should_clear_history_list);
+ DCHECK(!navigation_state->request_params().should_clear_history_list);
params.history_list_was_cleared = false;
params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT;
@@ -3928,16 +3926,15 @@ void RenderFrameImpl::OnCommitNavigation(
const ResourceResponseHead& response,
const GURL& stream_url,
const CommonNavigationParams& common_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params) {
+ const RequestNavigationParams& request_params) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
bool is_reload = false;
- bool is_history_navigation = history_params.page_state.IsValid();
+ bool is_history_navigation = request_params.page_state.IsValid();
WebURLRequest::CachePolicy cache_policy =
WebURLRequest::UseProtocolCachePolicy;
if (!RenderFrameImpl::PrepareRenderViewForNavigation(
- common_params.url, is_history_navigation, history_params, &is_reload,
+ common_params.url, is_history_navigation, request_params, &is_reload,
&cache_policy)) {
return;
}
@@ -3945,7 +3942,7 @@ void RenderFrameImpl::OnCommitNavigation(
GetContentClient()->SetActiveURL(common_params.url);
render_view_->pending_navigation_params_.reset(new NavigationParams(
- common_params, StartNavigationParams(), commit_params, history_params));
+ common_params, StartNavigationParams(), request_params));
if (!common_params.base_url_for_data_url.is_empty() ||
common_params.url.SchemeIs(url::kDataScheme)) {
@@ -3975,9 +3972,8 @@ void RenderFrameImpl::OnCommitNavigation(
// to sanitize the navigationStart override set below.
base::TimeTicks renderer_navigation_start = base::TimeTicks::Now();
frame_->loadRequest(request);
- UpdateFrameNavigationTiming(
- frame_, commit_params.browser_navigation_start,
- renderer_navigation_start);
+ UpdateFrameNavigationTiming(frame_, request_params.browser_navigation_start,
+ renderer_navigation_start);
}
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
@@ -4372,7 +4368,7 @@ RenderFrameImpl::CreateRendererFactory() {
bool RenderFrameImpl::PrepareRenderViewForNavigation(
const GURL& url,
bool is_history_navigation,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
bool* is_reload,
WebURLRequest::CachePolicy* cache_policy) {
MaybeHandleDebugURL(url);
@@ -4387,15 +4383,15 @@ bool RenderFrameImpl::PrepareRenderViewForNavigation(
// frame is swapped out, it won't commit before asking the browser.
if (!render_view_->is_swapped_out() && is_history_navigation &&
render_view_->history_list_offset_ !=
- history_params.current_history_list_offset) {
+ request_params.current_history_list_offset) {
return false;
}
render_view_->history_list_offset_ =
- history_params.current_history_list_offset;
+ request_params.current_history_list_offset;
render_view_->history_list_length_ =
- history_params.current_history_list_length;
- if (history_params.should_clear_history_list) {
+ request_params.current_history_list_length;
+ if (request_params.should_clear_history_list) {
CHECK_EQ(-1, render_view_->history_list_offset_);
CHECK_EQ(0, render_view_->history_list_length_);
}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 77b19ae..fb2c524 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -98,11 +98,9 @@ class RenderWidgetFullscreenPepper;
class ScreenOrientationDispatcher;
class UserMediaClientImpl;
enum class SandboxFlags;
-struct CommitNavigationParams;
struct CommonNavigationParams;
struct CustomContextMenuContext;
struct FrameReplicationState;
-struct HistoryNavigationParams;
struct RequestNavigationParams;
struct ResourceResponseHead;
struct StartNavigationParams;
@@ -533,8 +531,7 @@ class CONTENT_EXPORT RenderFrameImpl
// this back to private member.
void OnNavigate(const CommonNavigationParams& common_params,
const StartNavigationParams& start_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
// Make this frame show an empty, unscriptable page.
// TODO(nasko): Remove this method once swapped out state is no longer used.
@@ -642,8 +639,7 @@ class CONTENT_EXPORT RenderFrameImpl
void OnCommitNavigation(const ResourceResponseHead& response,
const GURL& stream_url,
const CommonNavigationParams& common_params,
- const CommitNavigationParams& commit_params,
- const HistoryNavigationParams& history_params);
+ const RequestNavigationParams& request_params);
// Virtual since overridden by WebTestProxy for layout tests.
virtual blink::WebNavigationPolicy DecidePolicyForNavigation(
@@ -710,7 +706,7 @@ class CONTENT_EXPORT RenderFrameImpl
bool PrepareRenderViewForNavigation(
const GURL& url,
bool is_history_navigation,
- const HistoryNavigationParams& history_params,
+ const RequestNavigationParams& request_params,
bool* is_reload,
blink::WebURLRequest::CachePolicy* cache_policy);
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 27047a70..e9ab0dc 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -386,11 +386,11 @@ TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
// An http url will trigger a resource load so cannot be used here.
CommonNavigationParams common_params;
StartNavigationParams start_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.url = GURL("data:text/html,<div>Page</div>");
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_TYPED;
- history_params.page_id = -1;
+ request_params.page_id = -1;
// Set up post data.
const unsigned char* raw_data = reinterpret_cast<const unsigned char*>(
@@ -400,8 +400,7 @@ TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
start_params.is_post = true;
start_params.browser_initiated_post_data = post_data;
- frame()->OnNavigate(common_params, start_params, CommitNavigationParams(),
- history_params);
+ frame()->OnNavigate(common_params, start_params, request_params);
ProcessPendingMessages();
const IPC::Message* frame_navigate_msg =
@@ -594,16 +593,15 @@ TEST_F(RenderViewImplTest, SendSwapOutACK) {
// If we navigate back to this RenderView, ensure we don't send a state
// update for the swapped out URL. (http://crbug.com/72235)
CommonNavigationParams common_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.url = GURL("data:text/html,<div>Page B</div>");
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_TYPED;
- history_params.current_history_list_length = 1;
- history_params.current_history_list_offset = 0;
- history_params.pending_history_list_offset = 1;
- history_params.page_id = -1;
- frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), history_params);
+ request_params.current_history_list_length = 1;
+ request_params.current_history_list_offset = 0;
+ request_params.pending_history_list_offset = 1;
+ request_params.page_id = -1;
+ frame()->OnNavigate(common_params, StartNavigationParams(), request_params);
ProcessPendingMessages();
const IPC::Message* msg3 = render_thread_->sink().GetUniqueMessageMatching(
ViewHostMsg_UpdateState::ID);
@@ -633,16 +631,16 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
// Back to page A (page_id 1) and commit.
CommonNavigationParams common_params_A;
- HistoryNavigationParams history_params_A;
+ RequestNavigationParams request_params_A;
common_params_A.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params_A.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params_A.current_history_list_length = 2;
- history_params_A.current_history_list_offset = 1;
- history_params_A.pending_history_list_offset = 0;
- history_params_A.page_id = 1;
- history_params_A.page_state = state_A;
+ request_params_A.current_history_list_length = 2;
+ request_params_A.current_history_list_offset = 1;
+ request_params_A.pending_history_list_offset = 0;
+ request_params_A.page_id = 1;
+ request_params_A.page_state = state_A;
frame()->OnNavigate(common_params_A, StartNavigationParams(),
- CommitNavigationParams(), history_params_A);
+ request_params_A);
EXPECT_EQ(1, view()->historyBackListCount());
EXPECT_EQ(2, view()->historyBackListCount() +
view()->historyForwardListCount() + 1);
@@ -663,17 +661,16 @@ TEST_F(RenderViewImplTest, ReloadWhileSwappedOut) {
// provisional load in the renderer process, after we unload the old page).
// Ensure the old page gets reloaded, not swappedout://.
CommonNavigationParams common_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.url = GURL("data:text/html,<div>Page A</div>");
common_params.navigation_type = FrameMsg_Navigate_Type::RELOAD;
common_params.transition = ui::PAGE_TRANSITION_RELOAD;
- history_params.current_history_list_length = 2;
- history_params.current_history_list_offset = 0;
- history_params.pending_history_list_offset = 0;
- history_params.page_id = 1;
- history_params.page_state = state_A;
- frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), history_params);
+ request_params.current_history_list_length = 2;
+ request_params.current_history_list_offset = 0;
+ request_params.pending_history_list_offset = 0;
+ request_params.page_id = 1;
+ request_params.page_state = state_A;
+ frame()->OnNavigate(common_params, StartNavigationParams(), request_params);
ProcessPendingMessages();
// Verify page A committed, not swappedout://.
@@ -783,16 +780,16 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
// Go back to C and commit, preparing for our real test.
CommonNavigationParams common_params_C;
- HistoryNavigationParams history_params_C;
+ RequestNavigationParams request_params_C;
common_params_C.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params_C.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params_C.current_history_list_length = 4;
- history_params_C.current_history_list_offset = 3;
- history_params_C.pending_history_list_offset = 2;
- history_params_C.page_id = 3;
- history_params_C.page_state = state_C;
+ request_params_C.current_history_list_length = 4;
+ request_params_C.current_history_list_offset = 3;
+ request_params_C.pending_history_list_offset = 2;
+ request_params_C.page_id = 3;
+ request_params_C.page_state = state_C;
frame()->OnNavigate(common_params_C, StartNavigationParams(),
- CommitNavigationParams(), history_params_C);
+ request_params_C);
ProcessPendingMessages();
render_thread_->sink().ClearMessages();
@@ -802,29 +799,28 @@ TEST_F(RenderViewImplTest, DISABLED_LastCommittedUpdateState) {
// Back to page B (page_id 2), without committing.
CommonNavigationParams common_params_B;
- HistoryNavigationParams history_params_B;
+ RequestNavigationParams request_params_B;
common_params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params_B.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params_B.current_history_list_length = 4;
- history_params_B.current_history_list_offset = 2;
- history_params_B.pending_history_list_offset = 1;
- history_params_B.page_id = 2;
- history_params_B.page_state = state_B;
+ request_params_B.current_history_list_length = 4;
+ request_params_B.current_history_list_offset = 2;
+ request_params_B.pending_history_list_offset = 1;
+ request_params_B.page_id = 2;
+ request_params_B.page_state = state_B;
frame()->OnNavigate(common_params_B, StartNavigationParams(),
- CommitNavigationParams(), history_params_B);
+ request_params_B);
// Back to page A (page_id 1) and commit.
CommonNavigationParams common_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params.current_history_list_length = 4;
- history_params.current_history_list_offset = 2;
- history_params.pending_history_list_offset = 0;
- history_params.page_id = 1;
- history_params.page_state = state_A;
- frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), history_params);
+ request_params.current_history_list_length = 4;
+ request_params.current_history_list_offset = 2;
+ request_params.pending_history_list_offset = 0;
+ request_params.page_id = 1;
+ request_params.page_state = state_A;
+ frame()->OnNavigate(common_params, StartNavigationParams(), request_params);
ProcessPendingMessages();
// Now ensure that the UpdateState message we receive is consistent
@@ -868,16 +864,16 @@ TEST_F(RenderViewImplTest, StaleNavigationsIgnored) {
// Back to page A (page_id 1) and commit.
CommonNavigationParams common_params_A;
- HistoryNavigationParams history_params_A;
+ RequestNavigationParams request_params_A;
common_params_A.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params_A.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params_A.current_history_list_length = 2;
- history_params_A.current_history_list_offset = 1;
- history_params_A.pending_history_list_offset = 0;
- history_params_A.page_id = 1;
- history_params_A.page_state = state_A;
+ request_params_A.current_history_list_length = 2;
+ request_params_A.current_history_list_offset = 1;
+ request_params_A.pending_history_list_offset = 0;
+ request_params_A.page_id = 1;
+ request_params_A.page_state = state_A;
frame()->OnNavigate(common_params_A, StartNavigationParams(),
- CommitNavigationParams(), history_params_A);
+ request_params_A);
ProcessPendingMessages();
// A new navigation commits, clearing the forward history.
@@ -888,17 +884,17 @@ TEST_F(RenderViewImplTest, StaleNavigationsIgnored) {
// The browser then sends a stale navigation to B, which should be ignored.
CommonNavigationParams common_params_B;
- HistoryNavigationParams history_params_B;
+ RequestNavigationParams request_params_B;
common_params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params_B.transition = ui::PAGE_TRANSITION_FORWARD_BACK;
- history_params_B.current_history_list_length = 2;
- history_params_B.current_history_list_offset = 0;
- history_params_B.pending_history_list_offset = 1;
- history_params_B.page_id = 2;
- history_params_B.page_state =
+ request_params_B.current_history_list_length = 2;
+ request_params_B.current_history_list_offset = 0;
+ request_params_B.pending_history_list_offset = 1;
+ request_params_B.page_id = 2;
+ request_params_B.page_state =
state_A; // Doesn't matter, just has to be present.
frame()->OnNavigate(common_params_B, StartNavigationParams(),
- CommitNavigationParams(), history_params_B);
+ request_params_B);
// State should be unchanged.
EXPECT_EQ(2, view()->history_list_length_);
@@ -1614,7 +1610,7 @@ TEST_F(RenderViewImplTest, DISABLED_DidFailProvisionalLoadWithErrorForError) {
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.url = GURL("data:text/html,test data");
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
// An error occurred.
view()->GetMainRenderFrame()->didFailProvisionalLoad(web_frame, error);
@@ -1636,7 +1632,7 @@ TEST_F(RenderViewImplTest, DidFailProvisionalLoadWithErrorForCancellation) {
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.url = GURL("data:text/html,test data");
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
// A cancellation occurred.
view()->GetMainRenderFrame()->didFailProvisionalLoad(web_frame, error);
@@ -1833,7 +1829,7 @@ TEST_F(RenderViewImplTest, ZoomLimit) {
common_params.url = GURL("data:text/html,min_zoomlimit_test");
view()->OnSetZoomLevelForLoadingURL(common_params.url, kMinZoomLevel);
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
ProcessPendingMessages();
EXPECT_DOUBLE_EQ(kMinZoomLevel, view()->GetWebView()->zoomLevel());
@@ -1843,7 +1839,7 @@ TEST_F(RenderViewImplTest, ZoomLimit) {
common_params.url = GURL("data:text/html,max_zoomlimit_test");
view()->OnSetZoomLevelForLoadingURL(common_params.url, kMaxZoomLevel);
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
ProcessPendingMessages();
EXPECT_DOUBLE_EQ(kMaxZoomLevel, view()->GetWebView()->zoomLevel());
}
@@ -1904,20 +1900,18 @@ TEST_F(RenderViewImplTest, NavigateFrame) {
// Navigate the frame only.
CommonNavigationParams common_params;
- CommitNavigationParams commit_params;
- HistoryNavigationParams history_params;
+ RequestNavigationParams request_params;
common_params.url = GURL("data:text/html,world");
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_TYPED;
- history_params.current_history_list_length = 1;
- history_params.current_history_list_offset = 0;
- history_params.pending_history_list_offset = 1;
- history_params.page_id = -1;
- commit_params.frame_to_navigate = "frame";
- commit_params.browser_navigation_start =
+ request_params.current_history_list_length = 1;
+ request_params.current_history_list_offset = 0;
+ request_params.pending_history_list_offset = 1;
+ request_params.page_id = -1;
+ request_params.frame_to_navigate = "frame";
+ request_params.browser_navigation_start =
base::TimeTicks::FromInternalValue(1);
- frame()->OnNavigate(common_params, StartNavigationParams(), commit_params,
- history_params);
+ frame()->OnNavigate(common_params, StartNavigationParams(), request_params);
FrameLoadWaiter(
RenderFrame::FromWebFrame(frame()->GetWebFrame()->firstChild())).Wait();
@@ -2035,7 +2029,7 @@ TEST_F(SuppressErrorPageTest, MAYBE_Suppresses) {
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.url = GURL("data:text/html,test data");
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
// An error occurred.
view()->GetMainRenderFrame()->didFailProvisionalLoad(web_frame, error);
@@ -2064,7 +2058,7 @@ TEST_F(SuppressErrorPageTest, MAYBE_DoesNotSuppress) {
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.url = GURL("data:text/html,test data");
frame()->OnNavigate(common_params, StartNavigationParams(),
- CommitNavigationParams(), HistoryNavigationParams());
+ RequestNavigationParams());
// An error occurred.
view()->GetMainRenderFrame()->didFailProvisionalLoad(web_frame, error);
@@ -2265,16 +2259,16 @@ TEST_F(RenderViewImplTest, NavigationStartOverride) {
base::Time before_navigation = base::Time::Now();
CommonNavigationParams early_common_params;
StartNavigationParams early_start_params;
- CommitNavigationParams early_commit_params;
+ RequestNavigationParams early_request_params;
early_common_params.url = GURL("data:text/html,<div>Page</div>");
early_common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
early_common_params.transition = ui::PAGE_TRANSITION_TYPED;
early_start_params.is_post = true;
- early_commit_params.browser_navigation_start =
+ early_request_params.browser_navigation_start =
base::TimeTicks::FromInternalValue(1);
frame()->OnNavigate(early_common_params, early_start_params,
- early_commit_params, HistoryNavigationParams());
+ early_request_params);
ProcessPendingMessages();
base::Time early_nav_reported_start =
@@ -2285,17 +2279,17 @@ TEST_F(RenderViewImplTest, NavigationStartOverride) {
// days from now is *not* reported as one that starts in the future; as we
// sanitize the override allowing a maximum of ::Now().
CommonNavigationParams late_common_params;
- CommitNavigationParams late_commit_params;
+ RequestNavigationParams late_request_params;
StartNavigationParams late_start_params;
late_common_params.url = GURL("data:text/html,<div>Another page</div>");
late_common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
late_common_params.transition = ui::PAGE_TRANSITION_TYPED;
late_start_params.is_post = true;
- late_commit_params.browser_navigation_start =
+ late_request_params.browser_navigation_start =
base::TimeTicks::Now() + base::TimeDelta::FromDays(42);
- frame()->OnNavigate(late_common_params, late_start_params, late_commit_params,
- HistoryNavigationParams());
+ frame()->OnNavigate(late_common_params, late_start_params,
+ late_request_params);
ProcessPendingMessages();
base::Time after_navigation =
base::Time::Now() + base::TimeDelta::FromDays(1);
@@ -2327,13 +2321,13 @@ TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnNavigation) {
view()->historyForwardListCount() + 1);
// Receive a Navigate message with history parameters.
- HistoryNavigationParams history_params;
- history_params.current_history_list_length = 2;
- history_params.current_history_list_offset = 1;
- history_params.pending_history_list_offset = 2;
- history_params.page_id = -1;
+ RequestNavigationParams request_params;
+ request_params.current_history_list_length = 2;
+ request_params.current_history_list_offset = 1;
+ request_params.pending_history_list_offset = 2;
+ request_params.page_id = -1;
frame()->OnNavigate(CommonNavigationParams(), StartNavigationParams(),
- CommitNavigationParams(), history_params);
+ request_params);
// The history list in RenderView should have been updated.
EXPECT_EQ(1, view()->historyBackListCount());
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index eecfa02..d9a9d02 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2088,8 +2088,8 @@ void RenderViewImpl::didCreateDataSource(WebLocalFrame* frame,
// Make sure any previous redirect URLs end up in our new data source.
if (pending_navigation_params_.get()) {
for (std::vector<GURL>::const_iterator i =
- pending_navigation_params_->commit_params.redirects.begin();
- i != pending_navigation_params_->commit_params.redirects.end(); ++i) {
+ pending_navigation_params_->request_params.redirects.begin();
+ i != pending_navigation_params_->request_params.redirects.end(); ++i) {
ds->appendRedirect(*i);
}
}
@@ -2183,7 +2183,7 @@ void RenderViewImpl::didCreateDataSource(WebLocalFrame* frame,
void RenderViewImpl::PopulateDocumentStateFromPending(
DocumentState* document_state) {
document_state->set_request_time(
- pending_navigation_params_->commit_params.request_time);
+ pending_navigation_params_->request_params.request_time);
InternalDocumentStateData* internal_data =
InternalDocumentStateData::FromDocumentState(document_state);
@@ -2208,18 +2208,18 @@ void RenderViewImpl::PopulateDocumentStateFromPending(
if (IsReload(pending_navigation_params_->common_params.navigation_type))
document_state->set_load_type(DocumentState::RELOAD);
- else if (pending_navigation_params_->history_params.page_state.IsValid())
+ else if (pending_navigation_params_->request_params.page_state.IsValid())
document_state->set_load_type(DocumentState::HISTORY_LOAD);
else
document_state->set_load_type(DocumentState::NORMAL_LOAD);
internal_data->set_is_overriding_user_agent(
- pending_navigation_params_->commit_params.is_overriding_user_agent);
+ pending_navigation_params_->request_params.is_overriding_user_agent);
internal_data->set_must_reset_scroll_and_scale_state(
pending_navigation_params_->common_params.navigation_type ==
FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL);
document_state->set_can_load_local_resources(
- pending_navigation_params_->commit_params.can_load_local_resources);
+ pending_navigation_params_->request_params.can_load_local_resources);
}
NavigationState* RenderViewImpl::CreateNavigationStateFromPending() {
@@ -2231,7 +2231,7 @@ NavigationState* RenderViewImpl::CreateNavigationStateFromPending() {
return NavigationStateImpl::CreateBrowserInitiated(
pending_navigation_params_->common_params,
pending_navigation_params_->start_params,
- pending_navigation_params_->history_params);
+ pending_navigation_params_->request_params);
}
return NavigationStateImpl::CreateContentInitiated();
}
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index cefe52b..44c21e3 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -76,7 +76,6 @@
class PepperDeviceTest;
class SkBitmap;
struct PP_NetAddress_Private;
-struct FrameMsg_Navigate_Params;
struct ViewMsg_New_Params;
struct ViewMsg_PostMessage_Params;
struct ViewMsg_Resize_Params;