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

Unified Diff: mojo/public/cpp/bindings/lib/validation_errors.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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/lib/validation_errors.h
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.h b/mojo/public/cpp/bindings/lib/validation_errors.h
index bdace6c297523cf5a95c434ec2b95ca2906cf357..b09e3e047e66cb0dc315209a03e8779f0509d76e 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.h
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/public/cpp/bindings/lib/validation_context.h"
namespace mojo {
namespace internal {
@@ -62,12 +63,16 @@ enum ValidationError {
// Attempted to deserialize a tagged union with an unknown tag.
VALIDATION_ERROR_UNKNOWN_UNION_TAG,
// A value of a non-extensible enum type is unknown.
- VALIDATION_ERROR_UNKNOWN_ENUM_VALUE
+ VALIDATION_ERROR_UNKNOWN_ENUM_VALUE,
+ // Deserialization of some message parameter or struct field failed, for
yzshen1 2016/06/15 22:20:09 nit: maybe simply say "Message deserialization fai
Ken Rockot(use gerrit already) 2016/06/15 22:38:23 Done
+ // example due to rejection by custom validation logic.
+ VALIDATION_ERROR_DESERIALIZATION_FAILED,
};
const char* ValidationErrorToString(ValidationError error);
-void ReportValidationError(ValidationError error,
+void ReportValidationError(ValidationContext* context,
+ ValidationError error,
const char* description = nullptr);
// Only used by validation tests and when there is only one thread doing message

Powered by Google App Engine
This is Rietveld 408576698