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

Unified Diff: content/shell/utility/shell_content_utility_client.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: content/shell/utility/shell_content_utility_client.cc
diff --git a/content/shell/utility/shell_content_utility_client.cc b/content/shell/utility/shell_content_utility_client.cc
index 58799c6046e35faa99996d08873b1c646941ffa1..daec25c93759c18856fe302ea496afd878f8be18 100644
--- a/content/shell/utility/shell_content_utility_client.cc
+++ b/content/shell/utility/shell_content_utility_client.cc
@@ -22,7 +22,8 @@ namespace {
class TestMojoServiceImpl : public mojom::TestMojoService {
public:
static void Create(mojo::InterfaceRequest<mojom::TestMojoService> request) {
- new TestMojoServiceImpl(std::move(request));
+ mojo::MakeStrongBinding(base::WrapUnique(new TestMojoServiceImpl),
+ std::move(request));
}
// mojom::TestMojoService implementation:
@@ -45,11 +46,7 @@ class TestMojoServiceImpl : public mojom::TestMojoService {
}
private:
- explicit TestMojoServiceImpl(
- mojo::InterfaceRequest<mojom::TestMojoService> request)
- : binding_(this, std::move(request)) {}
-
- mojo::StrongBinding<mojom::TestMojoService> binding_;
+ explicit TestMojoServiceImpl() {}
DISALLOW_COPY_AND_ASSIGN(TestMojoServiceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698