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

Unified 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 side-by-side diff with in-line comments
Download patch
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 3051c1c2368eb9d3a213dec457823c725e6dd00b..adfba70b57ec36ec0c961b95278cf113a6ec4915 100644
--- a/mojo/public/cpp/bindings/lib/validation_util.cc
+++ b/mojo/public/cpp/bindings/lib/validation_util.cc
@@ -134,5 +134,14 @@ bool ValidateAssociatedInterfaceId(InterfaceId input) {
return false;
}
+bool ValidateNative(const NativePointer& input, BoundsChecker* bounds_checker) {
+ if (!ValidateEncodedPointer(&input.offset)) {
+ ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
+ return false;
+ }
+
+ 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.
+}
+
} // namespace internal
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698