| OLD | NEW |
| 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 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 | 1257 |
| 1258 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1258 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
| 1259 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1259 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
| 1260 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1260 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
| 1261 file_task_runner); | 1261 file_task_runner); |
| 1262 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) | 1262 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) |
| 1263 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1263 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
| 1264 file_task_runner); | 1264 file_task_runner); |
| 1265 #endif | 1265 #endif |
| 1266 | 1266 |
| 1267 // These callbacks will be run immediately on the IO thread. | 1267 #if defined(OS_ANDROID) |
| 1268 // On Android the device sensors implementations need to run on the UI thread |
| 1269 // to communicate to Java. |
| 1270 AddUIThreadInterface(registry.get(), base::Bind(&DeviceLightHost::Create)); |
| 1271 AddUIThreadInterface(registry.get(), base::Bind(&DeviceMotionHost::Create)); |
| 1272 AddUIThreadInterface(registry.get(), |
| 1273 base::Bind(&DeviceOrientationHost::Create)); |
| 1274 AddUIThreadInterface(registry.get(), |
| 1275 base::Bind(&DeviceOrientationAbsoluteHost::Create)); |
| 1276 #else |
| 1277 // On platforms other than Android the device sensors implementations run on |
| 1278 // the IO thread. |
| 1268 registry->AddInterface(base::Bind(&DeviceLightHost::Create)); | 1279 registry->AddInterface(base::Bind(&DeviceLightHost::Create)); |
| 1269 registry->AddInterface(base::Bind(&DeviceMotionHost::Create)); | 1280 registry->AddInterface(base::Bind(&DeviceMotionHost::Create)); |
| 1270 registry->AddInterface(base::Bind(&DeviceOrientationHost::Create)); | 1281 registry->AddInterface(base::Bind(&DeviceOrientationHost::Create)); |
| 1271 registry->AddInterface(base::Bind(&DeviceOrientationAbsoluteHost::Create)); | 1282 registry->AddInterface(base::Bind(&DeviceOrientationAbsoluteHost::Create)); |
| 1283 #endif // defined(OS_ANDROID) |
| 1272 | 1284 |
| 1273 registry->AddInterface( | 1285 registry->AddInterface( |
| 1274 base::Bind(&VideoCaptureHost::Create, | 1286 base::Bind(&VideoCaptureHost::Create, |
| 1275 BrowserMainLoop::GetInstance()->media_stream_manager())); | 1287 BrowserMainLoop::GetInstance()->media_stream_manager())); |
| 1276 | 1288 |
| 1277 // This is to support usage of WebSockets in cases in which there is no | 1289 // This is to support usage of WebSockets in cases in which there is no |
| 1278 // associated RenderFrame (e.g., Shared Workers). | 1290 // associated RenderFrame (e.g., Shared Workers). |
| 1279 AddUIThreadInterface( | 1291 AddUIThreadInterface( |
| 1280 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), | 1292 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), |
| 1281 MSG_ROUTING_NONE)); | 1293 MSG_ROUTING_NONE)); |
| (...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2985 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2997 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2986 | 2998 |
| 2987 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2999 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2988 // enough information here so that we can determine what the bad message was. | 3000 // enough information here so that we can determine what the bad message was. |
| 2989 base::debug::Alias(&error); | 3001 base::debug::Alias(&error); |
| 2990 bad_message::ReceivedBadMessage(render_process_id, | 3002 bad_message::ReceivedBadMessage(render_process_id, |
| 2991 bad_message::RPH_MOJO_PROCESS_ERROR); | 3003 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2992 } | 3004 } |
| 2993 | 3005 |
| 2994 } // namespace content | 3006 } // namespace content |
| OLD | NEW |