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/browser_main_loop.h" |
23 #include "content/browser/child_process_security_policy_impl.h" | 24 #include "content/browser/child_process_security_policy_impl.h" |
24 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 25 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
25 #include "content/browser/download/mhtml_generation_manager.h" | 26 #include "content/browser/download/mhtml_generation_manager.h" |
26 #include "content/browser/frame_host/cross_process_frame_connector.h" | 27 #include "content/browser/frame_host/cross_process_frame_connector.h" |
27 #include "content/browser/frame_host/frame_tree.h" | 28 #include "content/browser/frame_host/frame_tree.h" |
28 #include "content/browser/frame_host/frame_tree_node.h" | 29 #include "content/browser/frame_host/frame_tree_node.h" |
29 #include "content/browser/frame_host/navigation_entry_impl.h" | 30 #include "content/browser/frame_host/navigation_entry_impl.h" |
30 #include "content/browser/frame_host/navigation_handle_impl.h" | 31 #include "content/browser/frame_host/navigation_handle_impl.h" |
31 #include "content/browser/frame_host/navigation_request.h" | 32 #include "content/browser/frame_host/navigation_request.h" |
32 #include "content/browser/frame_host/navigator.h" | 33 #include "content/browser/frame_host/navigator.h" |
33 #include "content/browser/frame_host/navigator_impl.h" | 34 #include "content/browser/frame_host/navigator_impl.h" |
34 #include "content/browser/frame_host/render_frame_host_delegate.h" | 35 #include "content/browser/frame_host/render_frame_host_delegate.h" |
35 #include "content/browser/frame_host/render_frame_proxy_host.h" | 36 #include "content/browser/frame_host/render_frame_proxy_host.h" |
36 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
37 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 38 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
38 #include "content/browser/permissions/permission_service_context.h" | 39 #include "content/browser/permissions/permission_service_context.h" |
39 #include "content/browser/permissions/permission_service_impl.h" | 40 #include "content/browser/permissions/permission_service_impl.h" |
40 #include "content/browser/presentation/presentation_service_impl.h" | 41 #include "content/browser/presentation/presentation_service_impl.h" |
41 #include "content/browser/renderer_host/input/input_router_impl.h" | 42 #include "content/browser/renderer_host/input/input_router_impl.h" |
42 #include "content/browser/renderer_host/input/timeout_monitor.h" | 43 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 44 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" |
43 #include "content/browser/renderer_host/render_process_host_impl.h" | 45 #include "content/browser/renderer_host/render_process_host_impl.h" |
44 #include "content/browser/renderer_host/render_view_host_delegate.h" | 46 #include "content/browser/renderer_host/render_view_host_delegate.h" |
45 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 47 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
46 #include "content/browser/renderer_host/render_view_host_impl.h" | 48 #include "content/browser/renderer_host/render_view_host_impl.h" |
47 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 49 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
48 #include "content/browser/renderer_host/render_widget_host_impl.h" | 50 #include "content/browser/renderer_host/render_widget_host_impl.h" |
49 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 51 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
50 #include "content/browser/shared_worker/shared_worker_service_impl.h" | 52 #include "content/browser/shared_worker/shared_worker_service_impl.h" |
51 #include "content/browser/wake_lock/wake_lock_service_context.h" | 53 #include "content/browser/wake_lock/wake_lock_service_context.h" |
52 #include "content/browser/websockets/websocket_manager.h" | 54 #include "content/browser/websockets/websocket_manager.h" |
(...skipping 11 matching lines...) Expand all Loading... |
64 #include "content/public/browser/ax_event_notification_details.h" | 66 #include "content/public/browser/ax_event_notification_details.h" |
65 #include "content/public/browser/browser_accessibility_state.h" | 67 #include "content/public/browser/browser_accessibility_state.h" |
66 #include "content/public/browser/browser_context.h" | 68 #include "content/public/browser/browser_context.h" |
67 #include "content/public/browser/browser_plugin_guest_manager.h" | 69 #include "content/public/browser/browser_plugin_guest_manager.h" |
68 #include "content/public/browser/browser_thread.h" | 70 #include "content/public/browser/browser_thread.h" |
69 #include "content/public/browser/content_browser_client.h" | 71 #include "content/public/browser/content_browser_client.h" |
70 #include "content/public/browser/permission_manager.h" | 72 #include "content/public/browser/permission_manager.h" |
71 #include "content/public/browser/permission_type.h" | 73 #include "content/public/browser/permission_type.h" |
72 #include "content/public/browser/render_process_host.h" | 74 #include "content/public/browser/render_process_host.h" |
73 #include "content/public/browser/render_widget_host_view.h" | 75 #include "content/public/browser/render_widget_host_view.h" |
| 76 #include "content/public/browser/resource_context.h" |
74 #include "content/public/browser/storage_partition.h" | 77 #include "content/public/browser/storage_partition.h" |
75 #include "content/public/browser/stream_handle.h" | 78 #include "content/public/browser/stream_handle.h" |
76 #include "content/public/browser/user_metrics.h" | 79 #include "content/public/browser/user_metrics.h" |
77 #include "content/public/common/browser_side_navigation_policy.h" | 80 #include "content/public/common/browser_side_navigation_policy.h" |
78 #include "content/public/common/content_constants.h" | 81 #include "content/public/common/content_constants.h" |
79 #include "content/public/common/content_switches.h" | 82 #include "content/public/common/content_switches.h" |
80 #include "content/public/common/file_chooser_file_info.h" | 83 #include "content/public/common/file_chooser_file_info.h" |
81 #include "content/public/common/file_chooser_params.h" | 84 #include "content/public/common/file_chooser_params.h" |
82 #include "content/public/common/isolated_world_ids.h" | 85 #include "content/public/common/isolated_world_ids.h" |
83 #include "content/public/common/mojo_shell_connection.h" | 86 #include "content/public/common/mojo_shell_connection.h" |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 base::Bind(&device::VRServiceImpl::BindRequest)); | 2188 base::Bind(&device::VRServiceImpl::BindRequest)); |
2186 } | 2189 } |
2187 #endif | 2190 #endif |
2188 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2191 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
2189 switches::kEnableGenericSensors)) { | 2192 switches::kEnableGenericSensors)) { |
2190 GetInterfaceRegistry()->AddInterface( | 2193 GetInterfaceRegistry()->AddInterface( |
2191 base::Bind(&device::SensorProviderImpl::Create), | 2194 base::Bind(&device::SensorProviderImpl::Create), |
2192 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 2195 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
2193 } | 2196 } |
2194 | 2197 |
| 2198 #if defined(ENABLE_WEBRTC) |
| 2199 MediaStreamManager* media_stream_manager = |
| 2200 BrowserMainLoop::GetInstance()->media_stream_manager(); |
| 2201 GetInterfaceRegistry()->AddInterface( |
| 2202 base::Bind(&MediaDevicesDispatcherHost::Create, GetProcess()->GetID(), |
| 2203 GetRoutingID(), GetProcess() |
| 2204 ->GetBrowserContext() |
| 2205 ->GetResourceContext() |
| 2206 ->GetMediaDeviceIDSalt(), |
| 2207 base::Unretained(media_stream_manager), |
| 2208 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 2209 switches::kUseFakeUIForMediaStream)), |
| 2210 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 2211 #endif |
| 2212 |
2195 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( | 2213 GetContentClient()->browser()->RegisterRenderFrameMojoInterfaces( |
2196 GetInterfaceRegistry(), this); | 2214 GetInterfaceRegistry(), this); |
2197 } | 2215 } |
2198 | 2216 |
2199 void RenderFrameHostImpl::ResetWaitingState() { | 2217 void RenderFrameHostImpl::ResetWaitingState() { |
2200 DCHECK(is_active()); | 2218 DCHECK(is_active()); |
2201 | 2219 |
2202 // Whenever we reset the RFH state, we should not be waiting for beforeunload | 2220 // Whenever we reset the RFH state, we should not be waiting for beforeunload |
2203 // or close acks. We clear them here to be safe, since they can cause | 2221 // or close acks. We clear them here to be safe, since they can cause |
2204 // navigations to be ignored in OnDidCommitProvisionalLoad. | 2222 // navigations to be ignored in OnDidCommitProvisionalLoad. |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3092 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3110 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
3093 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3111 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
3094 return web_bluetooth_service_.get(); | 3112 return web_bluetooth_service_.get(); |
3095 } | 3113 } |
3096 | 3114 |
3097 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3115 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
3098 web_bluetooth_service_.reset(); | 3116 web_bluetooth_service_.reset(); |
3099 } | 3117 } |
3100 | 3118 |
3101 } // namespace content | 3119 } // namespace content |
OLD | NEW |