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

Unified Diff: mojo/public/cpp/bindings/scoped_interface_endpoint_handle.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/scoped_interface_endpoint_handle.h
diff --git a/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h b/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
index 869c471a1315dc49834ea42c56382966012b9296..be57f20be5c68a842b0eebbc44dee60a5b62a354 100644
--- a/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
+++ b/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
@@ -5,9 +5,13 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_
#define MOJO_PUBLIC_CPP_BINDINGS_SCOPED_INTERFACE_ENDPOINT_HANDLE_H_
+#include <string>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/optional.h"
#include "mojo/public/cpp/bindings/bindings_export.h"
+#include "mojo/public/cpp/bindings/disconnect_reason.h"
#include "mojo/public/cpp/bindings/interface_id.h"
namespace mojo {
@@ -33,6 +37,8 @@ class MOJO_CPP_BINDINGS_EXPORT ScopedInterfaceEndpointHandle {
bool is_local() const { return is_local_; }
void reset();
+ void ResetWithReason(uint32_t custom_reason, const std::string& description);
+
void swap(ScopedInterfaceEndpointHandle& other);
// DO NOT USE METHODS BELOW THIS LINE. These are for internal use and testing.
@@ -58,6 +64,8 @@ class MOJO_CPP_BINDINGS_EXPORT ScopedInterfaceEndpointHandle {
bool is_local,
scoped_refptr<AssociatedGroupController> group_controller);
+ void ResetInternal(const base::Optional<DisconnectReason>& reason);
+
InterfaceId id_;
bool is_local_;
scoped_refptr<AssociatedGroupController> group_controller_;

Powered by Google App Engine
This is Rietveld 408576698