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

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

Issue 583663003: Vibration API : migrate to device/vibration using mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and clean-up Created 6 years 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #include "content/browser/renderer_host/websocket_dispatcher_host.h" 95 #include "content/browser/renderer_host/websocket_dispatcher_host.h"
96 #include "content/browser/resolve_proxy_msg_helper.h" 96 #include "content/browser/resolve_proxy_msg_helper.h"
97 #include "content/browser/service_worker/service_worker_context_wrapper.h" 97 #include "content/browser/service_worker/service_worker_context_wrapper.h"
98 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 98 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
99 #include "content/browser/shared_worker/shared_worker_message_filter.h" 99 #include "content/browser/shared_worker/shared_worker_message_filter.h"
100 #include "content/browser/shared_worker/worker_storage_partition.h" 100 #include "content/browser/shared_worker/worker_storage_partition.h"
101 #include "content/browser/speech/speech_recognition_dispatcher_host.h" 101 #include "content/browser/speech/speech_recognition_dispatcher_host.h"
102 #include "content/browser/storage_partition_impl.h" 102 #include "content/browser/storage_partition_impl.h"
103 #include "content/browser/streams/stream_context.h" 103 #include "content/browser/streams/stream_context.h"
104 #include "content/browser/tracing/trace_message_filter.h" 104 #include "content/browser/tracing/trace_message_filter.h"
105 #include "content/browser/vibration/vibration_message_filter.h"
106 #include "content/browser/webui/web_ui_controller_factory_registry.h" 105 #include "content/browser/webui/web_ui_controller_factory_registry.h"
107 #include "content/common/child_process_host_impl.h" 106 #include "content/common/child_process_host_impl.h"
108 #include "content/common/child_process_messages.h" 107 #include "content/common/child_process_messages.h"
109 #include "content/common/content_switches_internal.h" 108 #include "content/common/content_switches_internal.h"
110 #include "content/common/gpu/gpu_memory_buffer_factory.h" 109 #include "content/common/gpu/gpu_memory_buffer_factory.h"
111 #include "content/common/gpu/gpu_messages.h" 110 #include "content/common/gpu/gpu_messages.h"
112 #include "content/common/mojo/mojo_messages.h" 111 #include "content/common/mojo/mojo_messages.h"
113 #include "content/common/resource_messages.h" 112 #include "content/common/resource_messages.h"
114 #include "content/common/view_messages.h" 113 #include "content/common/view_messages.h"
115 #include "content/public/browser/browser_context.h" 114 #include "content/public/browser/browser_context.h"
116 #include "content/public/browser/content_browser_client.h" 115 #include "content/public/browser/content_browser_client.h"
117 #include "content/public/browser/notification_service.h" 116 #include "content/public/browser/notification_service.h"
118 #include "content/public/browser/notification_types.h" 117 #include "content/public/browser/notification_types.h"
119 #include "content/public/browser/render_process_host_factory.h" 118 #include "content/public/browser/render_process_host_factory.h"
120 #include "content/public/browser/render_process_host_observer.h" 119 #include "content/public/browser/render_process_host_observer.h"
121 #include "content/public/browser/render_widget_host.h" 120 #include "content/public/browser/render_widget_host.h"
122 #include "content/public/browser/render_widget_host_iterator.h" 121 #include "content/public/browser/render_widget_host_iterator.h"
123 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" 122 #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
124 #include "content/public/browser/resource_context.h" 123 #include "content/public/browser/resource_context.h"
125 #include "content/public/browser/user_metrics.h" 124 #include "content/public/browser/user_metrics.h"
126 #include "content/public/browser/worker_service.h" 125 #include "content/public/browser/worker_service.h"
127 #include "content/public/common/content_constants.h" 126 #include "content/public/common/content_constants.h"
128 #include "content/public/common/content_switches.h" 127 #include "content/public/common/content_switches.h"
129 #include "content/public/common/process_type.h" 128 #include "content/public/common/process_type.h"
130 #include "content/public/common/resource_type.h" 129 #include "content/public/common/resource_type.h"
131 #include "content/public/common/result_codes.h" 130 #include "content/public/common/result_codes.h"
132 #include "content/public/common/sandboxed_process_launcher_delegate.h" 131 #include "content/public/common/sandboxed_process_launcher_delegate.h"
133 #include "content/public/common/url_constants.h" 132 #include "content/public/common/url_constants.h"
134 #include "device/battery/battery_monitor_impl.h" 133 #include "device/battery/battery_monitor_impl.h"
134 #include "device/vibration/vibration_manager_impl.h"
135 #include "gpu/command_buffer/client/gpu_switches.h" 135 #include "gpu/command_buffer/client/gpu_switches.h"
136 #include "gpu/command_buffer/service/gpu_switches.h" 136 #include "gpu/command_buffer/service/gpu_switches.h"
137 #include "ipc/ipc_channel.h" 137 #include "ipc/ipc_channel.h"
138 #include "ipc/ipc_logging.h" 138 #include "ipc/ipc_logging.h"
139 #include "ipc/ipc_switches.h" 139 #include "ipc/ipc_switches.h"
140 #include "ipc/mojo/ipc_channel_mojo.h" 140 #include "ipc/mojo/ipc_channel_mojo.h"
141 #include "ipc/mojo/ipc_channel_mojo_host.h" 141 #include "ipc/mojo/ipc_channel_mojo_host.h"
142 #include "media/base/media_switches.h" 142 #include "media/base/media_switches.h"
143 #include "net/url_request/url_request_context_getter.h" 143 #include "net/url_request/url_request_context_getter.h"
144 #include "ppapi/shared_impl/ppapi_switches.h" 144 #include "ppapi/shared_impl/ppapi_switches.h"
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 AddFilter(new GamepadBrowserMessageFilter()); 863 AddFilter(new GamepadBrowserMessageFilter());
864 AddFilter(new DeviceLightMessageFilter()); 864 AddFilter(new DeviceLightMessageFilter());
865 AddFilter(new DeviceMotionMessageFilter()); 865 AddFilter(new DeviceMotionMessageFilter());
866 AddFilter(new DeviceOrientationMessageFilter()); 866 AddFilter(new DeviceOrientationMessageFilter());
867 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); 867 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
868 AddFilter(new HistogramMessageFilter()); 868 AddFilter(new HistogramMessageFilter());
869 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) 869 #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
870 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking)) 870 if (browser_command_line.HasSwitch(switches::kEnableMemoryBenchmarking))
871 AddFilter(new MemoryBenchmarkMessageFilter()); 871 AddFilter(new MemoryBenchmarkMessageFilter());
872 #endif 872 #endif
873 AddFilter(new VibrationMessageFilter());
874 AddFilter(new PushMessagingMessageFilter( 873 AddFilter(new PushMessagingMessageFilter(
875 GetID(), storage_partition_impl_->GetServiceWorkerContext())); 874 GetID(), storage_partition_impl_->GetServiceWorkerContext()));
876 #if defined(OS_ANDROID) 875 #if defined(OS_ANDROID)
877 AddFilter(new ScreenOrientationMessageFilterAndroid()); 876 AddFilter(new ScreenOrientationMessageFilterAndroid());
878 #endif 877 #endif
879 AddFilter(new GeofencingDispatcherHost( 878 AddFilter(new GeofencingDispatcherHost(
880 storage_partition_impl_->GetGeofencingManager())); 879 storage_partition_impl_->GetGeofencingManager()));
881 if (browser_command_line.HasSwitch( 880 if (browser_command_line.HasSwitch(
882 switches::kEnableExperimentalWebPlatformFeatures)) 881 switches::kEnableExperimentalWebPlatformFeatures))
883 AddFilter(new BluetoothDispatcherHost()); 882 AddFilter(new BluetoothDispatcherHost());
884 } 883 }
885 884
886 void RenderProcessHostImpl::RegisterMojoServices() { 885 void RenderProcessHostImpl::RegisterMojoServices() {
887 mojo_application_host_->service_registry()->AddService( 886 mojo_application_host_->service_registry()->AddService(
888 base::Bind(&device::BatteryMonitorImpl::Create)); 887 base::Bind(&device::BatteryMonitorImpl::Create));
889 888
890 mojo_application_host_->service_registry()->AddService( 889 mojo_application_host_->service_registry()->AddService(
891 base::Bind(&PermissionServiceContext::CreateService, 890 base::Bind(&PermissionServiceContext::CreateService,
892 base::Unretained(permission_service_context_.get()))); 891 base::Unretained(permission_service_context_.get())));
892
893 mojo_application_host_->service_registry()->AddService(
894 base::Bind(&device::VibrationManagerImpl::Create));
893 } 895 }
894 896
895 int RenderProcessHostImpl::GetNextRoutingID() { 897 int RenderProcessHostImpl::GetNextRoutingID() {
896 return widget_helper_->GetNextRoutingID(); 898 return widget_helper_->GetNextRoutingID();
897 } 899 }
898 900
899 void RenderProcessHostImpl::ResumeDeferredNavigation( 901 void RenderProcessHostImpl::ResumeDeferredNavigation(
900 const GlobalRequestID& request_id) { 902 const GlobalRequestID& request_id) {
901 widget_helper_->ResumeDeferredNavigation(request_id); 903 widget_helper_->ResumeDeferredNavigation(request_id);
902 } 904 }
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2270 2272
2271 void RenderProcessHostImpl::DecrementWorkerRefCount() { 2273 void RenderProcessHostImpl::DecrementWorkerRefCount() {
2272 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2274 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2273 DCHECK_GT(worker_ref_count_, 0); 2275 DCHECK_GT(worker_ref_count_, 0);
2274 --worker_ref_count_; 2276 --worker_ref_count_;
2275 if (worker_ref_count_ == 0) 2277 if (worker_ref_count_ == 0)
2276 Cleanup(); 2278 Cleanup();
2277 } 2279 }
2278 2280
2279 } // namespace content 2281 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698