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

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

Issue 1526533002: [mojo] Add pickling support for native-only structs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-4-bool-deserialize
Patch Set: Created 5 years 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 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 #include "mojo/public/cpp/bindings/lib/validation_util.h" 5 #include "mojo/public/cpp/bindings/lib/validation_util.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" 9 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
10 #include "mojo/public/cpp/bindings/lib/message_internal.h" 10 #include "mojo/public/cpp/bindings/lib/message_internal.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 bool ValidateAssociatedInterfaceId(InterfaceId input) { 129 bool ValidateAssociatedInterfaceId(InterfaceId input) {
130 if (!IsMasterInterfaceId(input)) 130 if (!IsMasterInterfaceId(input))
131 return true; 131 return true;
132 132
133 ReportValidationError(VALIDATION_ERROR_ILLEGAL_INTERFACE_ID); 133 ReportValidationError(VALIDATION_ERROR_ILLEGAL_INTERFACE_ID);
134 return false; 134 return false;
135 } 135 }
136 136
137 bool ValidateNative(const NativePointer& input, BoundsChecker* bounds_checker) {
138 if (!ValidateEncodedPointer(&input.offset)) {
139 ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
140 return false;
141 }
142
143 return true;
yzshen1 2015/12/15 21:20:27 I think here we need to use the Validate() of Arra
Ken Rockot(use gerrit already) 2015/12/15 23:31:07 Done.
144 }
145
137 } // namespace internal 146 } // namespace internal
138 } // namespace mojo 147 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698