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

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

Issue 872473003: PlzNavigate: Remove the RequestNavigation IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/browser/frame_host/navigation_request.h
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
index 649e62885c4775bb9b62e6cf8cae7ee0822abda0..9e545e07f7d8dddb1ce4b43df8b6475842788012 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -52,24 +52,28 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
FAILED,
};
- static scoped_ptr<NavigationRequest> Create(
- FrameTreeNode* frame_tree_node,
- const NavigationEntryImpl& entry,
- FrameMsg_Navigate_Type::Value navigation_type,
- base::TimeTicks navigation_start);
-
- NavigationRequest(FrameTreeNode* frame_tree_node,
- const CommonNavigationParams& common_params,
- const CommitNavigationParams& commit_params,
- const NavigationEntryImpl* navitation_entry);
+ // Creates a request for a browser-intiated navigation.
+ static scoped_ptr<NavigationRequest> CreateBrowserInitiated(
+ FrameTreeNode* frame_tree_node,
+ const NavigationEntryImpl& entry,
+ FrameMsg_Navigate_Type::Value navigation_type,
+ base::TimeTicks navigation_start);
+
+ // Creates a request for a renderer-intiated navigation.
+ // Note: |body| is sent to the IO thread when calling BeginNavigation, and
+ // should no longer be manipulated afterwards on the UI thread.
+ static scoped_ptr<NavigationRequest> CreateRendererInitiated(
+ FrameTreeNode* frame_tree_node,
+ const CommonNavigationParams& common_params,
+ const BeginNavigationParams& begin_params,
+ scoped_refptr<ResourceRequestBody> body);
~NavigationRequest() override;
- // Called on the UI thread by the RenderFrameHostManager which owns the
- // 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 Navigator to start the navigation on the IO
+ // thread. After calling this function, |body_| can no longer be manipulated
davidben 2015/02/03 02:23:20 body_ doesn't seem to exist. I think this sentence
clamy 2015/02/03 16:17:09 Done.
+ // on the UI thread.
+ void BeginNavigation();
CommonNavigationParams& common_params() { return common_params_; }
davidben 2015/02/03 02:23:21 I think this is no longer needed now that Navigato
carlosk 2015/02/03 16:06:02 It's still needed because it's accessed in some pl
clamy 2015/02/03 16:17:09 We already have a const accessor, so I removed the
@@ -97,12 +101,22 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
int bindings() const { return bindings_; };
+ bool browser_initiated() const { return browser_initiated_ ; }
+
void SetWaitingForRendererResponse() {
DCHECK(state_ == NOT_STARTED);
state_ = WAITING_FOR_RENDERER_RESPONSE;
}
private:
+ NavigationRequest(FrameTreeNode* frame_tree_node,
+ const CommonNavigationParams& common_params,
+ const BeginNavigationParams& begin_params,
+ const CommitNavigationParams& commit_params,
+ scoped_refptr<ResourceRequestBody> body,
+ bool browser_initiated,
+ const NavigationEntryImpl* navitation_entry);
+
// NavigationURLLoaderDelegate implementation.
void OnRequestRedirected(
const net::RedirectInfo& redirect_info,
@@ -119,10 +133,17 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
// will be set to the final navigation url, obtained after following all
// redirects.
CommonNavigationParams common_params_;
carlosk 2015/02/03 16:06:02 I think this one could become const as well.
clamy 2015/02/03 16:17:09 No, because redirects will modify the url there.
+ const BeginNavigationParams begin_params_;
const CommitNavigationParams commit_params_;
+ const bool browser_initiated_;
NavigationState state_;
+
+ // The parameters to send to the IO thread. |loader_| takes ownership of
+ // |info_| after calling BeginNavigation.
+ scoped_ptr<NavigationRequestInfo> info_;
+
scoped_ptr<NavigationURLLoader> loader_;
// These next items are used in browser-initiated navigations to store

Powered by Google App Engine
This is Rietveld 408576698