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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( |
92 const base::Closure& callback) | 92 const Callback<void()>& callback) |
93 : last_error_(VALIDATION_ERROR_NONE), callback_(callback) { | 93 : last_error_(VALIDATION_ERROR_NONE), callback_(callback) { |
94 DCHECK(!g_validation_error_observer); | 94 DCHECK(!g_validation_error_observer); |
95 g_validation_error_observer = this; | 95 g_validation_error_observer = this; |
96 } | 96 } |
97 | 97 |
98 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() { | 98 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() { |
99 DCHECK(g_validation_error_observer == this); | 99 DCHECK(g_validation_error_observer == this); |
100 g_validation_error_observer = nullptr; | 100 g_validation_error_observer = nullptr; |
101 } | 101 } |
102 | 102 |
(...skipping 13 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 |