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

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: Created 6 years, 3 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 44bbc309ba99e09e2eae6b87a2cf6d25639091cd..8b4b253ee0ede0ce16da49f1a416d7261d01f3f5 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -8,9 +8,14 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "content/browser/frame_host/navigation_request_info.h"
+#include "content/browser/loader/navigation_url_loader.h"
#include "content/common/content_export.h"
+#include "url/gurl.h"
namespace content {
+
+class BrowserContext;
+class FrameTreeNode;
class ResourceRequestBody;
// PlzNavigate
@@ -19,32 +24,39 @@ 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 NavigationRequest : public NavigationURLLoader::Delegate {
public:
NavigationRequest(const NavigationRequestInfo& info,
- int64 frame_tree_node_id);
+ BrowserContext* browser_context,
+ FrameTreeNode* frame_tree_node);
- ~NavigationRequest();
+ virtual ~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);
- // 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_; }
+ FrameTreeNode* frame_tree_node() const { return frame_tree_node_; }
- int64 navigation_request_id() const { return navigation_request_id_; }
+ NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
private:
- const int64 navigation_request_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;
+
const NavigationRequestInfo info_;
- const int64 frame_tree_node_id_;
+ BrowserContext* browser_context_;
+ FrameTreeNode* frame_tree_node_;
+
+ GURL final_url_;
+ scoped_ptr<NavigationURLLoader> loader_;
DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
};

Powered by Google App Engine
This is Rietveld 408576698