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

Unified Diff: services/ui/service.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 side-by-side diff with in-line comments
Download patch
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index 16dcc4be281499b6a2a96a32f2e018e0f404389a..07be44d9aa2a74ac13dc63e099ce29f13e70b125 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -13,6 +13,7 @@
#include "base/threading/platform_thread.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "components/discardable_memory/service/discardable_shared_memory_manager.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/catalog/public/cpp/resource_loader.h"
#include "services/catalog/public/interfaces/constants.mojom.h"
@@ -197,6 +198,8 @@ void Service::OnStart() {
new ws::TouchController(window_server_->display_manager()));
ime_server_.Init(context()->connector(), test_config_);
+
+ discardable_memory::DiscardableSharedMemoryManager::CreateInstance();
sky 2016/12/15 20:40:08 Is there a corresponding destroy?
Peng 2016/12/15 20:53:23 No. When this service in browser process, we do de
Peng 2016/12/15 22:06:32 discardable_memory::DiscardableSharedMemoryManager
}
bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
@@ -212,6 +215,9 @@ bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
registry->AddInterface<WindowTreeHostFactory>(this);
registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this);
registry->AddInterface<mojom::WindowTreeFactory>(this);
+ registry
+ ->AddInterface<discardable_memory::mojom::DiscardableSharedMemoryManager>(
+ this);
if (test_config_)
registry->AddInterface<WindowServerTest>(this);
@@ -359,6 +365,13 @@ void Service::Create(const service_manager::Identity& remote_identity,
user_state->window_tree_host_factory->AddBinding(std::move(request));
}
+void Service::Create(
+ const service_manager::Identity& remote_identity,
+ discardable_memory::mojom::DiscardableSharedMemoryManagerRequest request) {
+ discardable_memory::DiscardableSharedMemoryManager::GetInstance()->Bind(
+ std::move(request));
+}
+
void Service::Create(const service_manager::Identity& remote_identity,
mojom::WindowServerTestRequest request) {
if (!test_config_)
« no previous file with comments | « services/ui/service.h ('k') | ui/views/mus/BUILD.gn » ('j') | ui/views/mus/mus_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698