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

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

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.h
diff --git a/mojo/public/cpp/bindings/lib/connector.h b/mojo/public/cpp/bindings/lib/connector.h
index 7a105c753ef58a4d1973e89a51883fb0a2a24c1f..a6c0d1b8dc79634e7ccf94ad78a0e62b30ff3fcf 100644
--- a/mojo/public/cpp/bindings/lib/connector.h
+++ b/mojo/public/cpp/bindings/lib/connector.h
@@ -6,6 +6,7 @@
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_
#include "mojo/public/c/environment/async_waiter.h"
+#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/public/cpp/bindings/lib/message_queue.h"
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/environment/environment.h"
@@ -47,8 +48,8 @@ class Connector : public MessageReceiver {
// Sets the error handler to receive notifications when an error is
// encountered while reading from the pipe or waiting to read from the pipe.
- void set_error_handler(ErrorHandler* error_handler) {
- error_handler_ = error_handler;
+ void set_connection_error_handler(const Closure& error_handler) {
+ connection_error_handler_ = error_handler;
}
// Returns true if an error was encountered while reading from the pipe or
@@ -93,7 +94,7 @@ class Connector : public MessageReceiver {
// Cancels any calls made to |waiter_|.
void CancelWait();
- ErrorHandler* error_handler_;
+ Closure connection_error_handler_;
const MojoAsyncWaiter* waiter_;
ScopedMessagePipeHandle message_pipe_;

Powered by Google App Engine
This is Rietveld 408576698