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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
15 #include "base/process/kill.h" | 15 #include "base/process/kill.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "content/browser/accessibility/accessibility_mode_helper.h" | 18 #include "content/browser/accessibility/accessibility_mode_helper.h" |
19 #include "content/browser/accessibility/ax_tree_id_registry.h" | 19 #include "content/browser/accessibility/ax_tree_id_registry.h" |
20 #include "content/browser/accessibility/browser_accessibility_manager.h" | 20 #include "content/browser/accessibility/browser_accessibility_manager.h" |
21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 21 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
22 #include "content/browser/bluetooth/web_bluetooth_service_impl.h" | 22 #include "content/browser/bluetooth/web_bluetooth_service_impl.h" |
23 #include "content/browser/child_process_security_policy_impl.h" | 23 #include "content/browser/child_process_security_policy_impl.h" |
24 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 24 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
25 #include "content/browser/download/mhtml_generation_manager.h" | 25 #include "content/browser/download/mhtml_generation_manager.h" |
26 #include "content/browser/frame_host/cross_process_frame_connector.h" | 26 #include "content/browser/frame_host/cross_process_frame_connector.h" |
27 #include "content/browser/frame_host/cross_site_transferring_request.h" | |
28 #include "content/browser/frame_host/frame_tree.h" | 27 #include "content/browser/frame_host/frame_tree.h" |
29 #include "content/browser/frame_host/frame_tree_node.h" | 28 #include "content/browser/frame_host/frame_tree_node.h" |
30 #include "content/browser/frame_host/navigation_entry_impl.h" | 29 #include "content/browser/frame_host/navigation_entry_impl.h" |
31 #include "content/browser/frame_host/navigation_handle_impl.h" | 30 #include "content/browser/frame_host/navigation_handle_impl.h" |
32 #include "content/browser/frame_host/navigation_request.h" | 31 #include "content/browser/frame_host/navigation_request.h" |
33 #include "content/browser/frame_host/navigator.h" | 32 #include "content/browser/frame_host/navigator.h" |
34 #include "content/browser/frame_host/navigator_impl.h" | 33 #include "content/browser/frame_host/navigator_impl.h" |
35 #include "content/browser/frame_host/render_frame_host_delegate.h" | 34 #include "content/browser/frame_host/render_frame_host_delegate.h" |
36 #include "content/browser/frame_host/render_frame_proxy_host.h" | 35 #include "content/browser/frame_host/render_frame_proxy_host.h" |
37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 36 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID()); | 1255 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID()); |
1257 } | 1256 } |
1258 | 1257 |
1259 int RenderFrameHostImpl::GetEnabledBindings() { | 1258 int RenderFrameHostImpl::GetEnabledBindings() { |
1260 return render_view_host_->GetEnabledBindings(); | 1259 return render_view_host_->GetEnabledBindings(); |
1261 } | 1260 } |
1262 | 1261 |
1263 void RenderFrameHostImpl::SetNavigationHandle( | 1262 void RenderFrameHostImpl::SetNavigationHandle( |
1264 std::unique_ptr<NavigationHandleImpl> navigation_handle) { | 1263 std::unique_ptr<NavigationHandleImpl> navigation_handle) { |
1265 navigation_handle_ = std::move(navigation_handle); | 1264 navigation_handle_ = std::move(navigation_handle); |
1266 if (navigation_handle_) | |
1267 navigation_handle_->set_render_frame_host(this); | |
1268 } | 1265 } |
1269 | 1266 |
1270 std::unique_ptr<NavigationHandleImpl> | 1267 std::unique_ptr<NavigationHandleImpl> |
1271 RenderFrameHostImpl::PassNavigationHandleOwnership() { | 1268 RenderFrameHostImpl::PassNavigationHandleOwnership() { |
1272 DCHECK(!IsBrowserSideNavigationEnabled()); | 1269 DCHECK(!IsBrowserSideNavigationEnabled()); |
1273 if (navigation_handle_) | 1270 if (navigation_handle_) |
1274 navigation_handle_->set_is_transferring(true); | 1271 navigation_handle_->set_is_transferring(true); |
1275 return std::move(navigation_handle_); | 1272 return std::move(navigation_handle_); |
1276 } | 1273 } |
1277 | 1274 |
1278 void RenderFrameHostImpl::OnCrossSiteResponse( | |
1279 const GlobalRequestID& global_request_id, | |
1280 std::unique_ptr<CrossSiteTransferringRequest> | |
1281 cross_site_transferring_request, | |
1282 const std::vector<GURL>& transfer_url_chain, | |
1283 const Referrer& referrer, | |
1284 ui::PageTransition page_transition, | |
1285 bool should_replace_current_entry) { | |
1286 frame_tree_node_->render_manager()->OnCrossSiteResponse( | |
1287 this, global_request_id, std::move(cross_site_transferring_request), | |
1288 transfer_url_chain, referrer, page_transition, | |
1289 should_replace_current_entry); | |
1290 } | |
1291 | |
1292 void RenderFrameHostImpl::SwapOut( | 1275 void RenderFrameHostImpl::SwapOut( |
1293 RenderFrameProxyHost* proxy, | 1276 RenderFrameProxyHost* proxy, |
1294 bool is_loading) { | 1277 bool is_loading) { |
1295 // The end of this event is in OnSwapOutACK when the RenderFrame has completed | 1278 // The end of this event is in OnSwapOutACK when the RenderFrame has completed |
1296 // the operation and sends back an IPC message. | 1279 // the operation and sends back an IPC message. |
1297 // The trace event may not end properly if the ACK times out. We expect this | 1280 // The trace event may not end properly if the ACK times out. We expect this |
1298 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost. | 1281 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost. |
1299 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); | 1282 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); |
1300 | 1283 |
1301 // If this RenderFrameHost is already pending deletion, it must have already | 1284 // If this RenderFrameHost is already pending deletion, it must have already |
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3039 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3057 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3040 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3058 return web_bluetooth_service_.get(); | 3041 return web_bluetooth_service_.get(); |
3059 } | 3042 } |
3060 | 3043 |
3061 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3044 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3062 web_bluetooth_service_.reset(); | 3045 web_bluetooth_service_.reset(); |
3063 } | 3046 } |
3064 | 3047 |
3065 } // namespace content | 3048 } // namespace content |
OLD | NEW |