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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 166 |
| 167 void NavigatorImpl::DidFailProvisionalLoadWithError( | 167 void NavigatorImpl::DidFailProvisionalLoadWithError( |
| 168 RenderFrameHostImpl* render_frame_host, | 168 RenderFrameHostImpl* render_frame_host, |
| 169 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 169 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 170 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() | 170 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() |
| 171 << ", error_code: " << params.error_code | 171 << ", error_code: " << params.error_code |
| 172 << ", error_description: " << params.error_description | 172 << ", error_description: " << params.error_description |
| 173 << ", showing_repost_interstitial: " << | 173 << ", showing_repost_interstitial: " << |
| 174 params.showing_repost_interstitial | 174 params.showing_repost_interstitial |
| 175 << ", frame_id: " << render_frame_host->GetRoutingID(); | 175 << ", frame_id: " << render_frame_host->GetRoutingID(); |
| 176 if (controller_->GetPendingEntry() && params.nav_entry_id != 0 && | |
| 177 controller_->GetPendingEntry()->GetUniqueID() != params.nav_entry_id) { | |
| 178 // If this failure is browser-initiated but isn't that of the pending entry, | |
| 179 // ignore it. This can happen if there is an outstanding request that never | |
| 180 // committed, and then a user makes a new request. In that case the new | |
| 181 // request will be the pending entry, and the attempt to load the new | |
| 182 // request will cause a failure message from the old request. | |
| 183 return; | |
|
Charlie Reis
2015/04/10 23:54:21
I'm a little surprised this didn't cause issues wi
Avi (use Gerrit)
2015/04/13 22:42:48
This was full of surprise to me, and I was kinda s
| |
| 184 } | |
| 185 | |
| 176 GURL validated_url(params.url); | 186 GURL validated_url(params.url); |
| 177 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | 187 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); |
| 178 render_process_host->FilterURL(false, &validated_url); | 188 render_process_host->FilterURL(false, &validated_url); |
| 179 | 189 |
| 180 if (net::ERR_ABORTED == params.error_code) { | 190 if (net::ERR_ABORTED == params.error_code) { |
| 181 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. | 191 // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. |
| 182 // This means that the interstitial won't be torn down properly, which is | 192 // This means that the interstitial won't be torn down properly, which is |
| 183 // bad. But if we have an interstitial, go back to another tab type, and | 193 // bad. But if we have an interstitial, go back to another tab type, and |
| 184 // then load the same interstitial again, we could end up getting the first | 194 // then load the same interstitial again, we could end up getting the first |
| 185 // interstitial's "failed" message (as a result of the cancel) when we're on | 195 // interstitial's "failed" message (as a result of the cancel) when we're on |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 891 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 901 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 892 time_to_commit); | 902 time_to_commit); |
| 893 UMA_HISTOGRAM_TIMES( | 903 UMA_HISTOGRAM_TIMES( |
| 894 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 904 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 895 time_to_network); | 905 time_to_network); |
| 896 } | 906 } |
| 897 navigation_data_.reset(); | 907 navigation_data_.reset(); |
| 898 } | 908 } |
| 899 | 909 |
| 900 } // namespace content | 910 } // namespace content |
| OLD | NEW |