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

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

Issue 2318793002: Mojo C++ bindings: support disconnect with a reason. (Closed)
Patch Set: . 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 | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('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 751cb260c352fb04ff38916182123147022aa758..d51dceda878a278a09462b2e2ede7b74269133af 100644
--- a/mojo/public/cpp/bindings/lib/router.h
+++ b/mojo/public/cpp/bindings/lib/router.h
@@ -17,6 +17,7 @@
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
+#include "mojo/public/cpp/bindings/connection_error_callback.h"
#include "mojo/public/cpp/bindings/connector.h"
#include "mojo/public/cpp/bindings/filter_chain.h"
#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
@@ -47,6 +48,12 @@ class Router : public MessageReceiverWithResponder {
// encountered while reading from the pipe or waiting to read from the pipe.
void set_connection_error_handler(const base::Closure& error_handler) {
error_handler_ = error_handler;
+ error_with_reason_handler_.Reset();
+ }
+ void set_connection_error_with_reason_handler(
+ const ConnectionErrorWithReasonCallback& error_handler) {
+ error_with_reason_handler_ = error_handler;
+ error_handler_.Reset();
}
// Returns true if an error was encountered while reading from the pipe or
@@ -179,6 +186,7 @@ class Router : public MessageReceiverWithResponder {
bool pending_task_for_messages_;
bool encountered_error_;
base::Closure error_handler_;
+ ConnectionErrorWithReasonCallback error_with_reason_handler_;
ControlMessageProxy control_message_proxy_;
ControlMessageHandler control_message_handler_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('k') | mojo/public/cpp/bindings/lib/router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698