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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 #include "media/base/media_switches.h" | 176 #include "media/base/media_switches.h" |
177 #include "media/media_features.h" | 177 #include "media/media_features.h" |
178 #include "mojo/edk/embedder/embedder.h" | 178 #include "mojo/edk/embedder/embedder.h" |
179 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 179 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
180 #include "net/url_request/url_request_context_getter.h" | 180 #include "net/url_request/url_request_context_getter.h" |
181 #include "ppapi/features/features.h" | 181 #include "ppapi/features/features.h" |
182 #include "ppapi/shared_impl/ppapi_switches.h" | 182 #include "ppapi/shared_impl/ppapi_switches.h" |
183 #include "services/service_manager/public/cpp/connection.h" | 183 #include "services/service_manager/public/cpp/connection.h" |
184 #include "services/service_manager/public/cpp/interface_provider.h" | 184 #include "services/service_manager/public/cpp/interface_provider.h" |
185 #include "services/service_manager/public/cpp/interface_registry.h" | 185 #include "services/service_manager/public/cpp/interface_registry.h" |
| 186 #include "services/service_manager/runner/common/client_util.h" |
186 #include "services/service_manager/runner/common/switches.h" | 187 #include "services/service_manager/runner/common/switches.h" |
187 #include "storage/browser/fileapi/sandbox_file_system_backend.h" | 188 #include "storage/browser/fileapi/sandbox_file_system_backend.h" |
188 #include "third_party/WebKit/public/public_features.h" | 189 #include "third_party/WebKit/public/public_features.h" |
189 #include "third_party/skia/include/core/SkBitmap.h" | 190 #include "third_party/skia/include/core/SkBitmap.h" |
190 #include "ui/base/ui_base_switches.h" | 191 #include "ui/base/ui_base_switches.h" |
191 #include "ui/display/display_switches.h" | 192 #include "ui/display/display_switches.h" |
192 #include "ui/events/event_switches.h" | 193 #include "ui/events/event_switches.h" |
193 #include "ui/gfx/switches.h" | 194 #include "ui/gfx/switches.h" |
194 #include "ui/gl/gl_switches.h" | 195 #include "ui/gl/gl_switches.h" |
195 #include "ui/gl/gpu_switching_manager.h" | 196 #include "ui/gl/gpu_switching_manager.h" |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 registry->AddInterface( | 1289 registry->AddInterface( |
1289 base::Bind(&VideoCaptureHost::Create, | 1290 base::Bind(&VideoCaptureHost::Create, |
1290 BrowserMainLoop::GetInstance()->media_stream_manager())); | 1291 BrowserMainLoop::GetInstance()->media_stream_manager())); |
1291 | 1292 |
1292 // This is to support usage of WebSockets in cases in which there is no | 1293 // This is to support usage of WebSockets in cases in which there is no |
1293 // associated RenderFrame (e.g., Shared Workers). | 1294 // associated RenderFrame (e.g., Shared Workers). |
1294 AddUIThreadInterface( | 1295 AddUIThreadInterface( |
1295 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), | 1296 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), |
1296 MSG_ROUTING_NONE)); | 1297 MSG_ROUTING_NONE)); |
1297 | 1298 |
1298 registry->AddInterface(base::Bind( | 1299 // Chrome browser process only provides DiscardableSharedMemory service when |
1299 &discardable_memory::DiscardableSharedMemoryManager::Bind, | 1300 // Chrome is not running in mus+ash. |
1300 base::Unretained( | 1301 if (!service_manager::ServiceManagerIsRemote()) { |
1301 discardable_memory::DiscardableSharedMemoryManager::GetInstance()))); | 1302 registry->AddInterface(base::Bind( |
| 1303 &discardable_memory::DiscardableSharedMemoryManager::Bind, |
| 1304 base::Unretained(discardable_memory::DiscardableSharedMemoryManager:: |
| 1305 GetInstance()))); |
| 1306 } |
1302 | 1307 |
1303 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), | 1308 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), |
1304 this); | 1309 this); |
1305 | 1310 |
1306 ServiceManagerConnection* service_manager_connection = | 1311 ServiceManagerConnection* service_manager_connection = |
1307 BrowserContext::GetServiceManagerConnectionFor(browser_context_); | 1312 BrowserContext::GetServiceManagerConnectionFor(browser_context_); |
1308 std::unique_ptr<ConnectionFilterImpl> connection_filter( | 1313 std::unique_ptr<ConnectionFilterImpl> connection_filter( |
1309 new ConnectionFilterImpl(child_connection_->child_identity(), | 1314 new ConnectionFilterImpl(child_connection_->child_identity(), |
1310 std::move(registry))); | 1315 std::move(registry))); |
1311 connection_filter_controller_ = connection_filter->controller(); | 1316 connection_filter_controller_ = connection_filter->controller(); |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3006 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3011 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3007 | 3012 |
3008 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3013 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
3009 // enough information here so that we can determine what the bad message was. | 3014 // enough information here so that we can determine what the bad message was. |
3010 base::debug::Alias(&error); | 3015 base::debug::Alias(&error); |
3011 bad_message::ReceivedBadMessage(render_process_id, | 3016 bad_message::ReceivedBadMessage(render_process_id, |
3012 bad_message::RPH_MOJO_PROCESS_ERROR); | 3017 bad_message::RPH_MOJO_PROCESS_ERROR); |
3013 } | 3018 } |
3014 | 3019 |
3015 } // namespace content | 3020 } // namespace content |
OLD | NEW |