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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", | 785 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", |
786 base::TimeTicks::Now() - ui_timestamp, | 786 base::TimeTicks::Now() - ui_timestamp, |
787 base::TimeDelta::FromMilliseconds(10), | 787 base::TimeDelta::FromMilliseconds(10), |
788 base::TimeDelta::FromMinutes(10), 100); | 788 base::TimeDelta::FromMinutes(10), 100); |
789 } | 789 } |
790 // This message is only sent for top-level frames. TODO(avi): when frame tree | 790 // This message is only sent for top-level frames. TODO(avi): when frame tree |
791 // mirroring works correctly, add a check here to enforce it. | 791 // mirroring works correctly, add a check here to enforce it. |
792 delegate_->DocumentOnLoadCompleted(this); | 792 delegate_->DocumentOnLoadCompleted(this); |
793 } | 793 } |
794 | 794 |
795 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(const GURL& url) { | 795 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( |
796 frame_tree_node_->navigator()->DidStartProvisionalLoad( | 796 const GURL& url, |
797 this, url); | 797 const base::TimeTicks& navigation_start) { |
| 798 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, |
| 799 navigation_start); |
798 } | 800 } |
799 | 801 |
800 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 802 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
801 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 803 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
802 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 804 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
803 switches::kEnableBrowserSideNavigation) && | 805 switches::kEnableBrowserSideNavigation) && |
804 navigation_handle_) { | 806 navigation_handle_) { |
805 navigation_handle_->set_net_error_code( | 807 navigation_handle_->set_net_error_code( |
806 static_cast<net::Error>(params.error_code)); | 808 static_cast<net::Error>(params.error_code)); |
807 } | 809 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 if (navigation_handle_ && | 929 if (navigation_handle_ && |
928 navigation_handle_->GetURL() != validated_params.url) { | 930 navigation_handle_->GetURL() != validated_params.url) { |
929 navigation_handle_.reset(); | 931 navigation_handle_.reset(); |
930 } | 932 } |
931 | 933 |
932 // Synchronous renderer-initiated navigations will send a | 934 // Synchronous renderer-initiated navigations will send a |
933 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 935 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
934 // message. | 936 // message. |
935 if (!navigation_handle_) { | 937 if (!navigation_handle_) { |
936 navigation_handle_ = NavigationHandleImpl::Create( | 938 navigation_handle_ = NavigationHandleImpl::Create( |
937 validated_params.url, frame_tree_node_); | 939 validated_params.url, frame_tree_node_, base::TimeTicks::Now()); |
938 } | 940 } |
939 | 941 |
940 accessibility_reset_count_ = 0; | 942 accessibility_reset_count_ = 0; |
941 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 943 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
942 | 944 |
943 // For a top-level frame, there are potential security concerns associated | 945 // For a top-level frame, there are potential security concerns associated |
944 // 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 |
945 // 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 |
946 // 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 |
947 // compositor output (possibly because of script deliberately creating this | 949 // compositor output (possibly because of script deliberately creating this |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 *dst = src; | 2310 *dst = src; |
2309 | 2311 |
2310 if (src.routing_id != -1) | 2312 if (src.routing_id != -1) |
2311 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2313 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
2312 | 2314 |
2313 if (src.parent_routing_id != -1) | 2315 if (src.parent_routing_id != -1) |
2314 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2316 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
2315 } | 2317 } |
2316 | 2318 |
2317 } // namespace content | 2319 } // namespace content |
OLD | NEW |