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

Side by Side Diff: mojo/public/cpp/bindings/lib/validation_errors.h

Issue 473793004: Mojo C++ bindings: better log message for serialization warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
7 7
8 #include "mojo/public/cpp/system/macros.h" 8 #include "mojo/public/cpp/system/macros.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 // In debug build, logs a serialization warning if |condition| evaluates to 94 // In debug build, logs a serialization warning if |condition| evaluates to
95 // true: 95 // true:
96 // - if there is a SerializationWarningObserverForTesting object alive, 96 // - if there is a SerializationWarningObserverForTesting object alive,
97 // records |error| in it; 97 // records |error| in it;
98 // - otherwise, logs a fatal-level message. 98 // - otherwise, logs a fatal-level message.
99 // |error| is the validation error that will be triggered by the receiver 99 // |error| is the validation error that will be triggered by the receiver
100 // of the serialzation result. 100 // of the serialzation result.
101 // 101 //
102 // In non-debug build, does nothing (not even compiling |condition|). 102 // In non-debug build, does nothing (not even compiling |condition|).
103 #define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(condition, error) \ 103 #define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( \
104 MOJO_DLOG_IF(FATAL, (condition) && !ReportSerializationWarning(error)) \ 104 condition, error, description) \
105 << "The outgoing message will trigger " \ 105 MOJO_DLOG_IF(FATAL, (condition) && !ReportSerializationWarning(error)) \
106 << ValidationErrorToString(error) << " at the receiving side."; 106 << "The outgoing message will trigger " \
107 << ValidationErrorToString(error) << " at the receiving side (" \
108 << description << ").";
107 109
108 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ 110 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698