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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 #include "media/base/media_switches.h" | 178 #include "media/base/media_switches.h" |
179 #include "media/media_features.h" | 179 #include "media/media_features.h" |
180 #include "mojo/edk/embedder/embedder.h" | 180 #include "mojo/edk/embedder/embedder.h" |
181 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 181 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
182 #include "net/url_request/url_request_context_getter.h" | 182 #include "net/url_request/url_request_context_getter.h" |
183 #include "ppapi/features/features.h" | 183 #include "ppapi/features/features.h" |
184 #include "ppapi/shared_impl/ppapi_switches.h" | 184 #include "ppapi/shared_impl/ppapi_switches.h" |
185 #include "services/service_manager/public/cpp/connection.h" | 185 #include "services/service_manager/public/cpp/connection.h" |
186 #include "services/service_manager/public/cpp/interface_provider.h" | 186 #include "services/service_manager/public/cpp/interface_provider.h" |
187 #include "services/service_manager/public/cpp/interface_registry.h" | 187 #include "services/service_manager/public/cpp/interface_registry.h" |
| 188 #include "services/service_manager/runner/common/client_util.h" |
188 #include "services/service_manager/runner/common/switches.h" | 189 #include "services/service_manager/runner/common/switches.h" |
189 #include "storage/browser/fileapi/sandbox_file_system_backend.h" | 190 #include "storage/browser/fileapi/sandbox_file_system_backend.h" |
190 #include "third_party/WebKit/public/public_features.h" | 191 #include "third_party/WebKit/public/public_features.h" |
191 #include "third_party/skia/include/core/SkBitmap.h" | 192 #include "third_party/skia/include/core/SkBitmap.h" |
192 #include "ui/base/ui_base_switches.h" | 193 #include "ui/base/ui_base_switches.h" |
193 #include "ui/display/display_switches.h" | 194 #include "ui/display/display_switches.h" |
194 #include "ui/gfx/switches.h" | 195 #include "ui/gfx/switches.h" |
195 #include "ui/gl/gl_switches.h" | 196 #include "ui/gl/gl_switches.h" |
196 #include "ui/gl/gpu_switching_manager.h" | 197 #include "ui/gl/gpu_switching_manager.h" |
197 #include "ui/native_theme/native_theme_switches.h" | 198 #include "ui/native_theme/native_theme_switches.h" |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 registry->AddInterface( | 1294 registry->AddInterface( |
1294 base::Bind(&VideoCaptureHost::Create, | 1295 base::Bind(&VideoCaptureHost::Create, |
1295 BrowserMainLoop::GetInstance()->media_stream_manager())); | 1296 BrowserMainLoop::GetInstance()->media_stream_manager())); |
1296 | 1297 |
1297 // This is to support usage of WebSockets in cases in which there is no | 1298 // This is to support usage of WebSockets in cases in which there is no |
1298 // associated RenderFrame (e.g., Shared Workers). | 1299 // associated RenderFrame (e.g., Shared Workers). |
1299 AddUIThreadInterface( | 1300 AddUIThreadInterface( |
1300 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), | 1301 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), |
1301 MSG_ROUTING_NONE)); | 1302 MSG_ROUTING_NONE)); |
1302 | 1303 |
1303 registry->AddInterface(base::Bind( | 1304 // Chrome browser process only provides DiscardableSharedMemory service when |
1304 &discardable_memory::DiscardableSharedMemoryManager::Bind, | 1305 // Chrome is not running in mus+ash. |
1305 base::Unretained( | 1306 if (!service_manager::ServiceManagerIsRemote()) { |
1306 discardable_memory::DiscardableSharedMemoryManager::GetInstance()))); | 1307 registry->AddInterface(base::Bind( |
| 1308 &discardable_memory::DiscardableSharedMemoryManager::Bind, |
| 1309 base::Unretained(discardable_memory::DiscardableSharedMemoryManager:: |
| 1310 GetInstance()))); |
| 1311 } |
1307 | 1312 |
1308 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), | 1313 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), |
1309 this); | 1314 this); |
1310 | 1315 |
1311 ServiceManagerConnection* service_manager_connection = | 1316 ServiceManagerConnection* service_manager_connection = |
1312 BrowserContext::GetServiceManagerConnectionFor(browser_context_); | 1317 BrowserContext::GetServiceManagerConnectionFor(browser_context_); |
1313 std::unique_ptr<ConnectionFilterImpl> connection_filter( | 1318 std::unique_ptr<ConnectionFilterImpl> connection_filter( |
1314 new ConnectionFilterImpl(child_connection_->child_identity(), | 1319 new ConnectionFilterImpl(child_connection_->child_identity(), |
1315 std::move(registry))); | 1320 std::move(registry))); |
1316 connection_filter_controller_ = connection_filter->controller(); | 1321 connection_filter_controller_ = connection_filter->controller(); |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3019 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3015 | 3020 |
3016 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3021 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
3017 // Capture the error message in a crash key value. | 3022 // Capture the error message in a crash key value. |
3018 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3023 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
3019 bad_message::ReceivedBadMessage(render_process_id, | 3024 bad_message::ReceivedBadMessage(render_process_id, |
3020 bad_message::RPH_MOJO_PROCESS_ERROR); | 3025 bad_message::RPH_MOJO_PROCESS_ERROR); |
3021 } | 3026 } |
3022 | 3027 |
3023 } // namespace content | 3028 } // namespace content |
OLD | NEW |