| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 #include "ipc/ipc.mojom.h" | 175 #include "ipc/ipc.mojom.h" |
| 176 #include "ipc/ipc_channel.h" | 176 #include "ipc/ipc_channel.h" |
| 177 #include "ipc/ipc_channel_mojo.h" | 177 #include "ipc/ipc_channel_mojo.h" |
| 178 #include "ipc/ipc_logging.h" | 178 #include "ipc/ipc_logging.h" |
| 179 #include "media/base/media_switches.h" | 179 #include "media/base/media_switches.h" |
| 180 #include "media/media_features.h" | 180 #include "media/media_features.h" |
| 181 #include "mojo/edk/embedder/embedder.h" | 181 #include "mojo/edk/embedder/embedder.h" |
| 182 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 182 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 183 #include "net/url_request/url_request_context_getter.h" | 183 #include "net/url_request/url_request_context_getter.h" |
| 184 #include "ppapi/features/features.h" | 184 #include "ppapi/features/features.h" |
| 185 #include "services/resource_coordinator/memory/coordinator/coordinator_impl.h" |
| 185 #include "services/service_manager/public/cpp/connection.h" | 186 #include "services/service_manager/public/cpp/connection.h" |
| 186 #include "services/service_manager/public/cpp/connector.h" | 187 #include "services/service_manager/public/cpp/connector.h" |
| 187 #include "services/service_manager/public/cpp/interface_provider.h" | 188 #include "services/service_manager/public/cpp/interface_provider.h" |
| 188 #include "services/service_manager/public/cpp/interface_registry.h" | 189 #include "services/service_manager/public/cpp/interface_registry.h" |
| 189 #include "services/service_manager/runner/common/client_util.h" | 190 #include "services/service_manager/runner/common/client_util.h" |
| 190 #include "services/service_manager/runner/common/switches.h" | 191 #include "services/service_manager/runner/common/switches.h" |
| 191 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" | 192 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" |
| 192 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 193 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
| 193 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo
m.h" | 194 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo
m.h" |
| 194 #include "services/shape_detection/public/interfaces/textdetection.mojom.h" | 195 #include "services/shape_detection/public/interfaces/textdetection.mojom.h" |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 // Chrome browser process only provides DiscardableSharedMemory service when | 1334 // Chrome browser process only provides DiscardableSharedMemory service when |
| 1334 // Chrome is not running in mus+ash. | 1335 // Chrome is not running in mus+ash. |
| 1335 if (!service_manager::ServiceManagerIsRemote()) { | 1336 if (!service_manager::ServiceManagerIsRemote()) { |
| 1336 discardable_memory::DiscardableSharedMemoryManager* manager = | 1337 discardable_memory::DiscardableSharedMemoryManager* manager = |
| 1337 BrowserMainLoop::GetInstance()->discardable_shared_memory_manager(); | 1338 BrowserMainLoop::GetInstance()->discardable_shared_memory_manager(); |
| 1338 registry->AddInterface( | 1339 registry->AddInterface( |
| 1339 base::Bind(&discardable_memory::DiscardableSharedMemoryManager::Bind, | 1340 base::Bind(&discardable_memory::DiscardableSharedMemoryManager::Bind, |
| 1340 base::Unretained(manager))); | 1341 base::Unretained(manager))); |
| 1341 } | 1342 } |
| 1342 | 1343 |
| 1344 AddUIThreadInterface( |
| 1345 registry.get(), |
| 1346 base::Bind( |
| 1347 &memory_instrumentation::CoordinatorImpl::BindCoordinatorRequest, |
| 1348 base::Unretained( |
| 1349 BrowserMainLoop::GetMemoryInstrumentationCoordinator()))); |
| 1350 |
| 1343 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), | 1351 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), |
| 1344 this); | 1352 this); |
| 1345 | 1353 |
| 1346 ServiceManagerConnection* service_manager_connection = | 1354 ServiceManagerConnection* service_manager_connection = |
| 1347 BrowserContext::GetServiceManagerConnectionFor(browser_context_); | 1355 BrowserContext::GetServiceManagerConnectionFor(browser_context_); |
| 1348 std::unique_ptr<ConnectionFilterImpl> connection_filter( | 1356 std::unique_ptr<ConnectionFilterImpl> connection_filter( |
| 1349 new ConnectionFilterImpl(child_connection_->child_identity(), | 1357 new ConnectionFilterImpl(child_connection_->child_identity(), |
| 1350 std::move(registry))); | 1358 std::move(registry))); |
| 1351 connection_filter_controller_ = connection_filter->controller(); | 1359 connection_filter_controller_ = connection_filter->controller(); |
| 1352 connection_filter_id_ = service_manager_connection->AddConnectionFilter( | 1360 connection_filter_id_ = service_manager_connection->AddConnectionFilter( |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3071 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3079 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3072 | 3080 |
| 3073 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3081 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3074 // Capture the error message in a crash key value. | 3082 // Capture the error message in a crash key value. |
| 3075 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3083 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3076 bad_message::ReceivedBadMessage(render_process_id, | 3084 bad_message::ReceivedBadMessage(render_process_id, |
| 3077 bad_message::RPH_MOJO_PROCESS_ERROR); | 3085 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3078 } | 3086 } |
| 3079 | 3087 |
| 3080 } // namespace content | 3088 } // namespace content |
| OLD | NEW |