Index: content/browser/frame_host/navigation_request.cc |
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc |
index 57f5479727c1c55f65e29f88a442875a0aa623f8..853e065a45a42e290daf732fe0be604d48c6aff2 100644 |
--- a/content/browser/frame_host/navigation_request.cc |
+++ b/content/browser/frame_host/navigation_request.cc |
@@ -21,7 +21,8 @@ NavigationRequest::NavigationRequest( |
const CommitNavigationParams& commit_params) |
: frame_tree_node_(frame_tree_node), |
common_params_(common_params), |
- commit_params_(commit_params) { |
+ commit_params_(commit_params), |
+ state_(NOT_STARTED) { |
} |
NavigationRequest::~NavigationRequest() { |
@@ -31,6 +32,8 @@ void NavigationRequest::BeginNavigation( |
scoped_ptr<NavigationRequestInfo> info, |
scoped_refptr<ResourceRequestBody> request_body) { |
DCHECK(!loader_); |
+ DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); |
+ state_ = STARTED; |
loader_ = NavigationURLLoader::Create( |
frame_tree_node_->navigator()->GetController()->GetBrowserContext(), |
frame_tree_node_->frame_tree_node_id(), common_params_, info.Pass(), |
@@ -55,11 +58,13 @@ void NavigationRequest::OnRequestRedirected( |
void NavigationRequest::OnResponseStarted( |
const scoped_refptr<ResourceResponse>& response, |
scoped_ptr<StreamHandle> body) { |
+ state_ = RESPONSE_STARTED; |
nasko
2014/12/16 01:40:26
DCHECK that the request has started?
clamy
2014/12/17 15:47:57
Done.
|
frame_tree_node_->navigator()->CommitNavigation(frame_tree_node_, |
response.get(), body.Pass()); |
} |
void NavigationRequest::OnRequestFailed(int net_error) { |
+ state_ = FAILED; |
nasko
2014/12/16 01:40:26
Similarly here, we shouldn't reach this code unles
clamy
2014/12/17 15:47:57
Done.
|
// TODO(davidben): Network failures should display a network error page. |
NOTIMPLEMENTED(); |
} |