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 4a7e30563ed16af98cc69174bee9b2220e044b21..a1aa2f9e0956eca209720c8794b2e05fdc48a0ff 100644 |
--- a/mojo/public/cpp/bindings/lib/validation_util.cc |
+++ b/mojo/public/cpp/bindings/lib/validation_util.cc |
@@ -68,41 +68,6 @@ bool ValidateUnionHeaderAndClaimMemory(const void* data, |
return true; |
} |
-bool ValidateMessageIsRequestWithoutResponse( |
- const Message* message, |
- ValidationContext* validation_context) { |
- if (message->has_flag(Message::kFlagIsResponse) || |
- message->has_flag(Message::kFlagExpectsResponse)) { |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS); |
- return false; |
- } |
- return true; |
-} |
- |
-bool ValidateMessageIsRequestExpectingResponse( |
- const Message* message, |
- ValidationContext* validation_context) { |
- if (message->has_flag(Message::kFlagIsResponse) || |
- !message->has_flag(Message::kFlagExpectsResponse)) { |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS); |
- return false; |
- } |
- return true; |
-} |
- |
-bool ValidateMessageIsResponse(const Message* message, |
- ValidationContext* validation_context) { |
- if (message->has_flag(Message::kFlagExpectsResponse) || |
- !message->has_flag(Message::kFlagIsResponse)) { |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS); |
- return false; |
- } |
- return true; |
-} |
- |
bool ValidateControlRequest(const Message* message, |
ValidationContext* validation_context) { |
switch (message->header()->name) { |
@@ -132,111 +97,5 @@ bool ValidateControlResponse(const Message* message, |
return false; |
} |
-bool IsHandleOrInterfaceValid(const AssociatedInterface_Data& input) { |
- return IsValidInterfaceId(input.interface_id); |
-} |
- |
-bool IsHandleOrInterfaceValid(const AssociatedInterfaceRequest_Data& input) { |
- return IsValidInterfaceId(input.interface_id); |
-} |
- |
-bool IsHandleOrInterfaceValid(const Interface_Data& input) { |
- return input.handle.is_valid(); |
-} |
- |
-bool IsHandleOrInterfaceValid(const Handle_Data& input) { |
- return input.is_valid(); |
-} |
- |
-bool ValidateHandleOrInterfaceNonNullable( |
- const AssociatedInterface_Data& input, |
- const char* error_message, |
- ValidationContext* validation_context) { |
- if (IsHandleOrInterfaceValid(input)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID, |
- error_message); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterfaceNonNullable( |
- const AssociatedInterfaceRequest_Data& input, |
- const char* error_message, |
- ValidationContext* validation_context) { |
- if (IsHandleOrInterfaceValid(input)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID, |
- error_message); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterfaceNonNullable( |
- const Interface_Data& input, |
- const char* error_message, |
- ValidationContext* validation_context) { |
- if (IsHandleOrInterfaceValid(input)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
- error_message); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterfaceNonNullable( |
- const Handle_Data& input, |
- const char* error_message, |
- ValidationContext* validation_context) { |
- if (IsHandleOrInterfaceValid(input)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE, |
- error_message); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterface(const AssociatedInterface_Data& input, |
- ValidationContext* validation_context) { |
- if (!IsMasterInterfaceId(input.interface_id)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_ILLEGAL_INTERFACE_ID); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterface(const AssociatedInterfaceRequest_Data& input, |
- ValidationContext* validation_context) { |
- if (!IsMasterInterfaceId(input.interface_id)) |
- return true; |
- |
- ReportValidationError(validation_context, |
- VALIDATION_ERROR_ILLEGAL_INTERFACE_ID); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterface(const Interface_Data& input, |
- ValidationContext* validation_context) { |
- if (validation_context->ClaimHandle(input.handle)) |
- return true; |
- |
- ReportValidationError(validation_context, VALIDATION_ERROR_ILLEGAL_HANDLE); |
- return false; |
-} |
- |
-bool ValidateHandleOrInterface(const Handle_Data& input, |
- ValidationContext* validation_context) { |
- if (validation_context->ClaimHandle(input)) |
- return true; |
- |
- ReportValidationError(validation_context, VALIDATION_ERROR_ILLEGAL_HANDLE); |
- return false; |
-} |
- |
} // namespace internal |
} // namespace mojo |