| Index: mojo/public/cpp/bindings/lib/validation_util.h
|
| diff --git a/mojo/public/cpp/bindings/lib/validation_util.h b/mojo/public/cpp/bindings/lib/validation_util.h
|
| index 521ab5cb46cee55c5763e05234e1bfdf6c36cfb4..8de5569072cc034768e140e2a8d9cff65e8e3e2f 100644
|
| --- a/mojo/public/cpp/bindings/lib/validation_util.h
|
| +++ b/mojo/public/cpp/bindings/lib/validation_util.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include <stdint.h>
|
|
|
| +#include "mojo/public/cpp/bindings/bindings_export.h"
|
| #include "mojo/public/cpp/bindings/lib/bindings_internal.h"
|
| #include "mojo/public/cpp/bindings/lib/serialization_util.h"
|
| #include "mojo/public/cpp/bindings/lib/validate_params.h"
|
| @@ -46,30 +47,32 @@ bool ValidatePointer(const Pointer<T>& input,
|
| // |validation_context|. On success, the memory range is marked as occupied.
|
| // Note: Does not verify |version| or that |num_bytes| is correct for the
|
| // claimed version.
|
| -bool ValidateStructHeaderAndClaimMemory(const void* data,
|
| - ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateStructHeaderAndClaimMemory(
|
| + const void* data,
|
| + ValidationContext* validation_context);
|
|
|
| // Validates that |data| contains a valid union header, in terms of alignment
|
| // and size. It checks that the memory range [data, data + kUnionDataSize) is
|
| // not marked as occupied by other objects in |validation_context|. On success,
|
| // the memory range is marked as occupied.
|
| -bool ValidateNonInlinedUnionHeaderAndClaimMemory(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateNonInlinedUnionHeaderAndClaimMemory(
|
| const void* data,
|
| ValidationContext* validation_context);
|
|
|
| // Validates that the message is a request which doesn't expect a response.
|
| -bool ValidateMessageIsRequestWithoutResponse(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateMessageIsRequestWithoutResponse(
|
| const Message* message,
|
| ValidationContext* validation_context);
|
|
|
| // Validates that the message is a request expecting a response.
|
| -bool ValidateMessageIsRequestExpectingResponse(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateMessageIsRequestExpectingResponse(
|
| const Message* message,
|
| ValidationContext* validation_context);
|
|
|
| // Validates that the message is a response.
|
| -bool ValidateMessageIsResponse(const Message* message,
|
| - ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateMessageIsResponse(
|
| + const Message* message,
|
| + ValidationContext* validation_context);
|
|
|
| // Validates that the message payload is a valid struct of type ParamsType.
|
| template <typename ParamsType>
|
| @@ -106,24 +109,28 @@ bool ValidateInlinedUnionNonNullable(const T& input,
|
| return false;
|
| }
|
|
|
| -bool IsHandleOrInterfaceValid(const AssociatedInterface_Data& input);
|
| -bool IsHandleOrInterfaceValid(const AssociatedInterfaceRequest_Data& input);
|
| -bool IsHandleOrInterfaceValid(const Interface_Data& input);
|
| -bool IsHandleOrInterfaceValid(const Handle_Data& input);
|
| +MOJO_CPP_BINDINGS_EXPORT bool IsHandleOrInterfaceValid(
|
| + const AssociatedInterface_Data& input);
|
| +MOJO_CPP_BINDINGS_EXPORT bool IsHandleOrInterfaceValid(
|
| + const AssociatedInterfaceRequest_Data& input);
|
| +MOJO_CPP_BINDINGS_EXPORT bool IsHandleOrInterfaceValid(
|
| + const Interface_Data& input);
|
| +MOJO_CPP_BINDINGS_EXPORT bool IsHandleOrInterfaceValid(
|
| + const Handle_Data& input);
|
|
|
| -bool ValidateHandleOrInterfaceNonNullable(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterfaceNonNullable(
|
| const AssociatedInterface_Data& input,
|
| const char* error_message,
|
| ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterfaceNonNullable(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterfaceNonNullable(
|
| const AssociatedInterfaceRequest_Data& input,
|
| const char* error_message,
|
| ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterfaceNonNullable(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterfaceNonNullable(
|
| const Interface_Data& input,
|
| const char* error_message,
|
| ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterfaceNonNullable(
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterfaceNonNullable(
|
| const Handle_Data& input,
|
| const char* error_message,
|
| ValidationContext* validation_context);
|
| @@ -180,14 +187,18 @@ bool ValidateNonInlinedUnion(const Pointer<T>& input,
|
| T::Validate(input.Get(), validation_context, false);
|
| }
|
|
|
| -bool ValidateHandleOrInterface(const AssociatedInterface_Data& input,
|
| - ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterface(const AssociatedInterfaceRequest_Data& input,
|
| - ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterface(const Interface_Data& input,
|
| - ValidationContext* validation_context);
|
| -bool ValidateHandleOrInterface(const Handle_Data& input,
|
| - ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterface(
|
| + const AssociatedInterface_Data& input,
|
| + ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterface(
|
| + const AssociatedInterfaceRequest_Data& input,
|
| + ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterface(
|
| + const Interface_Data& input,
|
| + ValidationContext* validation_context);
|
| +MOJO_CPP_BINDINGS_EXPORT bool ValidateHandleOrInterface(
|
| + const Handle_Data& input,
|
| + ValidationContext* validation_context);
|
|
|
| } // namespace internal
|
| } // namespace mojo
|
|
|