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

Unified Diff: device/serial/serial_connection_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
« no previous file with comments | « device/serial/serial_connection.cc ('k') | device/serial/serial_connection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_connection_factory.cc
diff --git a/device/serial/serial_connection_factory.cc b/device/serial/serial_connection_factory.cc
index 8088a7e6b50de066686d0d0c9d7a6905341caa11..806a0e888ebcc7a99ad352629a90548b414c8c7c 100644
--- a/device/serial/serial_connection_factory.cc
+++ b/device/serial/serial_connection_factory.cc
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "device/serial/serial_connection.h"
#include "device/serial/serial_io_handler.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace device {
namespace {
@@ -128,9 +129,10 @@ void SerialConnectionFactory::ConnectTask::OnConnected(bool success) {
return;
}
- new SerialConnection(io_handler_, std::move(sink_), std::move(source_),
- mojo::MakeProxy(std::move(source_client_)),
- std::move(connection_request_));
+ mojo::MakeStrongBinding(base::MakeUnique<SerialConnection>(
+ io_handler_, std::move(sink_), std::move(source_),
+ mojo::MakeProxy(std::move(source_client_))),
+ std::move(connection_request_));
}
} // namespace device
« no previous file with comments | « device/serial/serial_connection.cc ('k') | device/serial/serial_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698