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 eb5372113741e6ee9bb5e6d2eefd21ef957c76d7..502fc6d7343c9d176791a1237254322766315b50 100644 |
--- a/content/browser/frame_host/navigation_request.h |
+++ b/content/browser/frame_host/navigation_request.h |
@@ -27,6 +27,28 @@ struct NavigationRequestInfo; |
// the navigation following its refactoring. |
class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { |
public: |
+ // Keeps track of the various stages of a NavigationRequest. |
+ enum NavigationState { |
+ // Initial state. |
+ NOT_STARTED = 0, |
+ |
+ // Waiting for a BeginNavigation IPC from the renderer in a |
+ // browser-initiated navigation. If there is no live renderer when the |
+ // request is created, this stage is skipped. |
+ WAITING_FOR_RENDERER_RESPONSE, |
+ |
+ // The request was sent to the IO thread. |
+ STARTED, |
+ |
+ // The response started on the IO thread and is ready to be committed. This |
+ // is one of the two final states for the request. |
+ RESPONSE_STARTED, |
+ |
+ // The request failed on the IO thread and an error page should be |
+ // displayed. This is one of the two final states for the request. |
+ FAILED, |
+ }; |
+ |
NavigationRequest(FrameTreeNode* frame_tree_node, |
const CommonNavigationParams& common_params, |
const CommitNavigationParams& commit_params); |
@@ -45,6 +67,13 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { |
NavigationURLLoader* loader_for_testing() const { return loader_.get(); } |
+ NavigationState state() const { return state_; } |
+ |
+ void SetWaitingForRendererResponse() { |
+ DCHECK(state_ == NOT_STARTED); |
+ state_ = WAITING_FOR_RENDERER_RESPONSE; |
+ } |
+ |
private: |
// NavigationURLLoaderDelegate implementation. |
void OnRequestRedirected( |
@@ -64,6 +93,8 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { |
CommonNavigationParams common_params_; |
const CommitNavigationParams commit_params_; |
+ NavigationState state_; |
+ |
scoped_ptr<NavigationURLLoader> loader_; |
DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |