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 5250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5261 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { | 5261 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { |
| 5262 // The browser expects this frame to be loading an error page. Inform it | 5262 // The browser expects this frame to be loading an error page. Inform it |
| 5263 // that the load stopped. | 5263 // that the load stopped. |
| 5264 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 5264 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
| 5265 browser_side_navigation_pending_ = false; | 5265 browser_side_navigation_pending_ = false; |
| 5266 return; | 5266 return; |
| 5267 } | 5267 } |
| 5268 | 5268 |
| 5269 // On load failure, a frame can ask its owner to render fallback content. | 5269 // On load failure, a frame can ask its owner to render fallback content. |
| 5270 // When that happens, don't load an error page. | 5270 // When that happens, don't load an error page. |
| 5271 bool was_loading = !frame_->isLoading(); | |
|
arthursonzogni
2017/04/05 07:53:34
This is wrong here.
You meant: bool was_loading =
Nate Chapin
2017/04/11 18:39:00
Done.
| |
| 5271 if (frame_->maybeRenderFallbackContent(error)) { | 5272 if (frame_->maybeRenderFallbackContent(error)) { |
| 5273 // If the frame wasn't loading but was fallback-elligible, the fallback | |
| 5274 // content won't be shown. However, showing an error page isn't right | |
| 5275 // either, as the frame has already been populated with something unrelated | |
| 5276 // to this navigation failure. In that case, just send a stop IPC to the | |
| 5277 // browser to unwind its state, and leave the frame as-is. | |
| 5278 if (!was_loading) | |
| 5279 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | |
| 5272 browser_side_navigation_pending_ = false; | 5280 browser_side_navigation_pending_ = false; |
| 5273 return; | 5281 return; |
| 5274 } | 5282 } |
| 5275 | 5283 |
| 5276 // Make sure errors are not shown in view source mode. | 5284 // Make sure errors are not shown in view source mode. |
| 5277 frame_->enableViewSourceMode(false); | 5285 frame_->enableViewSourceMode(false); |
| 5278 | 5286 |
| 5279 // Replace the current history entry in reloads, and loads of the same url. | 5287 // Replace the current history entry in reloads, and loads of the same url. |
| 5280 // This corresponds to Blink's notion of a standard commit. | 5288 // This corresponds to Blink's notion of a standard commit. |
| 5281 // Also replace the current history entry if the browser asked for it | 5289 // 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... | |
| 6971 policy(info.defaultPolicy), | 6979 policy(info.defaultPolicy), |
| 6972 replaces_current_history_item(info.replacesCurrentHistoryItem), | 6980 replaces_current_history_item(info.replacesCurrentHistoryItem), |
| 6973 history_navigation_in_new_child_frame( | 6981 history_navigation_in_new_child_frame( |
| 6974 info.isHistoryNavigationInNewChildFrame), | 6982 info.isHistoryNavigationInNewChildFrame), |
| 6975 client_redirect(info.isClientRedirect), | 6983 client_redirect(info.isClientRedirect), |
| 6976 cache_disabled(info.isCacheDisabled), | 6984 cache_disabled(info.isCacheDisabled), |
| 6977 form(info.form), | 6985 form(info.form), |
| 6978 source_location(info.sourceLocation) {} | 6986 source_location(info.sourceLocation) {} |
| 6979 | 6987 |
| 6980 } // namespace content | 6988 } // namespace content |
| OLD | NEW |