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

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

Issue 2280483002: Add FlushForTesting to InterfacePtr and Binding. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/router.cc ('k') | mojo/public/cpp/bindings/lib/validation_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_VALIDATION_UTIL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" 10 #include "mojo/public/cpp/bindings/lib/bindings_internal.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool ValidateMessageIsResponse(const Message* message, 71 bool ValidateMessageIsResponse(const Message* message,
72 ValidationContext* validation_context); 72 ValidationContext* validation_context);
73 73
74 // Validates that the message payload is a valid struct of type ParamsType. 74 // Validates that the message payload is a valid struct of type ParamsType.
75 template <typename ParamsType> 75 template <typename ParamsType>
76 bool ValidateMessagePayload(const Message* message, 76 bool ValidateMessagePayload(const Message* message,
77 ValidationContext* validation_context) { 77 ValidationContext* validation_context) {
78 return ParamsType::Validate(message->payload(), validation_context); 78 return ParamsType::Validate(message->payload(), validation_context);
79 } 79 }
80 80
81 // The following methods validate control messages defined in
82 // interface_control_messages.mojom.
83 bool ValidateControlRequest(const Message* message,
84 ValidationContext* validation_context);
85 bool ValidateControlResponse(const Message* message,
86 ValidationContext* validation_context);
87
88 // The following Validate.*NonNullable() functions validate that the given 81 // The following Validate.*NonNullable() functions validate that the given
89 // |input| is not null/invalid. 82 // |input| is not null/invalid.
90 template <typename T> 83 template <typename T>
91 bool ValidatePointerNonNullable(const T& input, 84 bool ValidatePointerNonNullable(const T& input,
92 const char* error_message, 85 const char* error_message,
93 ValidationContext* validation_context) { 86 ValidationContext* validation_context) {
94 if (input.offset) 87 if (input.offset)
95 return true; 88 return true;
96 89
97 ReportValidationError(validation_context, 90 ReportValidationError(validation_context,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ValidationContext* validation_context); 162 ValidationContext* validation_context);
170 bool ValidateHandleOrInterface(const Interface_Data& input, 163 bool ValidateHandleOrInterface(const Interface_Data& input,
171 ValidationContext* validation_context); 164 ValidationContext* validation_context);
172 bool ValidateHandleOrInterface(const Handle_Data& input, 165 bool ValidateHandleOrInterface(const Handle_Data& input,
173 ValidationContext* validation_context); 166 ValidationContext* validation_context);
174 167
175 } // namespace internal 168 } // namespace internal
176 } // namespace mojo 169 } // namespace mojo
177 170
178 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_ 171 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/router.cc ('k') | mojo/public/cpp/bindings/lib/validation_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698