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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 1693563002: PROTOTYPE: PlzNavigate: use a Mojo data pipe to stream navigation data to the renderer. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Browser sends URLRequest id to the renderer and renderer uses intermediary buffer for data: none he… Created 4 years, 8 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/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 render_frame_host->frame_tree_node()->frame_tree_node_id()); 417 render_frame_host->frame_tree_node()->frame_tree_node_id());
418 418
419 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry, 419 return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry,
420 *entry, NavigationControllerImpl::NO_RELOAD, false, 420 *entry, NavigationControllerImpl::NO_RELOAD, false,
421 false); 421 false);
422 } 422 }
423 423
424 void NavigatorImpl::DidNavigate( 424 void NavigatorImpl::DidNavigate(
425 RenderFrameHostImpl* render_frame_host, 425 RenderFrameHostImpl* render_frame_host,
426 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { 426 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
427 LOG(ERROR) << "NavigatorImpl::DidNavigate frame_tree_node_id: "
428 << render_frame_host->frame_tree_node()->frame_tree_node_id();
427 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); 429 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree();
428 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible(); 430 bool oopifs_possible = SiteIsolationPolicy::AreCrossProcessFramesPossible();
429 431
430 bool has_embedded_credentials = 432 bool has_embedded_credentials =
431 params.url.has_username() || params.url.has_password(); 433 params.url.has_username() || params.url.has_password();
432 UMA_HISTOGRAM_BOOLEAN("Navigation.FrameHasEmbeddedCredentials", 434 UMA_HISTOGRAM_BOOLEAN("Navigation.FrameHasEmbeddedCredentials",
433 has_embedded_credentials); 435 has_embedded_credentials);
434 436
435 bool is_navigation_within_page = controller_->IsURLInPageNavigation( 437 bool is_navigation_within_page = controller_->IsURLInPageNavigation(
436 params.url, params.was_within_same_page, render_frame_host); 438 params.url, params.was_within_same_page, render_frame_host);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 // For main frames, NavigationHandle will be created after the call to 819 // For main frames, NavigationHandle will be created after the call to
818 // |DidStartMainFrameNavigation|, so it receives the most up to date pending 820 // |DidStartMainFrameNavigation|, so it receives the most up to date pending
819 // entry from the NavigationController. 821 // entry from the NavigationController.
820 NavigationEntry* pending_entry = controller_->GetPendingEntry(); 822 NavigationEntry* pending_entry = controller_->GetPendingEntry();
821 navigation_request->CreateNavigationHandle( 823 navigation_request->CreateNavigationHandle(
822 pending_entry ? pending_entry->GetUniqueID() : 0); 824 pending_entry ? pending_entry->GetUniqueID() : 0);
823 navigation_request->BeginNavigation(); 825 navigation_request->BeginNavigation();
824 } 826 }
825 827
826 // PlzNavigate 828 // PlzNavigate
827 void NavigatorImpl::CommitNavigation(NavigationRequest* navigation_request, 829 void NavigatorImpl::CommitNavigation(
828 ResourceResponse* response, 830 NavigationRequest* navigation_request,
829 scoped_ptr<StreamHandle> body) { 831 ResourceResponse* response,
832 mojo::ScopedDataPipeConsumerHandle data_consumer_handle,
833 int request_id) {
830 CHECK(IsBrowserSideNavigationEnabled()); 834 CHECK(IsBrowserSideNavigationEnabled());
831 835
832 DCHECK(navigation_request); 836 DCHECK(navigation_request);
833 FrameTreeNode* frame_tree_node = navigation_request->frame_tree_node(); 837 FrameTreeNode* frame_tree_node = navigation_request->frame_tree_node();
834 DCHECK(frame_tree_node); 838 DCHECK(frame_tree_node);
835 DCHECK(response || 839 DCHECK(response ||
836 !ShouldMakeNetworkRequestForURL( 840 !ShouldMakeNetworkRequestForURL(
837 navigation_request->common_params().url)); 841 navigation_request->common_params().url));
838 842
839 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not 843 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not
(...skipping 20 matching lines...) Expand all
860 new ViewMsg_EnableViewSourceMode( 864 new ViewMsg_EnableViewSourceMode(
861 render_frame_host->render_view_host()->GetRoutingID())); 865 render_frame_host->render_view_host()->GetRoutingID()));
862 } 866 }
863 867
864 CheckWebUIRendererDoesNotDisplayNormalURL( 868 CheckWebUIRendererDoesNotDisplayNormalURL(
865 render_frame_host, navigation_request->common_params().url); 869 render_frame_host, navigation_request->common_params().url);
866 870
867 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 871 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
868 render_frame_host->navigation_handle()->ReadyToCommitNavigation( 872 render_frame_host->navigation_handle()->ReadyToCommitNavigation(
869 render_frame_host, response ? response->head.headers : nullptr); 873 render_frame_host, response ? response->head.headers : nullptr);
870 render_frame_host->CommitNavigation(response, std::move(body), 874 render_frame_host->CommitNavigation(
871 navigation_request->common_params(), 875 response, navigation_request->common_params(),
872 navigation_request->request_params()); 876 navigation_request->request_params(), std::move(data_consumer_handle),
877 request_id);
873 } 878 }
874 879
875 // PlzNavigate 880 // PlzNavigate
876 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, 881 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node,
877 bool has_stale_copy_in_cache, 882 bool has_stale_copy_in_cache,
878 int error_code) { 883 int error_code) {
879 CHECK(IsBrowserSideNavigationEnabled()); 884 CHECK(IsBrowserSideNavigationEnabled());
880 885
881 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); 886 NavigationRequest* navigation_request = frame_tree_node->navigation_request();
882 DCHECK(navigation_request); 887 DCHECK(navigation_request);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 if (pending_entry != controller_->GetVisibleEntry() || 1136 if (pending_entry != controller_->GetVisibleEntry() ||
1132 !should_preserve_entry) { 1137 !should_preserve_entry) {
1133 controller_->DiscardPendingEntry(true); 1138 controller_->DiscardPendingEntry(true);
1134 1139
1135 // Also force the UI to refresh. 1140 // Also force the UI to refresh.
1136 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1141 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1137 } 1142 }
1138 } 1143 }
1139 1144
1140 } // namespace content 1145 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698