| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
| 8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
| 9 #include "content/browser/frame_host/navigation_controller_impl.h" | 9 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 10 #include "content/browser/frame_host/navigation_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 void NavigationRequest::OnResponseStarted( | 197 void NavigationRequest::OnResponseStarted( |
| 198 const scoped_refptr<ResourceResponse>& response, | 198 const scoped_refptr<ResourceResponse>& response, |
| 199 scoped_ptr<StreamHandle> body) { | 199 scoped_ptr<StreamHandle> body) { |
| 200 DCHECK(state_ == STARTED); | 200 DCHECK(state_ == STARTED); |
| 201 state_ = RESPONSE_STARTED; | 201 state_ = RESPONSE_STARTED; |
| 202 frame_tree_node_->navigator()->CommitNavigation(frame_tree_node_, | 202 frame_tree_node_->navigator()->CommitNavigation(frame_tree_node_, |
| 203 response.get(), body.Pass()); | 203 response.get(), body.Pass()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void NavigationRequest::OnRequestFailed(int net_error) { | 206 void NavigationRequest::OnRequestFailed(bool has_stale_copy_in_cache, |
| 207 int net_error) { |
| 207 DCHECK(state_ == STARTED); | 208 DCHECK(state_ == STARTED); |
| 208 state_ = FAILED; | 209 state_ = FAILED; |
| 209 // TODO(davidben): Network failures should display a network error page. | 210 frame_tree_node_->navigator()->FailedNavigation( |
| 210 NOTIMPLEMENTED() << " where net_error=" << net_error; | 211 frame_tree_node_, has_stale_copy_in_cache, net_error); |
| 211 } | 212 } |
| 212 | 213 |
| 213 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { | 214 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { |
| 214 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, | 215 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, |
| 215 common_params_.url); | 216 common_params_.url); |
| 216 } | 217 } |
| 217 | 218 |
| 218 } // namespace content | 219 } // namespace content |
| OLD | NEW |