| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", | 790 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", |
| 791 base::TimeTicks::Now() - ui_timestamp, | 791 base::TimeTicks::Now() - ui_timestamp, |
| 792 base::TimeDelta::FromMilliseconds(10), | 792 base::TimeDelta::FromMilliseconds(10), |
| 793 base::TimeDelta::FromMinutes(10), 100); | 793 base::TimeDelta::FromMinutes(10), 100); |
| 794 } | 794 } |
| 795 // This message is only sent for top-level frames. TODO(avi): when frame tree | 795 // This message is only sent for top-level frames. TODO(avi): when frame tree |
| 796 // mirroring works correctly, add a check here to enforce it. | 796 // mirroring works correctly, add a check here to enforce it. |
| 797 delegate_->DocumentOnLoadCompleted(this); | 797 delegate_->DocumentOnLoadCompleted(this); |
| 798 } | 798 } |
| 799 | 799 |
| 800 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame(const GURL& url) { | 800 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( |
| 801 frame_tree_node_->navigator()->DidStartProvisionalLoad( | 801 const GURL& url, |
| 802 this, url); | 802 const base::TimeTicks& navigation_start) { |
| 803 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, |
| 804 navigation_start); |
| 803 } | 805 } |
| 804 | 806 |
| 805 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 807 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
| 806 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 808 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 807 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 809 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 808 switches::kEnableBrowserSideNavigation) && | 810 switches::kEnableBrowserSideNavigation) && |
| 809 navigation_handle_) { | 811 navigation_handle_) { |
| 810 navigation_handle_->set_net_error_code( | 812 navigation_handle_->set_net_error_code( |
| 811 static_cast<net::Error>(params.error_code)); | 813 static_cast<net::Error>(params.error_code)); |
| 812 } | 814 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 if (navigation_handle_ && | 934 if (navigation_handle_ && |
| 933 navigation_handle_->GetURL() != validated_params.url) { | 935 navigation_handle_->GetURL() != validated_params.url) { |
| 934 navigation_handle_.reset(); | 936 navigation_handle_.reset(); |
| 935 } | 937 } |
| 936 | 938 |
| 937 // Synchronous renderer-initiated navigations will send a | 939 // Synchronous renderer-initiated navigations will send a |
| 938 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 940 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
| 939 // message. | 941 // message. |
| 940 if (!navigation_handle_) { | 942 if (!navigation_handle_) { |
| 941 navigation_handle_ = NavigationHandleImpl::Create( | 943 navigation_handle_ = NavigationHandleImpl::Create( |
| 942 validated_params.url, frame_tree_node_); | 944 validated_params.url, frame_tree_node_, base::TimeTicks::Now()); |
| 943 } | 945 } |
| 944 | 946 |
| 945 accessibility_reset_count_ = 0; | 947 accessibility_reset_count_ = 0; |
| 946 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 948 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
| 947 | 949 |
| 948 // For a top-level frame, there are potential security concerns associated | 950 // For a top-level frame, there are potential security concerns associated |
| 949 // with displaying graphics from a previously loaded page after the URL in | 951 // with displaying graphics from a previously loaded page after the URL in |
| 950 // the omnibar has been changed. It is unappealing to clear the page | 952 // the omnibar has been changed. It is unappealing to clear the page |
| 951 // immediately, but if the renderer is taking a long time to issue any | 953 // immediately, but if the renderer is taking a long time to issue any |
| 952 // compositor output (possibly because of script deliberately creating this | 954 // compositor output (possibly because of script deliberately creating this |
| (...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 *dst = src; | 2356 *dst = src; |
| 2355 | 2357 |
| 2356 if (src.routing_id != -1) | 2358 if (src.routing_id != -1) |
| 2357 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2359 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2358 | 2360 |
| 2359 if (src.parent_routing_id != -1) | 2361 if (src.parent_routing_id != -1) |
| 2360 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2362 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2361 } | 2363 } |
| 2362 | 2364 |
| 2363 } // namespace content | 2365 } // namespace content |
| OLD | NEW |