| 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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID()); | 1286 return GlobalFrameRoutingId(GetProcess()->GetID(), GetRoutingID()); |
| 1288 } | 1287 } |
| 1289 | 1288 |
| 1290 int RenderFrameHostImpl::GetEnabledBindings() { | 1289 int RenderFrameHostImpl::GetEnabledBindings() { |
| 1291 return render_view_host_->GetEnabledBindings(); | 1290 return render_view_host_->GetEnabledBindings(); |
| 1292 } | 1291 } |
| 1293 | 1292 |
| 1294 void RenderFrameHostImpl::SetNavigationHandle( | 1293 void RenderFrameHostImpl::SetNavigationHandle( |
| 1295 std::unique_ptr<NavigationHandleImpl> navigation_handle) { | 1294 std::unique_ptr<NavigationHandleImpl> navigation_handle) { |
| 1296 navigation_handle_ = std::move(navigation_handle); | 1295 navigation_handle_ = std::move(navigation_handle); |
| 1297 if (navigation_handle_) | |
| 1298 navigation_handle_->set_render_frame_host(this); | |
| 1299 } | 1296 } |
| 1300 | 1297 |
| 1301 std::unique_ptr<NavigationHandleImpl> | 1298 std::unique_ptr<NavigationHandleImpl> |
| 1302 RenderFrameHostImpl::PassNavigationHandleOwnership() { | 1299 RenderFrameHostImpl::PassNavigationHandleOwnership() { |
| 1303 DCHECK(!IsBrowserSideNavigationEnabled()); | 1300 DCHECK(!IsBrowserSideNavigationEnabled()); |
| 1304 if (navigation_handle_) | 1301 if (navigation_handle_) |
| 1305 navigation_handle_->set_is_transferring(true); | 1302 navigation_handle_->set_is_transferring(true); |
| 1306 return std::move(navigation_handle_); | 1303 return std::move(navigation_handle_); |
| 1307 } | 1304 } |
| 1308 | 1305 |
| 1309 void RenderFrameHostImpl::OnCrossSiteResponse( | |
| 1310 const GlobalRequestID& global_request_id, | |
| 1311 std::unique_ptr<CrossSiteTransferringRequest> | |
| 1312 cross_site_transferring_request, | |
| 1313 const std::vector<GURL>& transfer_url_chain, | |
| 1314 const Referrer& referrer, | |
| 1315 ui::PageTransition page_transition, | |
| 1316 bool should_replace_current_entry) { | |
| 1317 frame_tree_node_->render_manager()->OnCrossSiteResponse( | |
| 1318 this, global_request_id, std::move(cross_site_transferring_request), | |
| 1319 transfer_url_chain, referrer, page_transition, | |
| 1320 should_replace_current_entry); | |
| 1321 } | |
| 1322 | |
| 1323 void RenderFrameHostImpl::SwapOut( | 1306 void RenderFrameHostImpl::SwapOut( |
| 1324 RenderFrameProxyHost* proxy, | 1307 RenderFrameProxyHost* proxy, |
| 1325 bool is_loading) { | 1308 bool is_loading) { |
| 1326 // The end of this event is in OnSwapOutACK when the RenderFrame has completed | 1309 // The end of this event is in OnSwapOutACK when the RenderFrame has completed |
| 1327 // the operation and sends back an IPC message. | 1310 // the operation and sends back an IPC message. |
| 1328 // The trace event may not end properly if the ACK times out. We expect this | 1311 // The trace event may not end properly if the ACK times out. We expect this |
| 1329 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost. | 1312 // to be fixed when RenderViewHostImpl::OnSwapOut moves to RenderFrameHost. |
| 1330 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); | 1313 TRACE_EVENT_ASYNC_BEGIN0("navigation", "RenderFrameHostImpl::SwapOut", this); |
| 1331 | 1314 |
| 1332 // If this RenderFrameHost is already pending deletion, it must have already | 1315 // If this RenderFrameHost is already pending deletion, it must have already |
| (...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3082 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3100 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3083 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3101 return web_bluetooth_service_.get(); | 3084 return web_bluetooth_service_.get(); |
| 3102 } | 3085 } |
| 3103 | 3086 |
| 3104 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3087 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3105 web_bluetooth_service_.reset(); | 3088 web_bluetooth_service_.reset(); |
| 3106 } | 3089 } |
| 3107 | 3090 |
| 3108 } // namespace content | 3091 } // namespace content |
| OLD | NEW |