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

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

Issue 1781573004: Mojo C++ bindings: error notification behavior related to sync calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/router.h
diff --git a/mojo/public/cpp/bindings/lib/router.h b/mojo/public/cpp/bindings/lib/router.h
index 2fec5d2c7c7396df353dcf1eefc808f796dc7ff0..6374f18a59bb4be8b4e9a68091e4d6b0b5748568 100644
--- a/mojo/public/cpp/bindings/lib/router.h
+++ b/mojo/public/cpp/bindings/lib/router.h
@@ -37,14 +37,14 @@ class Router : public MessageReceiverWithResponder {
// 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_connection_error_handler(const Closure& error_handler) {
- connector_.set_connection_error_handler(error_handler);
+ error_handler_ = error_handler;
}
// Returns true if an error was encountered while reading from the pipe or
// waiting to read from the pipe.
bool encountered_error() const {
DCHECK(thread_checker_.CalledOnValidThread());
- return connector_.encountered_error();
+ return encountered_error_;
}
// Is the router bound to a MessagePipe handle?
@@ -143,9 +143,10 @@ class Router : public MessageReceiverWithResponder {
bool HandleIncomingMessage(Message* message);
void HandleQueuedMessages();
-
bool HandleMessageInternal(Message* message);
+ void OnConnectionError();
+
HandleIncomingMessageThunk thunk_;
FilterChain filters_;
Connector connector_;
@@ -158,6 +159,8 @@ class Router : public MessageReceiverWithResponder {
// Whether a task has been posted to trigger processing of
// |pending_messages_|.
bool pending_task_for_messages_;
+ bool encountered_error_;
+ Closure error_handler_;
base::ThreadChecker thread_checker_;
base::WeakPtrFactory<Router> weak_factory_;
};
« no previous file with comments | « mojo/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698