OLD | NEW |
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 #include "mojo/public/cpp/bindings/lib/validation_errors.h" | 5 #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
6 | 6 |
7 #include "mojo/public/cpp/environment/logging.h" | 7 #include "mojo/public/cpp/environment/logging.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 namespace internal { | 10 namespace internal { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS: | 43 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS: |
44 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS"; | 44 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS"; |
45 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID: | 45 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID: |
46 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID"; | 46 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID"; |
47 case VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD: | 47 case VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD: |
48 return "VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD"; | 48 return "VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD"; |
49 case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP: | 49 case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP: |
50 return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP"; | 50 return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP"; |
51 case VALIDATION_ERROR_UNKNOWN_UNION_TAG: | 51 case VALIDATION_ERROR_UNKNOWN_UNION_TAG: |
52 return "VALIDATION_ERROR_UNKNOWN_UNION_TAG"; | 52 return "VALIDATION_ERROR_UNKNOWN_UNION_TAG"; |
| 53 case VALIDATION_ERROR_UNKNOWN_ENUM_VALUE: |
| 54 return "VALIDATION_ERROR_UNKNOWN_ENUM_VALUE"; |
53 } | 55 } |
54 | 56 |
55 return "Unknown error"; | 57 return "Unknown error"; |
56 } | 58 } |
57 | 59 |
58 void ReportValidationError(ValidationError error, const char* description) { | 60 void ReportValidationError(ValidationError error, const char* description) { |
59 if (g_validation_error_observer) { | 61 if (g_validation_error_observer) { |
60 g_validation_error_observer->set_last_error(error); | 62 g_validation_error_observer->set_last_error(error); |
61 } else if (description) { | 63 } else if (description) { |
62 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) | 64 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 96 } |
95 | 97 |
96 SerializationWarningObserverForTesting:: | 98 SerializationWarningObserverForTesting:: |
97 ~SerializationWarningObserverForTesting() { | 99 ~SerializationWarningObserverForTesting() { |
98 MOJO_DCHECK(g_serialization_warning_observer == this); | 100 MOJO_DCHECK(g_serialization_warning_observer == this); |
99 g_serialization_warning_observer = nullptr; | 101 g_serialization_warning_observer = nullptr; |
100 } | 102 } |
101 | 103 |
102 } // namespace internal | 104 } // namespace internal |
103 } // namespace mojo | 105 } // namespace mojo |
OLD | NEW |