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

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

Issue 1608283002: PlzNavigate: Use WebNavigationPolicyHandledByClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@change-did-start-loading-logic
Patch Set: Rebase + addressed comments 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
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 4649 matching lines...) Expand 10 before | Expand all | Expand 10 after
4660 4660
4661 // If we end up reusing this WebRequest (for example, due to a #ref click), 4661 // If we end up reusing this WebRequest (for example, due to a #ref click),
4662 // we don't want the transition type to persist. Just clear it. 4662 // we don't want the transition type to persist. Just clear it.
4663 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); 4663 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK);
4664 } 4664 }
4665 4665
4666 void RenderFrameImpl::didStartLoading(bool to_different_document) { 4666 void RenderFrameImpl::didStartLoading(bool to_different_document) {
4667 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading", 4667 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading",
4668 "id", routing_id_); 4668 "id", routing_id_);
4669 render_view_->FrameDidStartLoading(frame_); 4669 render_view_->FrameDidStartLoading(frame_);
4670 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); 4670
4671 // PlzNavigate: the browser is responsible for knowing the start of all
4672 // non-synchronous navigations.
4673 if (!IsBrowserSideNavigationEnabled() || !to_different_document)
4674 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document));
4671 } 4675 }
4672 4676
4673 void RenderFrameImpl::didStopLoading() { 4677 void RenderFrameImpl::didStopLoading() {
4674 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading", 4678 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading",
4675 "id", routing_id_); 4679 "id", routing_id_);
4676 render_view_->FrameDidStopLoading(frame_); 4680 render_view_->FrameDidStopLoading(frame_);
4677 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 4681 Send(new FrameHostMsg_DidStopLoading(routing_id_));
4678 } 4682 }
4679 4683
4680 void RenderFrameImpl::didChangeLoadProgress(double load_progress) { 4684 void RenderFrameImpl::didChangeLoadProgress(double load_progress) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
4956 return blink::WebNavigationPolicyIgnore; 4960 return blink::WebNavigationPolicyIgnore;
4957 } 4961 }
4958 4962
4959 // PlzNavigate: if the navigation is not synchronous, send it to the browser. 4963 // PlzNavigate: if the navigation is not synchronous, send it to the browser.
4960 // This includes navigations with no request being sent to the network stack. 4964 // This includes navigations with no request being sent to the network stack.
4961 if (IsBrowserSideNavigationEnabled() && 4965 if (IsBrowserSideNavigationEnabled() &&
4962 info.urlRequest.checkForBrowserSideNavigation() && 4966 info.urlRequest.checkForBrowserSideNavigation() &&
4963 ShouldMakeNetworkRequestForURL(url)) { 4967 ShouldMakeNetworkRequestForURL(url)) {
4964 BeginNavigation(&info.urlRequest, info.replacesCurrentHistoryItem, 4968 BeginNavigation(&info.urlRequest, info.replacesCurrentHistoryItem,
4965 info.isClientRedirect); 4969 info.isClientRedirect);
4966 return blink::WebNavigationPolicyIgnore; 4970 return blink::WebNavigationPolicyHandledByClient;
4967 } 4971 }
4968 4972
4969 return info.defaultPolicy; 4973 return info.defaultPolicy;
4970 } 4974 }
4971 4975
4972 void RenderFrameImpl::OnGetSavableResourceLinks() { 4976 void RenderFrameImpl::OnGetSavableResourceLinks() {
4973 std::vector<GURL> resources_list; 4977 std::vector<GURL> resources_list;
4974 std::vector<SavableSubframe> subframes; 4978 std::vector<SavableSubframe> subframes;
4975 SavableResourcesResult result(&resources_list, &subframes); 4979 SavableResourcesResult result(&resources_list, &subframes);
4976 4980
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
6137 int match_count, 6141 int match_count,
6138 int ordinal, 6142 int ordinal,
6139 const WebRect& selection_rect, 6143 const WebRect& selection_rect,
6140 bool final_status_update) { 6144 bool final_status_update) {
6141 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6145 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6142 selection_rect, ordinal, 6146 selection_rect, ordinal,
6143 final_status_update)); 6147 final_status_update));
6144 } 6148 }
6145 6149
6146 } // namespace content 6150 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698