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

Unified Diff: mojo/public/cpp/bindings/interface_endpoint_client.h

Issue 2649573004: Mojo bindings: merge the control messages of sending disconnect reason and notifying endpoint close… (Closed)
Patch Set: Created 3 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
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 6129d75bbf7511716d6a511bfaa5fa67a972b47d..cbab4238a125f9a8e629cb2050438059b60e5c97 100644
--- a/mojo/public/cpp/bindings/interface_endpoint_client.h
+++ b/mojo/public/cpp/bindings/interface_endpoint_client.h
@@ -17,10 +17,12 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
+#include "base/optional.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
#include "mojo/public/cpp/bindings/bindings_export.h"
#include "mojo/public/cpp/bindings/connection_error_callback.h"
+#include "mojo/public/cpp/bindings/disconnect_reason.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"
@@ -94,6 +96,8 @@ class MOJO_CPP_BINDINGS_EXPORT InterfaceEndpointClient
// and notifies all interfaces running on this pipe.
void RaiseError();
+ void CloseWithReason(uint32_t custom_reason, const std::string& description);
+
// MessageReceiverWithResponder implementation:
bool Accept(Message* message) override;
bool AcceptWithResponder(Message* message,
@@ -104,7 +108,7 @@ class MOJO_CPP_BINDINGS_EXPORT InterfaceEndpointClient
// NOTE: |message| must have passed message header validation.
bool HandleIncomingMessage(Message* message);
- void NotifyError();
+ void NotifyError(const base::Optional<DisconnectReason>& reason);
internal::ControlMessageProxy* control_message_proxy() {
return &control_message_proxy_;

Powered by Google App Engine
This is Rietveld 408576698