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

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

Issue 613053002: Mojo: NULL -> nullptr in mojo/public/cpp/bindings and also for the bindings generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // |flags| in the message header is an invalid flag combination. 42 // |flags| in the message header is an invalid flag combination.
43 VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION, 43 VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION,
44 // |flags| in the message header indicates that a request ID is required but 44 // |flags| in the message header indicates that a request ID is required but
45 // there isn't one. 45 // there isn't one.
46 VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID, 46 VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID,
47 }; 47 };
48 48
49 const char* ValidationErrorToString(ValidationError error); 49 const char* ValidationErrorToString(ValidationError error);
50 50
51 void ReportValidationError(ValidationError error, 51 void ReportValidationError(ValidationError error,
52 const char* description = NULL); 52 const char* description = nullptr);
53 53
54 // Only used by validation tests and when there is only one thread doing message 54 // Only used by validation tests and when there is only one thread doing message
55 // validation. 55 // validation.
56 class ValidationErrorObserverForTesting { 56 class ValidationErrorObserverForTesting {
57 public: 57 public:
58 ValidationErrorObserverForTesting(); 58 ValidationErrorObserverForTesting();
59 ~ValidationErrorObserverForTesting(); 59 ~ValidationErrorObserverForTesting();
60 60
61 ValidationError last_error() const { return last_error_; } 61 ValidationError last_error() const { return last_error_; }
62 void set_last_error(ValidationError error) { last_error_ = error; } 62 void set_last_error(ValidationError error) { last_error_ = error; }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // 102 //
103 // In non-debug build, does nothing (not even compiling |condition|). 103 // In non-debug build, does nothing (not even compiling |condition|).
104 #define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( \ 104 #define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( \
105 condition, error, description) \ 105 condition, error, description) \
106 MOJO_DLOG_IF(FATAL, (condition) && !ReportSerializationWarning(error)) \ 106 MOJO_DLOG_IF(FATAL, (condition) && !ReportSerializationWarning(error)) \
107 << "The outgoing message will trigger " \ 107 << "The outgoing message will trigger " \
108 << ValidationErrorToString(error) << " at the receiving side (" \ 108 << ValidationErrorToString(error) << " at the receiving side (" \
109 << description << ")."; 109 << description << ").";
110 110
111 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ 111 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/string_serialization.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