Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1164563003: Extract device_sensors to /device via Mojofication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 29 matching lines...) Expand all
40 #include "content/browser/appcache/chrome_appcache_service.h" 40 #include "content/browser/appcache/chrome_appcache_service.h"
41 #include "content/browser/bad_message.h" 41 #include "content/browser/bad_message.h"
42 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" 42 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h"
43 #include "content/browser/browser_child_process_host_impl.h" 43 #include "content/browser/browser_child_process_host_impl.h"
44 #include "content/browser/browser_main.h" 44 #include "content/browser/browser_main.h"
45 #include "content/browser/browser_main_loop.h" 45 #include "content/browser/browser_main_loop.h"
46 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" 46 #include "content/browser/browser_plugin/browser_plugin_message_filter.h"
47 #include "content/browser/cache_storage/cache_storage_context_impl.h" 47 #include "content/browser/cache_storage/cache_storage_context_impl.h"
48 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" 48 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h"
49 #include "content/browser/child_process_security_policy_impl.h" 49 #include "content/browser/child_process_security_policy_impl.h"
50 #include "content/browser/device_sensors/device_light_message_filter.h"
51 #include "content/browser/device_sensors/device_motion_message_filter.h"
52 #include "content/browser/device_sensors/device_orientation_message_filter.h"
53 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 50 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
54 #include "content/browser/dom_storage/dom_storage_message_filter.h" 51 #include "content/browser/dom_storage/dom_storage_message_filter.h"
55 #include "content/browser/download/mhtml_generation_manager.h" 52 #include "content/browser/download/mhtml_generation_manager.h"
56 #include "content/browser/fileapi/chrome_blob_storage_context.h" 53 #include "content/browser/fileapi/chrome_blob_storage_context.h"
57 #include "content/browser/fileapi/fileapi_message_filter.h" 54 #include "content/browser/fileapi/fileapi_message_filter.h"
58 #include "content/browser/frame_host/render_frame_message_filter.h" 55 #include "content/browser/frame_host/render_frame_message_filter.h"
59 #include "content/browser/geofencing/geofencing_dispatcher_host.h" 56 #include "content/browser/geofencing/geofencing_dispatcher_host.h"
60 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 57 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
61 #include "content/browser/gpu/compositor_util.h" 58 #include "content/browser/gpu/compositor_util.h"
62 #include "content/browser/gpu/gpu_data_manager_impl.h" 59 #include "content/browser/gpu/gpu_data_manager_impl.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 #include "content/public/browser/worker_service.h" 133 #include "content/public/browser/worker_service.h"
137 #include "content/public/common/content_constants.h" 134 #include "content/public/common/content_constants.h"
138 #include "content/public/common/content_switches.h" 135 #include "content/public/common/content_switches.h"
139 #include "content/public/common/mojo_channel_switches.h" 136 #include "content/public/common/mojo_channel_switches.h"
140 #include "content/public/common/process_type.h" 137 #include "content/public/common/process_type.h"
141 #include "content/public/common/resource_type.h" 138 #include "content/public/common/resource_type.h"
142 #include "content/public/common/result_codes.h" 139 #include "content/public/common/result_codes.h"
143 #include "content/public/common/sandboxed_process_launcher_delegate.h" 140 #include "content/public/common/sandboxed_process_launcher_delegate.h"
144 #include "content/public/common/url_constants.h" 141 #include "content/public/common/url_constants.h"
145 #include "device/battery/battery_monitor_impl.h" 142 #include "device/battery/battery_monitor_impl.h"
143 #include "device/device_sensors/device_sensors_light_impl.h"
144 #include "device/device_sensors/device_sensors_motion_impl.h"
145 #include "device/device_sensors/device_sensors_orientation_impl.h"
146 #include "device/vibration/vibration_manager_impl.h" 146 #include "device/vibration/vibration_manager_impl.h"
147 #include "gpu/GLES2/gl2extchromium.h" 147 #include "gpu/GLES2/gl2extchromium.h"
148 #include "gpu/command_buffer/client/gpu_switches.h" 148 #include "gpu/command_buffer/client/gpu_switches.h"
149 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 149 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
150 #include "gpu/command_buffer/service/gpu_switches.h" 150 #include "gpu/command_buffer/service/gpu_switches.h"
151 #include "ipc/ipc_channel.h" 151 #include "ipc/ipc_channel.h"
152 #include "ipc/ipc_logging.h" 152 #include "ipc/ipc_logging.h"
153 #include "ipc/ipc_switches.h" 153 #include "ipc/ipc_switches.h"
154 #include "ipc/mojo/ipc_channel_mojo.h" 154 #include "ipc/mojo/ipc_channel_mojo.h"
155 #include "ipc/mojo/ipc_channel_mojo_host.h" 155 #include "ipc/mojo/ipc_channel_mojo_host.h"
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 GetContentClient()->browser()->CreateQuotaPermissionContext())); 905 GetContentClient()->browser()->CreateQuotaPermissionContext()));
906 906
907 notification_message_filter_ = new NotificationMessageFilter( 907 notification_message_filter_ = new NotificationMessageFilter(
908 GetID(), 908 GetID(),
909 storage_partition_impl_->GetPlatformNotificationContext(), 909 storage_partition_impl_->GetPlatformNotificationContext(),
910 resource_context, 910 resource_context,
911 browser_context); 911 browser_context);
912 AddFilter(notification_message_filter_.get()); 912 AddFilter(notification_message_filter_.get());
913 913
914 AddFilter(new GamepadBrowserMessageFilter()); 914 AddFilter(new GamepadBrowserMessageFilter());
915 AddFilter(new DeviceLightMessageFilter());
916 AddFilter(new DeviceMotionMessageFilter());
917 AddFilter(new DeviceOrientationMessageFilter());
918 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); 915 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
919 AddFilter(new HistogramMessageFilter()); 916 AddFilter(new HistogramMessageFilter());
920 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) 917 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
921 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) 918 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking))
922 AddFilter(new MemoryBenchmarkMessageFilter()); 919 AddFilter(new MemoryBenchmarkMessageFilter());
923 #endif 920 #endif
924 AddFilter(new PushMessagingMessageFilter( 921 AddFilter(new PushMessagingMessageFilter(
925 GetID(), storage_partition_impl_->GetServiceWorkerContext())); 922 GetID(), storage_partition_impl_->GetServiceWorkerContext()));
926 #if defined(OS_ANDROID) 923 #if defined(OS_ANDROID)
927 AddFilter(new ScreenOrientationMessageFilterAndroid()); 924 AddFilter(new ScreenOrientationMessageFilterAndroid());
928 #endif 925 #endif
929 AddFilter(new GeofencingDispatcherHost( 926 AddFilter(new GeofencingDispatcherHost(
930 storage_partition_impl_->GetGeofencingManager())); 927 storage_partition_impl_->GetGeofencingManager()));
931 AddFilter(new NavigatorConnectDispatcherHost( 928 AddFilter(new NavigatorConnectDispatcherHost(
932 storage_partition_impl_->GetNavigatorConnectContext(), 929 storage_partition_impl_->GetNavigatorConnectContext(),
933 message_port_message_filter_.get())); 930 message_port_message_filter_.get()));
934 if (browser_command_line.HasSwitch( 931 if (browser_command_line.HasSwitch(
935 switches::kEnableExperimentalWebPlatformFeatures)) { 932 switches::kEnableExperimentalWebPlatformFeatures)) {
936 AddFilter(new BluetoothDispatcherHost()); 933 AddFilter(new BluetoothDispatcherHost());
937 } 934 }
938 } 935 }
939 936
940 void RenderProcessHostImpl::RegisterMojoServices() { 937 void RenderProcessHostImpl::RegisterMojoServices() {
941 mojo_application_host_->service_registry()->AddService( 938 mojo_application_host_->service_registry()->AddService(
942 base::Bind(&device::BatteryMonitorImpl::Create)); 939 base::Bind(&device::BatteryMonitorImpl::Create));
943 940
944 mojo_application_host_->service_registry()->AddService( 941 mojo_application_host_->service_registry()->AddService(
945 base::Bind(&device::VibrationManagerImpl::Create)); 942 base::Bind(&device::VibrationManagerImpl::Create));
946 943
944 scoped_refptr<base::SingleThreadTaskRunner> io_runner =
945 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
946 mojo_application_host_->service_registry()->AddService(
947 base::Bind(&device::DeviceSensorsMotionImpl::Create, io_runner));
948
949 mojo_application_host_->service_registry()->AddService(
950 base::Bind(&device::DeviceSensorsLightImpl::Create, io_runner));
951
952 mojo_application_host_->service_registry()->AddService(
953 base::Bind(&device::DeviceSensorsOrientationImpl::Create, io_runner));
954
947 mojo_application_host_->service_registry()->AddService( 955 mojo_application_host_->service_registry()->AddService(
948 base::Bind(&PermissionServiceContext::CreateService, 956 base::Bind(&PermissionServiceContext::CreateService,
949 base::Unretained(permission_service_context_.get()))); 957 base::Unretained(permission_service_context_.get())));
950 958
951 #if defined(OS_ANDROID) 959 #if defined(OS_ANDROID)
952 ServiceRegistrarAndroid::RegisterProcessHostServices( 960 ServiceRegistrarAndroid::RegisterProcessHostServices(
953 mojo_application_host_->service_registry_android()); 961 mojo_application_host_->service_registry_android());
954 #endif 962 #endif
955 963
956 GetContentClient()->browser()->OverrideRenderProcessMojoServices( 964 GetContentClient()->browser()->OverrideRenderProcessMojoServices(
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 if (worker_ref_count_ == 0) 2462 if (worker_ref_count_ == 0)
2455 Cleanup(); 2463 Cleanup();
2456 } 2464 }
2457 2465
2458 void RenderProcessHostImpl::GetAudioOutputControllers( 2466 void RenderProcessHostImpl::GetAudioOutputControllers(
2459 const GetAudioOutputControllersCallback& callback) const { 2467 const GetAudioOutputControllersCallback& callback) const {
2460 audio_renderer_host()->GetOutputControllers(callback); 2468 audio_renderer_host()->GetOutputControllers(callback);
2461 } 2469 }
2462 2470
2463 } // namespace content 2471 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/device_sensors/sensor_manager_chromeos_unittest.cc ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698