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

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

Issue 150713002: Mojo: Add ErrorHandler to RemotePtr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update per review feedback Created 6 years, 11 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 | « mojo/public/bindings/error_handler.h ('k') | mojo/public/bindings/lib/connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/lib/connector.h
diff --git a/mojo/public/bindings/lib/connector.h b/mojo/public/bindings/lib/connector.h
index e51549abf93f221c230eed1a16456c2c05917e63..3cacc5eda0f18c01d8db7201f280ab11b36881e4 100644
--- a/mojo/public/bindings/lib/connector.h
+++ b/mojo/public/bindings/lib/connector.h
@@ -11,6 +11,8 @@
#include "mojo/public/system/core_cpp.h"
namespace mojo {
+class ErrorHandler;
+
namespace internal {
// The Connector class is responsible for performing read/write operations on a
@@ -30,7 +32,15 @@ class Connector : public MessageReceiver {
// Sets the receiver to handle messages read from the message pipe. The
// Connector will only read messages from the pipe if an incoming receiver
// has been set.
- void SetIncomingReceiver(MessageReceiver* receiver);
+ void set_incoming_receiver(MessageReceiver* receiver) {
+ incoming_receiver_ = receiver;
+ }
+
+ // Sets the error handler to receives 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;
+ }
// Returns true if an error was encountered while reading from or writing to
// the message pipe.
@@ -40,12 +50,14 @@ class Connector : public MessageReceiver {
virtual bool Accept(Message* message) MOJO_OVERRIDE;
private:
- static void OnHandleReady(void* closure, MojoResult result);
+ static void CallOnHandleReady(void* closure, MojoResult result);
+ void OnHandleReady(MojoResult result);
void WaitToReadMore();
void ReadMore();
void WriteOne(Message* message);
+ ErrorHandler* error_handler_;
MojoAsyncWaiter* waiter_;
ScopedMessagePipeHandle message_pipe_;
« no previous file with comments | « mojo/public/bindings/error_handler.h ('k') | mojo/public/bindings/lib/connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698