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

Unified Diff: net/proxy/in_process_mojo_proxy_resolver_factory.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
Index: net/proxy/in_process_mojo_proxy_resolver_factory.cc
diff --git a/net/proxy/in_process_mojo_proxy_resolver_factory.cc b/net/proxy/in_process_mojo_proxy_resolver_factory.cc
index ff9dd852247de88143adcf878b77a28d116c9a07..2f04b241d07b4563b3837ee1fc1131b4c89107fb 100644
--- a/net/proxy/in_process_mojo_proxy_resolver_factory.cc
+++ b/net/proxy/in_process_mojo_proxy_resolver_factory.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/memory/singleton.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
namespace net {
@@ -18,10 +19,8 @@ InProcessMojoProxyResolverFactory::GetInstance() {
}
InProcessMojoProxyResolverFactory::InProcessMojoProxyResolverFactory() {
- // Implementation lifetime is strongly bound to the life of the connection via
- // |factory_|. When |factory_| is destroyed, the Mojo connection is terminated
- // which causes this object to be destroyed.
- new MojoProxyResolverFactoryImpl(mojo::GetProxy(&factory_));
+ mojo::MakeStrongBinding(base::MakeUnique<MojoProxyResolverFactoryImpl>(),
+ mojo::GetProxy(&factory_));
}
InProcessMojoProxyResolverFactory::~InProcessMojoProxyResolverFactory() =
« no previous file with comments | « mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698