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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 958083002: PlzNavigate: Show error pages when the navigation failed before commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support-data-urls
Patch Set: Updated test Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698