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

Unified Diff: mojo/public/cpp/bindings/connection_error_callback.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/binding_set.h ('k') | mojo/public/cpp/bindings/interface_endpoint_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/connection_error_callback.h
diff --git a/mojo/public/cpp/bindings/connection_error_callback.h b/mojo/public/cpp/bindings/connection_error_callback.h
new file mode 100644
index 0000000000000000000000000000000000000000..306e99e45b3462478b759afba74fb794dfa75dc1
--- /dev/null
+++ b/mojo/public/cpp/bindings/connection_error_callback.h
@@ -0,0 +1,21 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
+
+#include "base/callback.h"
+
+namespace mojo {
+
+// This callback type accepts user-defined disconnect reason and description. If
+// the other side specifies a reason on closing the connection, it will be
+// passed to the error handler.
+using ConnectionErrorWithReasonCallback =
+ base::Callback<void(uint32_t /* custom_reason */,
+ const std::string& /* description */)>;
+
+} // namespace mojo
+
+#endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
« no previous file with comments | « mojo/public/cpp/bindings/binding_set.h ('k') | mojo/public/cpp/bindings/interface_endpoint_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698