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

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

Issue 1552983003: Fix a bunch of mojo_public_*_unittests with the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 11 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 #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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (g_validation_error_observer) { 59 if (g_validation_error_observer) {
60 g_validation_error_observer->set_last_error(error); 60 g_validation_error_observer->set_last_error(error);
61 } else if (description) { 61 } else if (description) {
62 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error) 62 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error)
63 << " (" << description << ")"; 63 << " (" << description << ")";
64 } else { 64 } else {
65 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error); 65 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error);
66 } 66 }
67 } 67 }
68 68
69 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting() 69 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting(
70 : last_error_(VALIDATION_ERROR_NONE) { 70 const Callback<void()>& callback)
71 : last_error_(VALIDATION_ERROR_NONE), callback_(callback) {
71 MOJO_DCHECK(!g_validation_error_observer); 72 MOJO_DCHECK(!g_validation_error_observer);
72 g_validation_error_observer = this; 73 g_validation_error_observer = this;
73 } 74 }
74 75
75 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() { 76 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() {
76 MOJO_DCHECK(g_validation_error_observer == this); 77 MOJO_DCHECK(g_validation_error_observer == this);
77 g_validation_error_observer = nullptr; 78 g_validation_error_observer = nullptr;
78 } 79 }
79 80
80 bool ReportSerializationWarning(ValidationError error) { 81 bool ReportSerializationWarning(ValidationError error) {
(...skipping 12 matching lines...) Expand all
93 } 94 }
94 95
95 SerializationWarningObserverForTesting:: 96 SerializationWarningObserverForTesting::
96 ~SerializationWarningObserverForTesting() { 97 ~SerializationWarningObserverForTesting() {
97 MOJO_DCHECK(g_serialization_warning_observer == this); 98 MOJO_DCHECK(g_serialization_warning_observer == this);
98 g_serialization_warning_observer = nullptr; 99 g_serialization_warning_observer = nullptr;
99 } 100 }
100 101
101 } // namespace internal 102 } // namespace internal
102 } // namespace mojo 103 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.h ('k') | mojo/public/cpp/bindings/tests/associated_interface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698