| 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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", | 809 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", |
| 810 base::TimeTicks::Now() - ui_timestamp, | 810 base::TimeTicks::Now() - ui_timestamp, |
| 811 base::TimeDelta::FromMilliseconds(10), | 811 base::TimeDelta::FromMilliseconds(10), |
| 812 base::TimeDelta::FromMinutes(10), 100); | 812 base::TimeDelta::FromMinutes(10), 100); |
| 813 } | 813 } |
| 814 // This message is only sent for top-level frames. TODO(avi): when frame tree | 814 // This message is only sent for top-level frames. TODO(avi): when frame tree |
| 815 // mirroring works correctly, add a check here to enforce it. | 815 // mirroring works correctly, add a check here to enforce it. |
| 816 delegate_->DocumentOnLoadCompleted(this); | 816 delegate_->DocumentOnLoadCompleted(this); |
| 817 } | 817 } |
| 818 | 818 |
| 819 void RenderFrameHostImpl::OnDidStartProvisionalLoad(const GURL& url) { | 819 void RenderFrameHostImpl::OnDidStartProvisionalLoad( |
| 820 frame_tree_node_->navigator()->DidStartProvisionalLoad( | 820 const GURL& url, |
| 821 this, url); | 821 const base::TimeTicks& navigation_start) { |
| 822 frame_tree_node_->navigator()->DidStartProvisionalLoad(this, url, |
| 823 navigation_start); |
| 822 } | 824 } |
| 823 | 825 |
| 824 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( | 826 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
| 825 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 827 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 826 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 828 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 827 switches::kEnableBrowserSideNavigation) && | 829 switches::kEnableBrowserSideNavigation) && |
| 828 navigation_handle_) { | 830 navigation_handle_) { |
| 829 navigation_handle_->set_net_error_code( | 831 navigation_handle_->set_net_error_code( |
| 830 static_cast<net::Error>(params.error_code)); | 832 static_cast<net::Error>(params.error_code)); |
| 831 } | 833 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 if (navigation_handle_ && | 953 if (navigation_handle_ && |
| 952 navigation_handle_->GetURL() != validated_params.url) { | 954 navigation_handle_->GetURL() != validated_params.url) { |
| 953 navigation_handle_.reset(); | 955 navigation_handle_.reset(); |
| 954 } | 956 } |
| 955 | 957 |
| 956 // Synchronous renderer-initiated navigations will send a | 958 // Synchronous renderer-initiated navigations will send a |
| 957 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad | 959 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad |
| 958 // message. | 960 // message. |
| 959 if (!navigation_handle_) { | 961 if (!navigation_handle_) { |
| 960 navigation_handle_ = NavigationHandleImpl::Create( | 962 navigation_handle_ = NavigationHandleImpl::Create( |
| 961 validated_params.url, frame_tree_node_); | 963 validated_params.url, frame_tree_node_, base::TimeTicks::Now()); |
| 962 } | 964 } |
| 963 | 965 |
| 964 accessibility_reset_count_ = 0; | 966 accessibility_reset_count_ = 0; |
| 965 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 967 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
| 966 | 968 |
| 967 // For a top-level frame, there are potential security concerns associated | 969 // For a top-level frame, there are potential security concerns associated |
| 968 // with displaying graphics from a previously loaded page after the URL in | 970 // with displaying graphics from a previously loaded page after the URL in |
| 969 // the omnibar has been changed. It is unappealing to clear the page | 971 // the omnibar has been changed. It is unappealing to clear the page |
| 970 // immediately, but if the renderer is taking a long time to issue any | 972 // immediately, but if the renderer is taking a long time to issue any |
| 971 // compositor output (possibly because of script deliberately creating this | 973 // compositor output (possibly because of script deliberately creating this |
| (...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2376 *dst = src; | 2378 *dst = src; |
| 2377 | 2379 |
| 2378 if (src.routing_id != -1) | 2380 if (src.routing_id != -1) |
| 2379 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2381 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2380 | 2382 |
| 2381 if (src.parent_routing_id != -1) | 2383 if (src.parent_routing_id != -1) |
| 2382 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2384 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2383 } | 2385 } |
| 2384 | 2386 |
| 2385 } // namespace content | 2387 } // namespace content |
| OLD | NEW |