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

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, 9 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 #include "content/public/common/content_switches.h" 161 #include "content/public/common/content_switches.h"
162 #include "content/public/common/mojo_channel_switches.h" 162 #include "content/public/common/mojo_channel_switches.h"
163 #include "content/public/common/process_type.h" 163 #include "content/public/common/process_type.h"
164 #include "content/public/common/resource_type.h" 164 #include "content/public/common/resource_type.h"
165 #include "content/public/common/result_codes.h" 165 #include "content/public/common/result_codes.h"
166 #include "content/public/common/sandboxed_process_launcher_delegate.h" 166 #include "content/public/common/sandboxed_process_launcher_delegate.h"
167 #include "content/public/common/service_names.mojom.h" 167 #include "content/public/common/service_names.mojom.h"
168 #include "content/public/common/url_constants.h" 168 #include "content/public/common/url_constants.h"
169 #include "device/battery/battery_monitor_impl.h" 169 #include "device/battery/battery_monitor_impl.h"
170 #include "device/gamepad/gamepad_monitor.h" 170 #include "device/gamepad/gamepad_monitor.h"
171 #include "device/sensors/device_sensor_host.h"
172 #include "gpu/GLES2/gl2extchromium.h" 171 #include "gpu/GLES2/gl2extchromium.h"
173 #include "gpu/command_buffer/client/gpu_switches.h" 172 #include "gpu/command_buffer/client/gpu_switches.h"
174 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 173 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
175 #include "gpu/command_buffer/service/gpu_switches.h" 174 #include "gpu/command_buffer/service/gpu_switches.h"
176 #include "gpu/ipc/host/gpu_memory_buffer_support.h" 175 #include "gpu/ipc/host/gpu_memory_buffer_support.h"
177 #include "ipc/ipc.mojom.h" 176 #include "ipc/ipc.mojom.h"
178 #include "ipc/ipc_channel.h" 177 #include "ipc/ipc_channel.h"
179 #include "ipc/ipc_channel_mojo.h" 178 #include "ipc/ipc_channel_mojo.h"
180 #include "ipc/ipc_logging.h" 179 #include "ipc/ipc_logging.h"
181 #include "media/base/media_switches.h" 180 #include "media/base/media_switches.h"
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1288
1290 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = 1289 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner =
1291 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); 1290 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE);
1292 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), 1291 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create),
1293 file_task_runner); 1292 file_task_runner);
1294 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) 1293 #if BUILDFLAG(USE_MINIKIN_HYPHENATION)
1295 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), 1294 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create),
1296 file_task_runner); 1295 file_task_runner);
1297 #endif 1296 #endif
1298 1297
1299 #if defined(OS_ANDROID)
1300 // On Android the device sensors implementations need to run on the UI thread
1301 // to communicate to Java.
1302 AddUIThreadInterface(registry.get(),
1303 base::Bind(&device::DeviceLightHost::Create));
1304 AddUIThreadInterface(registry.get(),
1305 base::Bind(&device::DeviceMotionHost::Create));
1306 AddUIThreadInterface(registry.get(),
1307 base::Bind(&device::DeviceOrientationHost::Create));
1308 AddUIThreadInterface(
1309 registry.get(),
1310 base::Bind(&device::DeviceOrientationAbsoluteHost::Create));
1311 #else
1312 // On platforms other than Android the device sensors implementations run on
1313 // the IO thread.
1314 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create));
1315 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create));
1316 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create));
1317 registry->AddInterface(
1318 base::Bind(&device::DeviceOrientationAbsoluteHost::Create));
1319 #endif // defined(OS_ANDROID)
1320
1321 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); 1298 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create));
1322 1299
1323 registry->AddInterface( 1300 registry->AddInterface(
1324 base::Bind(&PushMessagingManager::BindRequest, 1301 base::Bind(&PushMessagingManager::BindRequest,
1325 base::Unretained(push_messaging_manager_.get()))); 1302 base::Unretained(push_messaging_manager_.get())));
1326 1303
1327 registry->AddInterface(base::Bind( 1304 registry->AddInterface(base::Bind(
1328 &BackgroundFetchServiceImpl::Create, 1305 &BackgroundFetchServiceImpl::Create,
1329 make_scoped_refptr(storage_partition_impl_->GetBackgroundFetchContext()), 1306 make_scoped_refptr(storage_partition_impl_->GetBackgroundFetchContext()),
1330 make_scoped_refptr(storage_partition_impl_->GetServiceWorkerContext()))); 1307 make_scoped_refptr(storage_partition_impl_->GetServiceWorkerContext())));
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3068 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3092 3069
3093 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3070 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3094 // Capture the error message in a crash key value. 3071 // Capture the error message in a crash key value.
3095 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3072 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3096 bad_message::ReceivedBadMessage(render_process_id, 3073 bad_message::ReceivedBadMessage(render_process_id,
3097 bad_message::RPH_MOJO_PROCESS_ERROR); 3074 bad_message::RPH_MOJO_PROCESS_ERROR);
3098 } 3075 }
3099 3076
3100 } // namespace content 3077 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698