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

Side by Side Diff: mojo/public/cpp/bindings/lib/validate_params.h

Issue 2064903002: Mojo: Report bindings validation errors via MojoNotifyBadMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace internal { 13 namespace internal {
14 14
15 using ValidateEnumFunc = bool (*)(int32_t); 15 class ValidationContext;
16
17 using ValidateEnumFunc = bool (*)(int32_t, ValidationContext*);
16 18
17 class ContainerValidateParams { 19 class ContainerValidateParams {
18 public: 20 public:
19 // Validates a map. A map is validated as a pair of arrays, one for the keys 21 // Validates a map. A map is validated as a pair of arrays, one for the keys
20 // and one for the values. Both arguments must be non-null. 22 // and one for the values. Both arguments must be non-null.
21 // 23 //
22 // ContainerValidateParams takes ownership of |in_key_validate params| and 24 // ContainerValidateParams takes ownership of |in_key_validate params| and
23 // |in_element_validate params|. 25 // |in_element_validate params|.
24 ContainerValidateParams(ContainerValidateParams* in_key_validate_params, 26 ContainerValidateParams(ContainerValidateParams* in_key_validate_params,
25 ContainerValidateParams* in_element_validate_params) 27 ContainerValidateParams* in_element_validate_params)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 ValidateEnumFunc validate_enum_func = nullptr; 79 ValidateEnumFunc validate_enum_func = nullptr;
78 80
79 private: 81 private:
80 DISALLOW_COPY_AND_ASSIGN(ContainerValidateParams); 82 DISALLOW_COPY_AND_ASSIGN(ContainerValidateParams);
81 }; 83 };
82 84
83 } // namespace internal 85 } // namespace internal
84 } // namespace mojo 86 } // namespace mojo
85 87
86 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_ 88 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATE_PARAMS_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc ('k') | mojo/public/cpp/bindings/lib/validation_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698