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

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

Issue 1427633004: Send navigation_start to the browser in DidStartProvisionalLoad IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation_start_renderer
Patch Set: Comments Created 5 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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", 797 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent",
798 base::TimeTicks::Now() - ui_timestamp, 798 base::TimeTicks::Now() - ui_timestamp,
799 base::TimeDelta::FromMilliseconds(10), 799 base::TimeDelta::FromMilliseconds(10),
800 base::TimeDelta::FromMinutes(10), 100); 800 base::TimeDelta::FromMinutes(10), 100);
801 } 801 }
802 // This message is only sent for top-level frames. TODO(avi): when frame tree 802 // This message is only sent for top-level frames. TODO(avi): when frame tree
803 // mirroring works correctly, add a check here to enforce it. 803 // mirroring works correctly, add a check here to enforce it.
804 delegate_->DocumentOnLoadCompleted(this); 804 delegate_->DocumentOnLoadCompleted(this);
805 } 805 }
806 806
807 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(const GURL& url) { 807 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(
808 frame_tree_node_->navigator()->DidStartProvisionalLoad( 808 const GURL& url,
809 this, url); 809 const base::TimeTicks& navigation_start) {
810 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url,
811 navigation_start);
810 } 812 }
811 813
812 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( 814 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
813 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { 815 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
814 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 816 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
815 switches::kEnableBrowserSideNavigation) && 817 switches::kEnableBrowserSideNavigation) &&
816 navigation_handle_) { 818 navigation_handle_) {
817 navigation_handle_->set_net_error_code( 819 navigation_handle_->set_net_error_code(
818 static_cast<net::Error>(params.error_code)); 820 static_cast<net::Error>(params.error_code));
819 } 821 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 if (navigation_handle_ && 941 if (navigation_handle_ &&
940 navigation_handle_->GetURL() != validated_params.url) { 942 navigation_handle_->GetURL() != validated_params.url) {
941 navigation_handle_.reset(); 943 navigation_handle_.reset();
942 } 944 }
943 945
944 // Synchronous renderer-initiated navigations will send a 946 // Synchronous renderer-initiated navigations will send a
945 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad 947 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad
946 // message. 948 // message.
947 if (!navigation_handle_) { 949 if (!navigation_handle_) {
948 navigation_handle_ = NavigationHandleImpl::Create( 950 navigation_handle_ = NavigationHandleImpl::Create(
949 validated_params.url, frame_tree_node_); 951 validated_params.url, frame_tree_node_, base::TimeTicks::Now());
nasko 2015/11/13 21:52:54 Why not the actual start time from the renderer pr
Charlie Harrison 2015/11/14 00:25:00 We discussed this briefly over email, but I think
950 } 952 }
951 953
952 accessibility_reset_count_ = 0; 954 accessibility_reset_count_ = 0;
953 frame_tree_node()->navigator()->DidNavigate(this, validated_params); 955 frame_tree_node()->navigator()->DidNavigate(this, validated_params);
954 956
955 // For a top-level frame, there are potential security concerns associated 957 // For a top-level frame, there are potential security concerns associated
956 // with displaying graphics from a previously loaded page after the URL in 958 // with displaying graphics from a previously loaded page after the URL in
957 // the omnibar has been changed. It is unappealing to clear the page 959 // the omnibar has been changed. It is unappealing to clear the page
958 // immediately, but if the renderer is taking a long time to issue any 960 // immediately, but if the renderer is taking a long time to issue any
959 // compositor output (possibly because of script deliberately creating this 961 // compositor output (possibly because of script deliberately creating this
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2424 if (src.parent_routing_id != -1) 2426 if (src.parent_routing_id != -1)
2425 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2427 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2426 } 2428 }
2427 2429
2428 void RenderFrameHostImpl::ResetWebUI() { 2430 void RenderFrameHostImpl::ResetWebUI() {
2429 web_ui_type_ = WebUI::kNoWebUI; 2431 web_ui_type_ = WebUI::kNoWebUI;
2430 web_ui_.reset(); 2432 web_ui_.reset();
2431 } 2433 }
2432 2434
2433 } // namespace content 2435 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698