summaryrefslogtreecommitdiffstats
path: root/content/browser/frame_host/navigation_request.h
diff options
context:
space:
mode:
authorclamy <clamy@chromium.org>2014-09-30 13:50:42 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-30 20:51:03 +0000
commit9bfeef40d0a1597a6cbf5835f0bc2c2553818975 (patch)
treeada2150821fb33ab08a25f06de77b8e3e01fbc47 /content/browser/frame_host/navigation_request.h
parent2b537d62aecf6a6c982eec5ba6d14a0e966297ed (diff)
downloadchromium_src-9bfeef40d0a1597a6cbf5835f0bc2c2553818975.zip
chromium_src-9bfeef40d0a1597a6cbf5835f0bc2c2553818975.tar.gz
chromium_src-9bfeef40d0a1597a6cbf5835f0bc2c2553818975.tar.bz2
PlzNavigate: implement CommitNavigation on the browser side
Part of the PlzNavigate navigation refactoring project. This CL implements CommitNavigation on the browser side, so that the proper parameters can be passed to the renderer when navigations are ready to commit. BUG=376091 Review URL: https://codereview.chromium.org/483773002 Cr-Commit-Position: refs/heads/master@{#297495}
Diffstat (limited to 'content/browser/frame_host/navigation_request.h')
-rw-r--r--content/browser/frame_host/navigation_request.h39
1 files changed, 28 insertions, 11 deletions
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
index 44bbc30..8f24c75 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -7,11 +7,13 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
-#include "content/browser/frame_host/navigation_request_info.h"
+#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
+#include "content/common/navigation_params.h"
namespace content {
class ResourceRequestBody;
+struct NavigationRequestInfo;
// PlzNavigate
// A UI thread object that owns a navigation request until it commits. It
@@ -19,33 +21,48 @@ class ResourceRequestBody;
// ResourceDispatcherHost (that lives on the IO thread).
// TODO(clamy): Describe the interactions between the UI and IO thread during
// the navigation following its refactoring.
-class NavigationRequest {
+class CONTENT_EXPORT NavigationRequest {
public:
- NavigationRequest(const NavigationRequestInfo& info,
- int64 frame_tree_node_id);
+ NavigationRequest(int64 frame_tree_node_id,
+ const CommonNavigationParams& common_params,
+ const CommitNavigationParams& commit_params);
~NavigationRequest();
// Called on the UI thread by the RenderFrameHostManager which owns the
- // NavigationRequest. After calling this function, |body| can no longer be
- // manipulated on the UI thread.
- void BeginNavigation(scoped_refptr<ResourceRequestBody> body);
+ // NavigationRequest. Takes ownership of |info|. After calling this function,
+ // |body| can no longer be manipulated on the UI thread.
+ void BeginNavigation(scoped_ptr<NavigationRequestInfo> info,
+ scoped_refptr<ResourceRequestBody> body);
// Called on the UI thread by the RenderFrameHostManager which owns the
// NavigationRequest whenever this navigation request should be canceled.
void CancelNavigation();
- const NavigationRequestInfo& info() const { return info_; }
-
int64 frame_tree_node_id() const { return frame_tree_node_id_; }
-
int64 navigation_request_id() const { return navigation_request_id_; }
+ CommonNavigationParams& common_params() { return common_params_; }
+
+ const CommitNavigationParams& commit_params() const { return commit_params_; }
+
+ NavigationRequestInfo* info_for_test() const { return info_.get(); }
+
private:
const int64 navigation_request_id_;
- const NavigationRequestInfo info_;
const int64 frame_tree_node_id_;
+ // Initialized on creation of the NavigationRequest. Sent to the renderer when
+ // the navigation is ready to commit.
+ // Note: When the navigation is ready to commit, the url in |common_params|
+ // will be set to the final navigation url, obtained after following all
+ // redirects.
+ CommonNavigationParams common_params_;
+ const CommitNavigationParams commit_params_;
+
+ // Initialized when beginning the navigation.
+ scoped_ptr<NavigationRequestInfo> info_;
+
DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
};