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

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

Issue 2439903003: PlzNavigate: Allow frames to fallback to alternative content. (Closed)
Patch Set: Two more test are fixed by this CL. 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 5045 matching lines...) Expand 10 before | Expand all | Expand 10 after
5056 pending_navigation_params_.reset(new NavigationParams( 5056 pending_navigation_params_.reset(new NavigationParams(
5057 common_params, StartNavigationParams(), request_params)); 5057 common_params, StartNavigationParams(), request_params));
5058 5058
5059 // Send the provisional load failure. 5059 // Send the provisional load failure.
5060 blink::WebURLError error = 5060 blink::WebURLError error =
5061 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code); 5061 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code);
5062 WebURLRequest failed_request = CreateURLRequestForNavigation( 5062 WebURLRequest failed_request = CreateURLRequestForNavigation(
5063 common_params, std::unique_ptr<StreamOverrideParameters>(), 5063 common_params, std::unique_ptr<StreamOverrideParameters>(),
5064 frame_->isViewSourceModeEnabled()); 5064 frame_->isViewSourceModeEnabled());
5065 5065
5066 // On load failure, a frame can ask its owner to render fallback content.
5067 // If it is possible, then there is no more need to load an error page.
5068 if (frame_->canRenderFallbackContent()) {
5069 frame_->loadFailed();
5070 browser_side_navigation_pending_ = false;
5071 return;
5072 }
5073
5066 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { 5074 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
5067 // The browser expects this frame to be loading an error page. Inform it 5075 // The browser expects this frame to be loading an error page. Inform it
5068 // that the load stopped. 5076 // that the load stopped.
5069 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 5077 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5070 browser_side_navigation_pending_ = false; 5078 browser_side_navigation_pending_ = false;
5071 return; 5079 return;
5072 } 5080 }
5073 5081
5074 // Make sure errors are not shown in view source mode. 5082 // Make sure errors are not shown in view source mode.
5075 frame_->enableViewSourceMode(false); 5083 frame_->enableViewSourceMode(false);
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
6596 // event target. Potentially a Pepper plugin will receive the event. 6604 // 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 6605 // 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 6606 // 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 6607 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6600 // |pepper_last_mouse_event_target_|. 6608 // |pepper_last_mouse_event_target_|.
6601 pepper_last_mouse_event_target_ = nullptr; 6609 pepper_last_mouse_event_target_ = nullptr;
6602 #endif 6610 #endif
6603 } 6611 }
6604 6612
6605 } // namespace content 6613 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698