| 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 22 matching lines...) Expand all Loading... |
| 33 case VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE: | 33 case VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE: |
| 34 return "VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE"; | 34 return "VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE"; |
| 35 case VALIDATION_ERROR_ILLEGAL_POINTER: | 35 case VALIDATION_ERROR_ILLEGAL_POINTER: |
| 36 return "VALIDATION_ERROR_ILLEGAL_POINTER"; | 36 return "VALIDATION_ERROR_ILLEGAL_POINTER"; |
| 37 case VALIDATION_ERROR_UNEXPECTED_NULL_POINTER: | 37 case VALIDATION_ERROR_UNEXPECTED_NULL_POINTER: |
| 38 return "VALIDATION_ERROR_UNEXPECTED_NULL_POINTER"; | 38 return "VALIDATION_ERROR_UNEXPECTED_NULL_POINTER"; |
| 39 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION: | 39 case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION: |
| 40 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION"; | 40 return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION"; |
| 41 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID: | 41 case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID: |
| 42 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID"; | 42 return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID"; |
| 43 case VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP: |
| 44 return "VALIDATION_ERROR_DIFFERENT_SIZED_ARRAYS_IN_MAP"; |
| 43 } | 45 } |
| 44 | 46 |
| 45 return "Unknown error"; | 47 return "Unknown error"; |
| 46 } | 48 } |
| 47 | 49 |
| 48 void ReportValidationError(ValidationError error, const char* description) { | 50 void ReportValidationError(ValidationError error, const char* description) { |
| 49 if (g_validation_error_observer) { | 51 if (g_validation_error_observer) { |
| 50 g_validation_error_observer->set_last_error(error); | 52 g_validation_error_observer->set_last_error(error); |
| 51 } else if (description) { | 53 } else if (description) { |
| 52 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) | 54 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 83 } | 85 } |
| 84 | 86 |
| 85 SerializationWarningObserverForTesting:: | 87 SerializationWarningObserverForTesting:: |
| 86 ~SerializationWarningObserverForTesting() { | 88 ~SerializationWarningObserverForTesting() { |
| 87 MOJO_DCHECK(g_serialization_warning_observer == this); | 89 MOJO_DCHECK(g_serialization_warning_observer == this); |
| 88 g_serialization_warning_observer = nullptr; | 90 g_serialization_warning_observer = nullptr; |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace internal | 93 } // namespace internal |
| 92 } // namespace mojo | 94 } // namespace mojo |
| OLD | NEW |