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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 5240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5251 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { | 5251 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { |
| 5252 // The browser expects this frame to be loading an error page. Inform it | 5252 // The browser expects this frame to be loading an error page. Inform it |
| 5253 // that the load stopped. | 5253 // that the load stopped. |
| 5254 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 5254 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
| 5255 browser_side_navigation_pending_ = false; | 5255 browser_side_navigation_pending_ = false; |
| 5256 return; | 5256 return; |
| 5257 } | 5257 } |
| 5258 | 5258 |
| 5259 // On load failure, a frame can ask its owner to render fallback content. | 5259 // On load failure, a frame can ask its owner to render fallback content. |
| 5260 // When that happens, don't load an error page. | 5260 // When that happens, don't load an error page. |
| 5261 if (frame_->MaybeRenderFallbackContent(error)) { | 5261 WebLocalFrame::FallbackContentResult fallback_result = |
| 5262 frame_->MaybeRenderFallbackContent(error); | |
| 5263 if (fallback_result != WebLocalFrame::NoFallbackContent) { | |
| 5264 if (fallback_result == WebLocalFrame::NoLoadInProgress) { | |
| 5265 // If the frame wasn't loading but was fallback-elligible, the fallback | |
|
Charlie Reis
2017/04/12 22:05:22
nit: eligible
Nate Chapin
2017/04/13 17:32:21
Done.
| |
| 5266 // content won't be shown. However, showing an error page isn't right | |
| 5267 // either, as the frame has already been populated with something | |
| 5268 // unrelated to this navigation failure. In that case, just send a stop | |
| 5269 // IPC to the browser to unwind its state, and leave the frame as-is. | |
| 5270 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | |
| 5271 } | |
| 5262 browser_side_navigation_pending_ = false; | 5272 browser_side_navigation_pending_ = false; |
| 5263 return; | 5273 return; |
| 5264 } | 5274 } |
| 5265 | 5275 |
| 5266 // Make sure errors are not shown in view source mode. | 5276 // Make sure errors are not shown in view source mode. |
| 5267 frame_->EnableViewSourceMode(false); | 5277 frame_->EnableViewSourceMode(false); |
| 5268 | 5278 |
| 5269 // Replace the current history entry in reloads, and loads of the same url. | 5279 // Replace the current history entry in reloads, and loads of the same url. |
| 5270 // This corresponds to Blink's notion of a standard commit. | 5280 // This corresponds to Blink's notion of a standard commit. |
| 5271 // Also replace the current history entry if the browser asked for it | 5281 // Also replace the current history entry if the browser asked for it |
| (...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6961 policy(info.default_policy), | 6971 policy(info.default_policy), |
| 6962 replaces_current_history_item(info.replaces_current_history_item), | 6972 replaces_current_history_item(info.replaces_current_history_item), |
| 6963 history_navigation_in_new_child_frame( | 6973 history_navigation_in_new_child_frame( |
| 6964 info.is_history_navigation_in_new_child_frame), | 6974 info.is_history_navigation_in_new_child_frame), |
| 6965 client_redirect(info.is_client_redirect), | 6975 client_redirect(info.is_client_redirect), |
| 6966 cache_disabled(info.is_cache_disabled), | 6976 cache_disabled(info.is_cache_disabled), |
| 6967 form(info.form), | 6977 form(info.form), |
| 6968 source_location(info.source_location) {} | 6978 source_location(info.source_location) {} |
| 6969 | 6979 |
| 6970 } // namespace content | 6980 } // namespace content |
| OLD | NEW |