OLD | NEW |
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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", | 784 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", |
785 base::TimeTicks::Now() - ui_timestamp, | 785 base::TimeTicks::Now() - ui_timestamp, |
786 base::TimeDelta::FromMilliseconds(10), | 786 base::TimeDelta::FromMilliseconds(10), |
787 base::TimeDelta::FromMinutes(10), 100); | 787 base::TimeDelta::FromMinutes(10), 100); |
788 } | 788 } |
789 // This message is only sent for top-level frames. TODO(avi): when frame tree | 789 // This message is only sent for top-level frames. TODO(avi): when frame tree |
790 // mirroring works correctly, add a check here to enforce it. | 790 // mirroring works correctly, add a check here to enforce it. |
791 delegate_->DocumentOnLoadCompleted(this); | 791 delegate_->DocumentOnLoadCompleted(this); |
792 } | 792 } |
793 | 793 |
794 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(const GURL& url) { | 794 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( |
| 795 const GURL& url, double navigation_start) { |
795 frame_tree_node_->navigator()->DidStartProvisionalLoad( | 796 frame_tree_node_->navigator()->DidStartProvisionalLoad( |
796 this, url); | 797 this, url, navigation_start); |
797 } | 798 } |
798 | 799 |
799 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 800 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
800 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 801 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
801 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 802 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
802 switches::kEnableBrowserSideNavigation) && | 803 switches::kEnableBrowserSideNavigation) && |
803 navigation_handle_) { | 804 navigation_handle_) { |
804 navigation_handle_->set_net_error_code( | 805 navigation_handle_->set_net_error_code( |
805 static_cast<net::Error>(params.error_code)); | 806 static_cast<net::Error>(params.error_code)); |
806 } | 807 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 // navigation. | 926 // navigation. |
926 if (navigation_handle_ && | 927 if (navigation_handle_ && |
927 navigation_handle_->GetURL() != validated_params.url) { | 928 navigation_handle_->GetURL() != validated_params.url) { |
928 navigation_handle_.reset(); | 929 navigation_handle_.reset(); |
929 } | 930 } |
930 | 931 |
931 // Synchronous renderer-initiated navigations will send a | 932 // Synchronous renderer-initiated navigations will send a |
932 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 933 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
933 // message. | 934 // message. |
934 if (!navigation_handle_) { | 935 if (!navigation_handle_) { |
| 936 double navigation_start_seconds = |
| 937 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
935 navigation_handle_ = NavigationHandleImpl::Create( | 938 navigation_handle_ = NavigationHandleImpl::Create( |
936 validated_params.url, frame_tree_node_); | 939 validated_params.url, frame_tree_node_, navigation_start_seconds); |
937 } | 940 } |
938 | 941 |
939 accessibility_reset_count_ = 0; | 942 accessibility_reset_count_ = 0; |
940 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 943 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
941 | 944 |
942 // For a top-level frame, there are potential security concerns associated | 945 // For a top-level frame, there are potential security concerns associated |
943 // with displaying graphics from a previously loaded page after the URL in | 946 // with displaying graphics from a previously loaded page after the URL in |
944 // the omnibar has been changed. It is unappealing to clear the page | 947 // the omnibar has been changed. It is unappealing to clear the page |
945 // immediately, but if the renderer is taking a long time to issue any | 948 // immediately, but if the renderer is taking a long time to issue any |
946 // compositor output (possibly because of script deliberately creating this | 949 // compositor output (possibly because of script deliberately creating this |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 *dst = src; | 2296 *dst = src; |
2294 | 2297 |
2295 if (src.routing_id != -1) | 2298 if (src.routing_id != -1) |
2296 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2299 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
2297 | 2300 |
2298 if (src.parent_routing_id != -1) | 2301 if (src.parent_routing_id != -1) |
2299 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2302 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
2300 } | 2303 } |
2301 | 2304 |
2302 } // namespace content | 2305 } // namespace content |
OLD | NEW |