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

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

Issue 2687593002: PlzNavigate: Invoke didFailProvisionalLoad() in the renderer when a navigation request is cancelled… (Closed)
Patch Set: We may not have a provisional data source at all times Created 3 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); 1016 NavigationRequest* navigation_request = frame_tree_node->navigation_request();
1017 DCHECK(navigation_request); 1017 DCHECK(navigation_request);
1018 1018
1019 // With PlzNavigate, debug URLs will give a failed navigation because the 1019 // With PlzNavigate, debug URLs will give a failed navigation because the
1020 // WebUI backend won't find a handler for them. They will be processed in the 1020 // WebUI backend won't find a handler for them. They will be processed in the
1021 // renderer, however do not discard the pending entry so that the URL bar 1021 // renderer, however do not discard the pending entry so that the URL bar
1022 // shows them correctly. 1022 // shows them correctly.
1023 if (!IsRendererDebugURL(navigation_request->navigation_handle()->GetURL())) 1023 if (!IsRendererDebugURL(navigation_request->navigation_handle()->GetURL()))
1024 DiscardPendingEntryIfNeeded(navigation_request->navigation_handle()); 1024 DiscardPendingEntryIfNeeded(navigation_request->navigation_handle());
1025 1025
1026 // Select an appropriate renderer to show the error page.
1027 RenderFrameHostImpl* render_frame_host =
1028 frame_tree_node->render_manager()->GetFrameHostForNavigation(
1029 *navigation_request);
1030
1026 // If the request was canceled by the user do not show an error page. 1031 // If the request was canceled by the user do not show an error page.
1027 if (error_code == net::ERR_ABORTED) { 1032 if (error_code == net::ERR_ABORTED) {
1033 render_frame_host->AbortNavigationRequest(
clamy 2017/02/08 17:13:34 How many tests fail without this? I'm not terribly
ananta 2017/02/08 23:02:19 Thanks. FrameLoader::stopAllLoaders() now sends fa
1034 navigation_request->common_params().url, error_code);
1028 frame_tree_node->ResetNavigationRequest(false); 1035 frame_tree_node->ResetNavigationRequest(false);
1029 return; 1036 return;
1030 } 1037 }
1031 1038
1032 // Select an appropriate renderer to show the error page.
1033 RenderFrameHostImpl* render_frame_host =
1034 frame_tree_node->render_manager()->GetFrameHostForNavigation(
1035 *navigation_request);
1036 CheckWebUIRendererDoesNotDisplayNormalURL( 1039 CheckWebUIRendererDoesNotDisplayNormalURL(
1037 render_frame_host, navigation_request->common_params().url); 1040 render_frame_host, navigation_request->common_params().url);
1038 1041
1039 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 1042 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
1040 render_frame_host->navigation_handle()->ReadyToCommitNavigation( 1043 render_frame_host->navigation_handle()->ReadyToCommitNavigation(
1041 render_frame_host); 1044 render_frame_host);
1042 render_frame_host->FailedNavigation(navigation_request->common_params(), 1045 render_frame_host->FailedNavigation(navigation_request->common_params(),
1043 navigation_request->request_params(), 1046 navigation_request->request_params(),
1044 has_stale_copy_in_cache, error_code); 1047 has_stale_copy_in_cache, error_code);
1045 } 1048 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 if (navigation_handle) 1283 if (navigation_handle)
1281 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1284 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1282 1285
1283 controller_->SetPendingEntry(std::move(entry)); 1286 controller_->SetPendingEntry(std::move(entry));
1284 if (delegate_) 1287 if (delegate_)
1285 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1288 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1286 } 1289 }
1287 } 1290 }
1288 1291
1289 } // namespace content 1292 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698