Chromium Code Reviews| 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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 | 220 |
| 221 // We used to cancel the pending renderer here for cross-site downloads. | 221 // We used to cancel the pending renderer here for cross-site downloads. |
| 222 // However, it's not safe to do that because the download logic repeatedly | 222 // However, it's not safe to do that because the download logic repeatedly |
| 223 // looks for this WebContents based on a render ID. Instead, we just | 223 // looks for this WebContents based on a render ID. Instead, we just |
| 224 // leave the pending renderer around until the next navigation event | 224 // leave the pending renderer around until the next navigation event |
| 225 // (Navigate, DidNavigate, etc), which will clean it up properly. | 225 // (Navigate, DidNavigate, etc), which will clean it up properly. |
| 226 // | 226 // |
| 227 // TODO(creis): Find a way to cancel any pending RFH here. | 227 // TODO(creis): Find a way to cancel any pending RFH here. |
| 228 } | 228 } |
| 229 | 229 |
| 230 DiscardPendingEntryOnFailureIfNeeded(render_frame_host->navigation_handle()); | 230 // Discard the pending navigation entry if needed. |
| 231 // PlzNavigate: the entry has already been discarded in DidFailNavigation. | |
|
Charlie Reis
2016/04/11 21:10:57
s/DidFailNavigation/FailedNavigation/
(Same in CL
clamy
2016/04/12 14:08:01
Done.
| |
| 232 if (!IsBrowserSideNavigationEnabled()) { | |
| 233 DiscardPendingEntryOnFailureIfNeeded( | |
| 234 render_frame_host->navigation_handle()); | |
| 235 } | |
| 231 | 236 |
| 232 if (delegate_) | 237 if (delegate_) |
| 233 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); | 238 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); |
| 234 } | 239 } |
| 235 | 240 |
| 236 void NavigatorImpl::DidFailLoadWithError( | 241 void NavigatorImpl::DidFailLoadWithError( |
| 237 RenderFrameHostImpl* render_frame_host, | 242 RenderFrameHostImpl* render_frame_host, |
| 238 const GURL& url, | 243 const GURL& url, |
| 239 int error_code, | 244 int error_code, |
| 240 const base::string16& error_description, | 245 const base::string16& error_description, |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1090 if (pending_entry != controller_->GetVisibleEntry() || | 1095 if (pending_entry != controller_->GetVisibleEntry() || |
| 1091 !should_preserve_entry) { | 1096 !should_preserve_entry) { |
| 1092 controller_->DiscardPendingEntry(true); | 1097 controller_->DiscardPendingEntry(true); |
| 1093 | 1098 |
| 1094 // Also force the UI to refresh. | 1099 // Also force the UI to refresh. |
| 1095 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1100 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1096 } | 1101 } |
| 1097 } | 1102 } |
| 1098 | 1103 |
| 1099 } // namespace content | 1104 } // namespace content |
| OLD | NEW |