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

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

Issue 519533002: Initial PlzNavigate RDH-side logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 6 years, 2 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 8f24c7542ee464bf13d1773b900f3c4e52c5d675..8fa6706628c892362e0f7f3c8279ede08aa71b82 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -8,10 +8,15 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "content/browser/loader/navigation_url_loader.h"
#include "content/common/content_export.h"
#include "content/common/navigation_params.h"
+#include "url/gurl.h"
namespace content {
+
+class BrowserContext;
+class FrameTreeNode;
class ResourceRequestBody;
struct NavigationRequestInfo;
@@ -21,13 +26,14 @@ struct NavigationRequestInfo;
// 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 CONTENT_EXPORT NavigationRequest {
+class CONTENT_EXPORT NavigationRequest : public NavigationURLLoader::Delegate {
public:
- NavigationRequest(int64 frame_tree_node_id,
+ NavigationRequest(BrowserContext* browser_context,
+ FrameTreeNode* frame_tree_node,
const CommonNavigationParams& common_params,
const CommitNavigationParams& commit_params);
- ~NavigationRequest();
+ virtual ~NavigationRequest();
// Called on the UI thread by the RenderFrameHostManager which owns the
// NavigationRequest. Takes ownership of |info|. After calling this function,
@@ -35,22 +41,21 @@ class CONTENT_EXPORT NavigationRequest {
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();
-
- 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(); }
+ NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
private:
- const int64 navigation_request_id_;
- const int64 frame_tree_node_id_;
+ // NavigationURLLoader::Delegate implementation.
+ virtual void OnRequestRedirected(const net::RedirectInfo& redirect_info,
+ ResourceResponse* response) OVERRIDE;
+ virtual void OnResponseStarted(ResourceResponse* response,
+ scoped_ptr<StreamHandle> body) OVERRIDE;
+ virtual void OnRequestFailed(int net_error) OVERRIDE;
+
+ BrowserContext* browser_context_;
+ FrameTreeNode* frame_tree_node_;
// Initialized on creation of the NavigationRequest. Sent to the renderer when
// the navigation is ready to commit.
@@ -60,8 +65,8 @@ class CONTENT_EXPORT NavigationRequest {
CommonNavigationParams common_params_;
const CommitNavigationParams commit_params_;
- // Initialized when beginning the navigation.
- scoped_ptr<NavigationRequestInfo> info_;
+ GURL final_url_;
+ scoped_ptr<NavigationURLLoader> loader_;
DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
};
« no previous file with comments | « content/browser/frame_host/navigation_before_commit_info.cc ('k') | content/browser/frame_host/navigation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698