Chromium Code Reviews| 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_; |
|
nasko
2014/09/24 21:15:34
Do we guarantee that FTN will outlive this object?
davidben
2014/10/03 16:27:51
We should. FTN owns RFHM which owns this object. (
|
| + |
| + GURL final_url_; |
| + scoped_ptr<NavigationURLLoader> loader_; |
| DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
| }; |