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

Unified Diff: mojo/public/cpp/bindings/interface_endpoint_client.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/connection_error_callback.h ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_endpoint_client.h
diff --git a/mojo/public/cpp/bindings/interface_endpoint_client.h b/mojo/public/cpp/bindings/interface_endpoint_client.h
index e16bcd0a4884d420bb2782698bfe2d4bd87c6a59..4a24a31f8b18f802564bb103ba8f7a2f9ace4dfc 100644
--- a/mojo/public/cpp/bindings/interface_endpoint_client.h
+++ b/mojo/public/cpp/bindings/interface_endpoint_client.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/filter_chain.h"
#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/lib/control_message_proxy.h"
@@ -49,6 +50,14 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
void set_connection_error_handler(const base::Closure& error_handler) {
DCHECK(thread_checker_.CalledOnValidThread());
error_handler_ = error_handler;
+ error_with_reason_handler_.Reset();
+ }
+
+ void set_connection_error_with_reason_handler(
+ const ConnectionErrorWithReasonCallback& error_handler) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ error_with_reason_handler_ = error_handler;
+ error_handler_.Reset();
}
// Returns true if an error was encountered.
@@ -150,6 +159,7 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
uint64_t next_request_id_;
base::Closure error_handler_;
+ ConnectionErrorWithReasonCallback error_with_reason_handler_;
bool encountered_error_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
« no previous file with comments | « mojo/public/cpp/bindings/connection_error_callback.h ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698