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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 #include "content/public/common/content_constants.h" | 159 #include "content/public/common/content_constants.h" |
160 #include "content/public/common/content_features.h" | 160 #include "content/public/common/content_features.h" |
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" | |
170 #include "device/gamepad/gamepad_monitor.h" | 169 #include "device/gamepad/gamepad_monitor.h" |
171 #include "gpu/GLES2/gl2extchromium.h" | 170 #include "gpu/GLES2/gl2extchromium.h" |
172 #include "gpu/command_buffer/client/gpu_switches.h" | 171 #include "gpu/command_buffer/client/gpu_switches.h" |
173 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 172 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
174 #include "gpu/command_buffer/service/gpu_switches.h" | 173 #include "gpu/command_buffer/service/gpu_switches.h" |
175 #include "gpu/ipc/host/gpu_memory_buffer_support.h" | 174 #include "gpu/ipc/host/gpu_memory_buffer_support.h" |
176 #include "ipc/ipc.mojom.h" | 175 #include "ipc/ipc.mojom.h" |
177 #include "ipc/ipc_channel.h" | 176 #include "ipc/ipc_channel.h" |
178 #include "ipc/ipc_channel_mojo.h" | 177 #include "ipc/ipc_channel_mojo.h" |
179 #include "ipc/ipc_logging.h" | 178 #include "ipc/ipc_logging.h" |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 } | 1201 } |
1203 | 1202 |
1204 void RenderProcessHostImpl::RegisterMojoInterfaces() { | 1203 void RenderProcessHostImpl::RegisterMojoInterfaces() { |
1205 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( | 1204 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( |
1206 service_manager::mojom::kServiceManager_ConnectorSpec); | 1205 service_manager::mojom::kServiceManager_ConnectorSpec); |
1207 | 1206 |
1208 channel_->AddAssociatedInterfaceForIOThread( | 1207 channel_->AddAssociatedInterfaceForIOThread( |
1209 base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_)); | 1208 base::Bind(&IndexedDBDispatcherHost::AddBinding, indexed_db_factory_)); |
1210 | 1209 |
1211 #if defined(OS_ANDROID) | 1210 #if defined(OS_ANDROID) |
1212 AddUIThreadInterface(registry.get(), | |
1213 GetGlobalJavaInterfaces() | |
1214 ->CreateInterfaceFactory<device::BatteryMonitor>()); | |
1215 AddUIThreadInterface( | 1211 AddUIThreadInterface( |
1216 registry.get(), GetGlobalJavaInterfaces() | 1212 registry.get(), GetGlobalJavaInterfaces() |
1217 ->CreateInterfaceFactory< | 1213 ->CreateInterfaceFactory< |
1218 shape_detection::mojom::FaceDetectionProvider>()); | 1214 shape_detection::mojom::FaceDetectionProvider>()); |
1219 AddUIThreadInterface( | 1215 AddUIThreadInterface( |
1220 registry.get(), | 1216 registry.get(), |
1221 GetGlobalJavaInterfaces() | 1217 GetGlobalJavaInterfaces() |
1222 ->CreateInterfaceFactory<shape_detection::mojom::BarcodeDetection>()); | 1218 ->CreateInterfaceFactory<shape_detection::mojom::BarcodeDetection>()); |
1223 AddUIThreadInterface( | 1219 AddUIThreadInterface( |
1224 registry.get(), | 1220 registry.get(), |
1225 GetGlobalJavaInterfaces() | 1221 GetGlobalJavaInterfaces() |
1226 ->CreateInterfaceFactory<shape_detection::mojom::TextDetection>()); | 1222 ->CreateInterfaceFactory<shape_detection::mojom::TextDetection>()); |
1227 #else | 1223 #else |
1228 AddUIThreadInterface( | 1224 AddUIThreadInterface( |
1229 registry.get(), base::Bind(&device::BatteryMonitorImpl::Create)); | |
1230 AddUIThreadInterface( | |
1231 registry.get(), | 1225 registry.get(), |
1232 base::Bind(&ForwardShapeDetectionRequest< | 1226 base::Bind(&ForwardShapeDetectionRequest< |
1233 shape_detection::mojom::BarcodeDetectionRequest>)); | 1227 shape_detection::mojom::BarcodeDetectionRequest>)); |
1234 AddUIThreadInterface( | 1228 AddUIThreadInterface( |
1235 registry.get(), | 1229 registry.get(), |
1236 base::Bind(&ForwardShapeDetectionRequest< | 1230 base::Bind(&ForwardShapeDetectionRequest< |
1237 shape_detection::mojom::FaceDetectionProviderRequest>)); | 1231 shape_detection::mojom::FaceDetectionProviderRequest>)); |
1238 AddUIThreadInterface( | 1232 AddUIThreadInterface( |
1239 registry.get(), | 1233 registry.get(), |
1240 base::Bind(&ForwardShapeDetectionRequest< | 1234 base::Bind(&ForwardShapeDetectionRequest< |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3068 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3062 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3069 | 3063 |
3070 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3064 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
3071 // Capture the error message in a crash key value. | 3065 // Capture the error message in a crash key value. |
3072 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3066 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
3073 bad_message::ReceivedBadMessage(render_process_id, | 3067 bad_message::ReceivedBadMessage(render_process_id, |
3074 bad_message::RPH_MOJO_PROCESS_ERROR); | 3068 bad_message::RPH_MOJO_PROCESS_ERROR); |
3075 } | 3069 } |
3076 | 3070 |
3077 } // namespace content | 3071 } // namespace content |
OLD | NEW |