OLD | NEW |
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.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // We used to cancel the pending renderer here for cross-site downloads. | 236 // We used to cancel the pending renderer here for cross-site downloads. |
237 // However, it's not safe to do that because the download logic repeatedly | 237 // However, it's not safe to do that because the download logic repeatedly |
238 // looks for this WebContents based on a render ID. Instead, we just | 238 // looks for this WebContents based on a render ID. Instead, we just |
239 // leave the pending renderer around until the next navigation event | 239 // leave the pending renderer around until the next navigation event |
240 // (Navigate, DidNavigate, etc), which will clean it up properly. | 240 // (Navigate, DidNavigate, etc), which will clean it up properly. |
241 // | 241 // |
242 // TODO(creis): Find a way to cancel any pending RFH here. | 242 // TODO(creis): Find a way to cancel any pending RFH here. |
243 } | 243 } |
244 | 244 |
245 // Discard the pending navigation entry if needed. | 245 // Discard the pending navigation entry if needed. |
246 // PlzNavigate: the entry has already been discarded in FailedNavigation. | 246 DiscardPendingEntryOnFailureIfNeeded(render_frame_host->navigation_handle()); |
247 if (!IsBrowserSideNavigationEnabled()) { | |
248 DiscardPendingEntryOnFailureIfNeeded( | |
249 render_frame_host->navigation_handle()); | |
250 } | |
251 | 247 |
252 if (delegate_) { | 248 if (delegate_) { |
253 delegate_->DidFailProvisionalLoadWithError( | 249 delegate_->DidFailProvisionalLoadWithError( |
254 render_frame_host, validated_url, params.error_code, | 250 render_frame_host, validated_url, params.error_code, |
255 params.error_description, params.was_ignored_by_handler); | 251 params.error_description, params.was_ignored_by_handler); |
256 } | 252 } |
257 } | 253 } |
258 | 254 |
259 void NavigatorImpl::DidFailLoadWithError( | 255 void NavigatorImpl::DidFailLoadWithError( |
260 RenderFrameHostImpl* render_frame_host, | 256 RenderFrameHostImpl* render_frame_host, |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 if (pending_entry != controller_->GetVisibleEntry() || | 1208 if (pending_entry != controller_->GetVisibleEntry() || |
1213 !should_preserve_entry) { | 1209 !should_preserve_entry) { |
1214 controller_->DiscardPendingEntry(true); | 1210 controller_->DiscardPendingEntry(true); |
1215 | 1211 |
1216 // Also force the UI to refresh. | 1212 // Also force the UI to refresh. |
1217 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1213 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
1218 } | 1214 } |
1219 } | 1215 } |
1220 | 1216 |
1221 } // namespace content | 1217 } // namespace content |
OLD | NEW |