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

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

Issue 2660733002: Mojo C++ bindings: introduce an optional array to store transferred interface IDs in messages. (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/lib/bindings_internal.h
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h
index 494abe3f9e43ad0b9ed31ae86bf5cd02c1e8b1a1..631daec392e1b9e558a87a198265af474cf953a0 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -124,6 +124,8 @@ struct Pointer {
};
static_assert(sizeof(Pointer<char>) == 8, "Bad_sizeof(Pointer)");
+using GenericPointer = Pointer<void>;
+
struct Handle_Data {
Handle_Data() = default;
explicit Handle_Data(uint32_t value) : value(value) {}
@@ -140,19 +142,24 @@ struct Interface_Data {
};
static_assert(sizeof(Interface_Data) == 8, "Bad_sizeof(Interface_Data)");
+struct AssociatedEndpointHandle_Data {
+ AssociatedEndpointHandle_Data() = default;
+ explicit AssociatedEndpointHandle_Data(uint32_t value) : value(value) {}
+
+ bool is_valid() const { return value != kEncodedInvalidHandleValue; }
+
+ uint32_t value;
+};
+static_assert(sizeof(AssociatedEndpointHandle_Data) == 4,
+ "Bad_sizeof(AssociatedEndpointHandle_Data)");
+
struct AssociatedInterface_Data {
- InterfaceId interface_id;
+ AssociatedEndpointHandle_Data handle;
uint32_t version;
};
static_assert(sizeof(AssociatedInterface_Data) == 8,
"Bad_sizeof(AssociatedInterface_Data)");
-struct AssociatedInterfaceRequest_Data {
- InterfaceId interface_id;
-};
-static_assert(sizeof(AssociatedInterfaceRequest_Data) == 4,
- "Bad_sizeof(AssociatedInterfaceRequest_Data)");
-
#pragma pack(pop)
template <typename T>
@@ -234,7 +241,7 @@ struct MojomTypeTraits<AssociatedInterfacePtrInfoDataView<T>, false> {
template <typename T>
struct MojomTypeTraits<AssociatedInterfaceRequestDataView<T>, false> {
- using Data = AssociatedInterfaceRequest_Data;
+ using Data = AssociatedEndpointHandle_Data;
using DataAsArrayElement = Data;
static const MojomTypeCategory category =
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.h ('k') | mojo/public/cpp/bindings/lib/control_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698