Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2439903003: PlzNavigate: Allow frames to fallback to alternative content. (Closed)
Patch Set: Using frameloader::loadFail. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5053 matching lines...) Expand 10 before | Expand all | Expand 10 after
5064 frame_->isViewSourceModeEnabled()); 5064 frame_->isViewSourceModeEnabled());
5065 5065
5066 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { 5066 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
5067 // The browser expects this frame to be loading an error page. Inform it 5067 // The browser expects this frame to be loading an error page. Inform it
5068 // that the load stopped. 5068 // that the load stopped.
5069 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 5069 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5070 browser_side_navigation_pending_ = false; 5070 browser_side_navigation_pending_ = false;
5071 return; 5071 return;
5072 } 5072 }
5073 5073
5074 // On load failure, a frame can ask its owner to render fallback content.
5075 // If it is possible, there is no more need to load an error page since it
5076 // will not be displayed.
5077 if (frame_->canRenderFallbackContent()) {
5078 frame_->loadFailed(error);
5079 browser_side_navigation_pending_ = false;
5080 return;
5081 }
5082
5074 // Make sure errors are not shown in view source mode. 5083 // Make sure errors are not shown in view source mode.
5075 frame_->enableViewSourceMode(false); 5084 frame_->enableViewSourceMode(false);
5076 5085
5077 // Replace the current history entry in reloads, and loads of the same url. 5086 // Replace the current history entry in reloads, and loads of the same url.
5078 // This corresponds to Blink's notion of a standard commit. 5087 // This corresponds to Blink's notion of a standard commit.
5079 // Also replace the current history entry if the browser asked for it 5088 // Also replace the current history entry if the browser asked for it
5080 // specifically. 5089 // specifically.
5081 // TODO(clamy): see if initial commits in subframes should be handled 5090 // TODO(clamy): see if initial commits in subframes should be handled
5082 // separately. 5091 // separately.
5083 bool replace = is_reload || common_params.url == GetLoadingUrl() || 5092 bool replace = is_reload || common_params.url == GetLoadingUrl() ||
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
6596 // event target. Potentially a Pepper plugin will receive the event. 6605 // event target. Potentially a Pepper plugin will receive the event.
6597 // In order to tell whether a plugin gets the last mouse event and which it 6606 // In order to tell whether a plugin gets the last mouse event and which it
6598 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6607 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6599 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6608 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6600 // |pepper_last_mouse_event_target_|. 6609 // |pepper_last_mouse_event_target_|.
6601 pepper_last_mouse_event_target_ = nullptr; 6610 pepper_last_mouse_event_target_ = nullptr;
6602 #endif 6611 #endif
6603 } 6612 }
6604 6613
6605 } // namespace content 6614 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698