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

Unified Diff: services/ui/service.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 months 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
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_driver.cc ('k') | services/ui/ws/window_server_test_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index 025112dd8df4889de220aa557664fd148e3312d9..e3521ade9bc81c24aaa6c9f6e3682c747ba69703 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 "mojo/public/cpp/bindings/strong_binding.h"
#include "services/catalog/public/cpp/resource_loader.h"
#include "services/shell/public/c/main.h"
#include "services/shell/public/cpp/connection.h"
@@ -333,8 +334,10 @@ void Service::Create(const shell::Identity& remote_identity,
return;
}
AddUserIfNecessary(remote_identity);
- new ws::WindowTreeFactory(window_server_.get(), remote_identity.user_id(),
- remote_identity.name(), std::move(request));
+ mojo::MakeStrongBinding(base::MakeUnique<ws::WindowTreeFactory>(
+ window_server_.get(), remote_identity.user_id(),
+ remote_identity.name()),
+ std::move(request));
}
void Service::Create(const shell::Identity& remote_identity,
@@ -351,7 +354,9 @@ void Service::Create(const shell::Identity& remote_identity,
mojom::WindowServerTestRequest request) {
if (!test_config_)
return;
- new ws::WindowServerTestImpl(window_server_.get(), std::move(request));
+ mojo::MakeStrongBinding(
+ base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()),
+ std::move(request));
}
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_driver.cc ('k') | services/ui/ws/window_server_test_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698