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

Unified Diff: mojo/public/cpp/bindings/lib/connector.cc

Issue 1174073002: C++ bindings: support using a callback as connection error handler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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: mojo/public/cpp/bindings/lib/connector.cc
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index 89499dccce9d11f8ad31a05b7d341f6db1253404..24d993d12865f4fb5b33fba537903b20daeba34a 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -14,8 +14,7 @@ namespace internal {
Connector::Connector(ScopedMessagePipeHandle message_pipe,
const MojoAsyncWaiter* waiter)
- : error_handler_(nullptr),
- waiter_(waiter),
+ : waiter_(waiter),
message_pipe_(message_pipe.Pass()),
incoming_receiver_(nullptr),
async_wait_id_(0),
@@ -198,8 +197,7 @@ void Connector::CancelWait() {
void Connector::NotifyError() {
error_ = true;
CloseMessagePipe();
- if (error_handler_)
- error_handler_->OnConnectionError();
+ connection_error_handler_.Run();
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698