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

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..d9dee37478c4b2a311c4be6def1ab05b143498d0 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,
+ // Message deserialization failure, for 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_context.cc ('k') | mojo/public/cpp/bindings/lib/validation_errors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698