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

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

Issue 2643713002: Port BatteryMonitor into Device Service (Closed)
Patch Set: Self-review Created 3 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 #include "content/public/common/content_constants.h" 157 #include "content/public/common/content_constants.h"
158 #include "content/public/common/content_features.h" 158 #include "content/public/common/content_features.h"
159 #include "content/public/common/content_switches.h" 159 #include "content/public/common/content_switches.h"
160 #include "content/public/common/mojo_channel_switches.h" 160 #include "content/public/common/mojo_channel_switches.h"
161 #include "content/public/common/process_type.h" 161 #include "content/public/common/process_type.h"
162 #include "content/public/common/resource_type.h" 162 #include "content/public/common/resource_type.h"
163 #include "content/public/common/result_codes.h" 163 #include "content/public/common/result_codes.h"
164 #include "content/public/common/sandboxed_process_launcher_delegate.h" 164 #include "content/public/common/sandboxed_process_launcher_delegate.h"
165 #include "content/public/common/service_names.mojom.h" 165 #include "content/public/common/service_names.mojom.h"
166 #include "content/public/common/url_constants.h" 166 #include "content/public/common/url_constants.h"
167 #include "device/battery/battery_monitor_impl.h"
168 #include "device/gamepad/gamepad_monitor.h" 167 #include "device/gamepad/gamepad_monitor.h"
169 #include "gpu/GLES2/gl2extchromium.h" 168 #include "gpu/GLES2/gl2extchromium.h"
170 #include "gpu/command_buffer/client/gpu_switches.h" 169 #include "gpu/command_buffer/client/gpu_switches.h"
171 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 170 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
172 #include "gpu/command_buffer/service/gpu_switches.h" 171 #include "gpu/command_buffer/service/gpu_switches.h"
173 #include "gpu/ipc/host/gpu_memory_buffer_support.h" 172 #include "gpu/ipc/host/gpu_memory_buffer_support.h"
174 #include "ipc/ipc.mojom.h" 173 #include "ipc/ipc.mojom.h"
175 #include "ipc/ipc_channel.h" 174 #include "ipc/ipc_channel.h"
176 #include "ipc/ipc_channel_mojo.h" 175 #include "ipc/ipc_channel_mojo.h"
177 #include "ipc/ipc_logging.h" 176 #include "ipc/ipc_logging.h"
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 service_manager::mojom::kServiceManager_ConnectorSpec); 1193 service_manager::mojom::kServiceManager_ConnectorSpec);
1195 1194
1196 channel_->AddAssociatedInterface( 1195 channel_->AddAssociatedInterface(
1197 base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest, 1196 base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest,
1198 base::Unretained(this))); 1197 base::Unretained(this)));
1199 1198
1200 channel_->AddAssociatedInterfaceForIOThread( 1199 channel_->AddAssociatedInterfaceForIOThread(
1201 base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_)); 1200 base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_));
1202 1201
1203 #if defined(OS_ANDROID) 1202 #if defined(OS_ANDROID)
1204 AddUIThreadInterface(registry.get(),
1205 GetGlobalJavaInterfaces()
1206 ->CreateInterfaceFactory<device::BatteryMonitor>());
1207 AddUIThreadInterface( 1203 AddUIThreadInterface(
1208 registry.get(), GetGlobalJavaInterfaces() 1204 registry.get(), GetGlobalJavaInterfaces()
1209 ->CreateInterfaceFactory< 1205 ->CreateInterfaceFactory<
1210 shape_detection::mojom::FaceDetectionProvider>()); 1206 shape_detection::mojom::FaceDetectionProvider>());
1211 AddUIThreadInterface( 1207 AddUIThreadInterface(
1212 registry.get(), 1208 registry.get(),
1213 GetGlobalJavaInterfaces() 1209 GetGlobalJavaInterfaces()
1214 ->CreateInterfaceFactory<shape_detection::mojom::BarcodeDetection>()); 1210 ->CreateInterfaceFactory<shape_detection::mojom::BarcodeDetection>());
1215 AddUIThreadInterface( 1211 AddUIThreadInterface(
1216 registry.get(), 1212 registry.get(),
1217 GetGlobalJavaInterfaces() 1213 GetGlobalJavaInterfaces()
1218 ->CreateInterfaceFactory<shape_detection::mojom::TextDetection>()); 1214 ->CreateInterfaceFactory<shape_detection::mojom::TextDetection>());
1219 #else
1220 AddUIThreadInterface(
1221 registry.get(), base::Bind(&device::BatteryMonitorImpl::Create));
1222 #endif 1215 #endif
1223 AddUIThreadInterface( 1216 AddUIThreadInterface(
1224 registry.get(), 1217 registry.get(),
1225 base::Bind(&PermissionServiceContext::CreateService, 1218 base::Bind(&PermissionServiceContext::CreateService,
1226 base::Unretained(permission_service_context_.get()))); 1219 base::Unretained(permission_service_context_.get())));
1227 // TODO(mcasas): finalize arguments. 1220 // TODO(mcasas): finalize arguments.
1228 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); 1221 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create));
1229 1222
1230 AddUIThreadInterface( 1223 AddUIThreadInterface(
1231 registry.get(), 1224 registry.get(),
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
3039 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3032 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3040 3033
3041 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3034 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3042 // Capture the error message in a crash key value. 3035 // Capture the error message in a crash key value.
3043 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3036 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3044 bad_message::ReceivedBadMessage(render_process_id, 3037 bad_message::ReceivedBadMessage(render_process_id,
3045 bad_message::RPH_MOJO_PROCESS_ERROR); 3038 bad_message::RPH_MOJO_PROCESS_ERROR);
3046 } 3039 }
3047 3040
3048 } // namespace content 3041 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698