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

Unified Diff: extensions/renderer/mojo/keep_alive_client_unittest.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 | « extensions/renderer/api/serial/serial_api_unittest.cc ('k') | media/mojo/clients/mojo_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/mojo/keep_alive_client_unittest.cc
diff --git a/extensions/renderer/mojo/keep_alive_client_unittest.cc b/extensions/renderer/mojo/keep_alive_client_unittest.cc
index ca88535f299e2e524b953110a37131f9ad194b27..cfdcac40d175878b37ff92913717058c29c10998 100644
--- a/extensions/renderer/mojo/keep_alive_client_unittest.cc
+++ b/extensions/renderer/mojo/keep_alive_client_unittest.cc
@@ -20,23 +20,21 @@ namespace {
// destruction.
class TestKeepAlive : public KeepAlive {
public:
- TestKeepAlive(const base::Closure& on_destruction,
- mojo::InterfaceRequest<KeepAlive> keep_alive)
- : on_destruction_(on_destruction),
- binding_(this, std::move(keep_alive)) {}
+ explicit TestKeepAlive(const base::Closure& on_destruction)
+ : on_destruction_(on_destruction) {}
~TestKeepAlive() override { on_destruction_.Run(); }
static void Create(const base::Closure& on_creation,
const base::Closure& on_destruction,
- mojo::InterfaceRequest<KeepAlive> keep_alive) {
- new TestKeepAlive(on_destruction, std::move(keep_alive));
+ KeepAliveRequest keep_alive) {
+ mojo::MakeStrongBinding(base::MakeUnique<TestKeepAlive>(on_destruction),
+ std::move(keep_alive));
on_creation.Run();
}
private:
const base::Closure on_destruction_;
- mojo::StrongBinding<KeepAlive> binding_;
};
} // namespace
« no previous file with comments | « extensions/renderer/api/serial/serial_api_unittest.cc ('k') | media/mojo/clients/mojo_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698