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

Unified Diff: mojo/public/cpp/bindings/lib/validation_util.cc

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
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_util.h ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/validation_util.cc
diff --git a/mojo/public/cpp/bindings/lib/validation_util.cc b/mojo/public/cpp/bindings/lib/validation_util.cc
index 9675afe8e0a851ec1403ffa13b2c01d0a1eb2106..7614df5cbc261537f9139509954a44ceb558bfba 100644
--- a/mojo/public/cpp/bindings/lib/validation_util.cc
+++ b/mojo/public/cpp/bindings/lib/validation_util.cc
@@ -101,11 +101,11 @@ bool ValidateMessageIsResponse(const Message* message,
}
bool IsHandleOrInterfaceValid(const AssociatedInterface_Data& input) {
- return IsValidInterfaceId(input.interface_id);
+ return input.handle.is_valid();
}
-bool IsHandleOrInterfaceValid(const AssociatedInterfaceRequest_Data& input) {
- return IsValidInterfaceId(input.interface_id);
+bool IsHandleOrInterfaceValid(const AssociatedEndpointHandle_Data& input) {
+ return input.is_valid();
}
bool IsHandleOrInterfaceValid(const Interface_Data& input) {
@@ -130,7 +130,7 @@ bool ValidateHandleOrInterfaceNonNullable(
}
bool ValidateHandleOrInterfaceNonNullable(
- const AssociatedInterfaceRequest_Data& input,
+ const AssociatedEndpointHandle_Data& input,
const char* error_message,
ValidationContext* validation_context) {
if (IsHandleOrInterfaceValid(input))
@@ -170,7 +170,7 @@ bool ValidateHandleOrInterfaceNonNullable(
bool ValidateHandleOrInterface(const AssociatedInterface_Data& input,
ValidationContext* validation_context) {
- if (!IsMasterInterfaceId(input.interface_id))
+ if (validation_context->ClaimAssociatedEndpointHandle(input.handle))
return true;
ReportValidationError(validation_context,
@@ -178,9 +178,9 @@ bool ValidateHandleOrInterface(const AssociatedInterface_Data& input,
return false;
}
-bool ValidateHandleOrInterface(const AssociatedInterfaceRequest_Data& input,
+bool ValidateHandleOrInterface(const AssociatedEndpointHandle_Data& input,
ValidationContext* validation_context) {
- if (!IsMasterInterfaceId(input.interface_id))
+ if (validation_context->ClaimAssociatedEndpointHandle(input))
return true;
ReportValidationError(validation_context,
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_util.h ('k') | mojo/public/cpp/bindings/message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698