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

Unified Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.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: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
index 981b6ef92dee134046ef0b660c62e1e329a0f472..343abc6cc6a6dc3fe7c875126014fc6f276a193b 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -10,7 +10,9 @@
#include "components/constrained_window/constrained_window_views.h"
#if defined(USE_AURA)
+#include "base/memory/discardable_memory_allocator.h"
#include "base/run_loop.h"
+#include "components/discardable_memory/client/client_discardable_shared_memory_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/service_manager_connection.h"
#include "services/service_manager/public/cpp/connector.h"
@@ -113,6 +115,17 @@ void ChromeBrowserMainExtraPartsViews::ServiceManagerConnectionStarted(
&server);
input_device_client_->Connect(std::move(server));
+ discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager;
+
+ connection->GetConnector()->ConnectToInterface(ui::mojom::kServiceName,
+ &manager);
+ discardable_shared_memory_manager_ = base::MakeUnique<
+ discardable_memory::ClientDiscardableSharedMemoryManager>(
+ std::move(manager), content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::IO));
+ base::DiscardableMemoryAllocator::SetInstance(
+ discardable_shared_memory_manager_.get());
+
window_manager_connection_ = views::WindowManagerConnection::Create(
connection->GetConnector(), connection->GetIdentity(),
content::BrowserThread::GetTaskRunnerForThread(

Powered by Google App Engine
This is Rietveld 408576698