Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2548423002: Hosting the discardable memory service in the mus process (Closed)
Patch Set: Update Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 #include "media/base/media_switches.h" 177 #include "media/base/media_switches.h"
178 #include "media/media_features.h" 178 #include "media/media_features.h"
179 #include "mojo/edk/embedder/embedder.h" 179 #include "mojo/edk/embedder/embedder.h"
180 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" 180 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
181 #include "net/url_request/url_request_context_getter.h" 181 #include "net/url_request/url_request_context_getter.h"
182 #include "ppapi/features/features.h" 182 #include "ppapi/features/features.h"
183 #include "ppapi/shared_impl/ppapi_switches.h" 183 #include "ppapi/shared_impl/ppapi_switches.h"
184 #include "services/service_manager/public/cpp/connection.h" 184 #include "services/service_manager/public/cpp/connection.h"
185 #include "services/service_manager/public/cpp/interface_provider.h" 185 #include "services/service_manager/public/cpp/interface_provider.h"
186 #include "services/service_manager/public/cpp/interface_registry.h" 186 #include "services/service_manager/public/cpp/interface_registry.h"
187 #include "services/service_manager/runner/common/client_util.h"
187 #include "services/service_manager/runner/common/switches.h" 188 #include "services/service_manager/runner/common/switches.h"
188 #include "storage/browser/fileapi/sandbox_file_system_backend.h" 189 #include "storage/browser/fileapi/sandbox_file_system_backend.h"
189 #include "third_party/WebKit/public/public_features.h" 190 #include "third_party/WebKit/public/public_features.h"
190 #include "third_party/skia/include/core/SkBitmap.h" 191 #include "third_party/skia/include/core/SkBitmap.h"
191 #include "ui/base/ui_base_switches.h" 192 #include "ui/base/ui_base_switches.h"
192 #include "ui/display/display_switches.h" 193 #include "ui/display/display_switches.h"
193 #include "ui/events/event_switches.h" 194 #include "ui/events/event_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"
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 registry->AddInterface( 1290 registry->AddInterface(
1290 base::Bind(&VideoCaptureHost::Create, 1291 base::Bind(&VideoCaptureHost::Create,
1291 BrowserMainLoop::GetInstance()->media_stream_manager())); 1292 BrowserMainLoop::GetInstance()->media_stream_manager()));
1292 1293
1293 // This is to support usage of WebSockets in cases in which there is no 1294 // This is to support usage of WebSockets in cases in which there is no
1294 // associated RenderFrame (e.g., Shared Workers). 1295 // associated RenderFrame (e.g., Shared Workers).
1295 AddUIThreadInterface( 1296 AddUIThreadInterface(
1296 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(), 1297 registry.get(), base::Bind(&WebSocketManager::CreateWebSocket, GetID(),
1297 MSG_ROUTING_NONE)); 1298 MSG_ROUTING_NONE));
1298 1299
1299 registry->AddInterface(base::Bind( 1300 // Chrome browser process only provides DiscardableSharedMemory service when
1300 &discardable_memory::DiscardableSharedMemoryManager::Bind, 1301 // Chrome is not running in mus+ash.
1301 base::Unretained( 1302 if (!service_manager::ServiceManagerIsRemote()) {
1302 discardable_memory::DiscardableSharedMemoryManager::GetInstance()))); 1303 registry->AddInterface(base::Bind(
1304 &discardable_memory::DiscardableSharedMemoryManager::Bind,
1305 base::Unretained(discardable_memory::DiscardableSharedMemoryManager::
1306 GetInstance())));
1307 }
1303 1308
1304 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(), 1309 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry.get(),
1305 this); 1310 this);
1306 1311
1307 ServiceManagerConnection* service_manager_connection = 1312 ServiceManagerConnection* service_manager_connection =
1308 BrowserContext::GetServiceManagerConnectionFor(browser_context_); 1313 BrowserContext::GetServiceManagerConnectionFor(browser_context_);
1309 std::unique_ptr<ConnectionFilterImpl> connection_filter( 1314 std::unique_ptr<ConnectionFilterImpl> connection_filter(
1310 new ConnectionFilterImpl(child_connection_->child_identity(), 1315 new ConnectionFilterImpl(child_connection_->child_identity(),
1311 std::move(registry))); 1316 std::move(registry)));
1312 connection_filter_controller_ = connection_filter->controller(); 1317 connection_filter_controller_ = connection_filter->controller();
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
3002 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3007 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3003 3008
3004 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3009 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3005 // Capture the error message in a crash key value. 3010 // Capture the error message in a crash key value.
3006 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3011 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3007 bad_message::ReceivedBadMessage(render_process_id, 3012 bad_message::ReceivedBadMessage(render_process_id,
3008 bad_message::RPH_MOJO_PROCESS_ERROR); 3013 bad_message::RPH_MOJO_PROCESS_ERROR);
3009 } 3014 }
3010 3015
3011 } // namespace content 3016 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698