Chromium Code Reviews| 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 43059c2e22b8ee6c18a089b1381bbdf4df66edb2..0364bae2ae1842e8bc116ecad9e3c5f3c6c5af37 100644 |
| --- a/mojo/public/cpp/bindings/lib/validation_errors.h |
| +++ b/mojo/public/cpp/bindings/lib/validation_errors.h |
| @@ -119,4 +119,16 @@ class SerializationWarningObserverForTesting { |
| << ValidationErrorToString(error) << " at the receiving side (" \ |
| << description << ")."; |
|
viettrungluu
2015/10/06 16:40:06
Drive-by: It's rather odd that this macro ends wit
vardhan
2015/10/06 22:57:14
Done.
|
| +// If condition is true, we either report or make a fatal log message, and then |
| +// return. |
| +#define MOJO_INTERNAL_SERIALIZATION_CHECK_AND_RETURN(condition, return_code, \ |
|
viettrungluu
2015/10/06 16:40:06
(This is not a well-written macro, for a number of
vardhan
2015/10/06 22:57:14
Ah, I didn't think about this enough, that's a goo
|
| + description) \ |
| + if (condition) { \ |
| + MOJO_DLOG_IF(FATAL, !ReportSerializationWarning(return_code)) \ |
| + << "The outgoing message will trigger " \ |
| + << ValidationErrorToString(return_code) << " at the receiving side (" \ |
| + << description << ")."; \ |
| + return return_code; \ |
|
viettrungluu
2015/10/06 16:40:06
But in general, I don't think it's a good idea to
vardhan
2015/10/06 22:57:14
I did something like [2]. PTAL!
|
| + } |
| + |
| #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ |