| 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 "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "mojo/public/cpp/bindings/message.h" | 8 #include "mojo/public/cpp/bindings/message.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (description) { | 71 if (description) { |
| 72 LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) << " (" | 72 LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) << " (" |
| 73 << description << ")"; | 73 << description << ")"; |
| 74 if (context->message()) { | 74 if (context->message()) { |
| 75 context->message()->NotifyBadMessage( | 75 context->message()->NotifyBadMessage( |
| 76 base::StringPrintf("Validation failed for %s [%s (%s)]", | 76 base::StringPrintf("Validation failed for %s [%s (%s)]", |
| 77 context->description().data(), | 77 context->description().data(), |
| 78 ValidationErrorToString(error), description)); | 78 ValidationErrorToString(error), description)); |
| 79 } | 79 } |
| 80 } else { | 80 } else { |
| 81 LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error); | 81 NOTREACHED() << "Invalid message: " << ValidationErrorToString(error); |
| 82 if (context->message()) { | 82 if (context->message()) { |
| 83 context->message()->NotifyBadMessage( | 83 context->message()->NotifyBadMessage( |
| 84 base::StringPrintf("Validation failed for %s [%s]", | 84 base::StringPrintf("Validation failed for %s [%s]", |
| 85 context->description().data(), | 85 context->description().data(), |
| 86 ValidationErrorToString(error))); | 86 ValidationErrorToString(error))); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting( | 91 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 SerializationWarningObserverForTesting:: | 118 SerializationWarningObserverForTesting:: |
| 119 ~SerializationWarningObserverForTesting() { | 119 ~SerializationWarningObserverForTesting() { |
| 120 DCHECK(g_serialization_warning_observer == this); | 120 DCHECK(g_serialization_warning_observer == this); |
| 121 g_serialization_warning_observer = nullptr; | 121 g_serialization_warning_observer = nullptr; |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace internal | 124 } // namespace internal |
| 125 } // namespace mojo | 125 } // namespace mojo |
| OLD | NEW |