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

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

Issue 1696973002: Revert of Reland #1 Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « content/common/frame_messages.h ('k') | content/test/test_web_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4707 // provide it with the response to the request. 4707 // provide it with the response to the request.
4708 scoped_ptr<StreamOverrideParameters> stream_override( 4708 scoped_ptr<StreamOverrideParameters> stream_override(
4709 new StreamOverrideParameters()); 4709 new StreamOverrideParameters());
4710 stream_override->stream_url = stream_url; 4710 stream_override->stream_url = stream_url;
4711 stream_override->response = response; 4711 stream_override->response = response;
4712 4712
4713 NavigateInternal(common_params, StartNavigationParams(), request_params, 4713 NavigateInternal(common_params, StartNavigationParams(), request_params,
4714 std::move(stream_override)); 4714 std::move(stream_override));
4715 } 4715 }
4716 4716
4717 // PlzNavigate
4718 void RenderFrameImpl::OnFailedNavigation( 4717 void RenderFrameImpl::OnFailedNavigation(
4719 const CommonNavigationParams& common_params, 4718 const CommonNavigationParams& common_params,
4720 const RequestNavigationParams& request_params, 4719 const RequestNavigationParams& request_params,
4721 bool has_stale_copy_in_cache, 4720 bool has_stale_copy_in_cache,
4722 int error_code) { 4721 int error_code) {
4723 DCHECK(IsBrowserSideNavigationEnabled());
4724 bool is_reload = IsReload(common_params.navigation_type); 4722 bool is_reload = IsReload(common_params.navigation_type);
4725 bool is_history_navigation = request_params.page_state.IsValid(); 4723 bool is_history_navigation = request_params.page_state.IsValid();
4726 WebURLRequest::CachePolicy cache_policy = 4724 WebURLRequest::CachePolicy cache_policy =
4727 WebURLRequest::UseProtocolCachePolicy; 4725 WebURLRequest::UseProtocolCachePolicy;
4728 RenderFrameImpl::PrepareRenderViewForNavigation( 4726 RenderFrameImpl::PrepareRenderViewForNavigation(
4729 common_params.url, request_params, &is_reload, &cache_policy); 4727 common_params.url, request_params, &is_reload, &cache_policy);
4730 4728
4731 GetContentClient()->SetActiveURL(common_params.url); 4729 GetContentClient()->SetActiveURL(common_params.url);
4732 4730
4733 pending_navigation_params_.reset(new NavigationParams( 4731 pending_navigation_params_.reset(new NavigationParams(
4734 common_params, StartNavigationParams(), request_params)); 4732 common_params, StartNavigationParams(), request_params));
4735 4733
4736 // Inform the browser of the start of the provisional load. This is needed so 4734 // Inform the browser of the start of the provisional load. This is needed so
4737 // that the load is properly tracked by the WebNavigation API. 4735 // that the load is properly tracked by the WebNavigation API.
4738 Send(new FrameHostMsg_DidStartProvisionalLoad( 4736 Send(new FrameHostMsg_DidStartProvisionalLoad(
4739 routing_id_, common_params.url, common_params.navigation_start)); 4737 routing_id_, common_params.url, common_params.navigation_start));
4740 4738
4741 // Send the provisional load failure. 4739 // Send the provisional load failure.
4742 blink::WebURLError error = 4740 blink::WebURLError error =
4743 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code); 4741 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code);
4744 WebURLRequest failed_request = CreateURLRequestForNavigation( 4742 WebURLRequest failed_request = CreateURLRequestForNavigation(
4745 common_params, scoped_ptr<StreamOverrideParameters>(), 4743 common_params, scoped_ptr<StreamOverrideParameters>(),
4746 frame_->isViewSourceModeEnabled()); 4744 frame_->isViewSourceModeEnabled());
4747 SendFailedProvisionalLoad(failed_request, error, frame_); 4745 SendFailedProvisionalLoad(failed_request, error, frame_);
4748 4746
4749 // This check should have been done on the browser side already.
4750 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { 4747 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) {
4751 NOTREACHED(); 4748 // TODO(avi): Remove this; we shouldn't ever be dropping navigations.
4749 // http://crbug.com/501960
4750 Send(new FrameHostMsg_DidDropNavigation(routing_id_));
4752 return; 4751 return;
4753 } 4752 }
4754 4753
4755 // Make sure errors are not shown in view source mode. 4754 // Make sure errors are not shown in view source mode.
4756 frame_->enableViewSourceMode(false); 4755 frame_->enableViewSourceMode(false);
4757 4756
4758 // Replace the current history entry in reloads, history navigations and loads 4757 // Replace the current history entry in reloads, history navigations and loads
4759 // of the same url. This corresponds to Blink's notion of a standard 4758 // of the same url. This corresponds to Blink's notion of a standard
4760 // commit. 4759 // commit.
4761 // TODO(clamy): see if initial commits in subframes should be handled 4760 // TODO(clamy): see if initial commits in subframes should be handled
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
5519 bool is_client_redirect = browser_side_navigation 5518 bool is_client_redirect = browser_side_navigation
5520 ? !!(common_params.transition & 5519 ? !!(common_params.transition &
5521 ui::PAGE_TRANSITION_CLIENT_REDIRECT) 5520 ui::PAGE_TRANSITION_CLIENT_REDIRECT)
5522 : false; 5521 : false;
5523 5522
5524 // Load the request. 5523 // Load the request.
5525 frame_->toWebLocalFrame()->load(request, load_type, 5524 frame_->toWebLocalFrame()->load(request, load_type,
5526 item_for_history_navigation, 5525 item_for_history_navigation,
5527 history_load_type, is_client_redirect); 5526 history_load_type, is_client_redirect);
5528 } 5527 }
5529 } else {
5530 // The browser expects the frame to be loading this navigation. Inform it
5531 // that the load stopped if needed.
5532 if (!frame_->isLoading())
5533 Send(new FrameHostMsg_DidStopLoading(routing_id_));
5534 } 5528 }
5535 5529
5536 // In case LoadRequest failed before didCreateDataSource was called. 5530 // In case LoadRequest failed before didCreateDataSource was called.
5537 pending_navigation_params_.reset(); 5531 pending_navigation_params_.reset();
5538 } 5532 }
5539 5533
5540 void RenderFrameImpl::UpdateEncoding(WebFrame* frame, 5534 void RenderFrameImpl::UpdateEncoding(WebFrame* frame,
5541 const std::string& encoding_name) { 5535 const std::string& encoding_name) {
5542 // Only update main frame's encoding_name. 5536 // Only update main frame's encoding_name.
5543 if (!frame->parent()) 5537 if (!frame->parent())
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
6137 int match_count, 6131 int match_count,
6138 int ordinal, 6132 int ordinal,
6139 const WebRect& selection_rect, 6133 const WebRect& selection_rect,
6140 bool final_status_update) { 6134 bool final_status_update) {
6141 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6135 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6142 selection_rect, ordinal, 6136 selection_rect, ordinal,
6143 final_status_update)); 6137 final_status_update));
6144 } 6138 }
6145 6139
6146 } // namespace content 6140 } // namespace content
OLDNEW
« no previous file with comments | « content/common/frame_messages.h ('k') | content/test/test_web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698