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

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

Issue 2692993006: Port device_sensors to be hosted in Device Service (Closed)
Patch Set: code rebase Created 3 years, 10 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
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" 167 #include "device/battery/battery_monitor_impl.h"
168 #include "device/gamepad/gamepad_monitor.h" 168 #include "device/gamepad/gamepad_monitor.h"
169 #include "device/sensors/device_sensor_host.h"
170 #include "gpu/GLES2/gl2extchromium.h" 169 #include "gpu/GLES2/gl2extchromium.h"
171 #include "gpu/command_buffer/client/gpu_switches.h" 170 #include "gpu/command_buffer/client/gpu_switches.h"
172 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 171 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
173 #include "gpu/command_buffer/service/gpu_switches.h" 172 #include "gpu/command_buffer/service/gpu_switches.h"
174 #include "gpu/ipc/host/gpu_memory_buffer_support.h" 173 #include "gpu/ipc/host/gpu_memory_buffer_support.h"
175 #include "ipc/ipc.mojom.h" 174 #include "ipc/ipc.mojom.h"
176 #include "ipc/ipc_channel.h" 175 #include "ipc/ipc_channel.h"
177 #include "ipc/ipc_channel_mojo.h" 176 #include "ipc/ipc_channel_mojo.h"
178 #include "ipc/ipc_logging.h" 177 #include "ipc/ipc_logging.h"
179 #include "media/base/media_switches.h" 178 #include "media/base/media_switches.h"
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 1276
1278 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = 1277 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner =
1279 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); 1278 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE);
1280 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), 1279 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create),
1281 file_task_runner); 1280 file_task_runner);
1282 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) 1281 #if BUILDFLAG(USE_MINIKIN_HYPHENATION)
1283 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), 1282 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create),
1284 file_task_runner); 1283 file_task_runner);
1285 #endif 1284 #endif
1286 1285
1287 #if defined(OS_ANDROID)
1288 // On Android the device sensors implementations need to run on the UI thread
1289 // to communicate to Java.
1290 AddUIThreadInterface(registry.get(),
1291 base::Bind(&device::DeviceLightHost::Create));
1292 AddUIThreadInterface(registry.get(),
1293 base::Bind(&device::DeviceMotionHost::Create));
1294 AddUIThreadInterface(registry.get(),
1295 base::Bind(&device::DeviceOrientationHost::Create));
1296 AddUIThreadInterface(
1297 registry.get(),
1298 base::Bind(&device::DeviceOrientationAbsoluteHost::Create));
1299 #else
1300 // On platforms other than Android the device sensors implementations run on
1301 // the IO thread.
1302 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create));
1303 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create));
1304 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create));
1305 registry->AddInterface(
1306 base::Bind(&device::DeviceOrientationAbsoluteHost::Create));
1307 #endif // defined(OS_ANDROID)
1308
1309 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); 1286 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create));
1310 1287
1311 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, 1288 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest,
1312 base::Unretained(this))); 1289 base::Unretained(this)));
1313 1290
1314 registry->AddInterface( 1291 registry->AddInterface(
1315 base::Bind(&VideoCaptureHost::Create, 1292 base::Bind(&VideoCaptureHost::Create,
1316 BrowserMainLoop::GetInstance()->media_stream_manager())); 1293 BrowserMainLoop::GetInstance()->media_stream_manager()));
1317 1294
1318 // This is to support usage of WebSockets in cases in which there is no 1295 // This is to support usage of WebSockets in cases in which there is no
(...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
3060 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3037 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3061 3038
3062 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3039 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3063 // Capture the error message in a crash key value. 3040 // Capture the error message in a crash key value.
3064 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3041 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3065 bad_message::ReceivedBadMessage(render_process_id, 3042 bad_message::ReceivedBadMessage(render_process_id,
3066 bad_message::RPH_MOJO_PROCESS_ERROR); 3043 bad_message::RPH_MOJO_PROCESS_ERROR);
3067 } 3044 }
3068 3045
3069 } // namespace content 3046 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698