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

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

Issue 2080083002: Revert of Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "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
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
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
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.h ('k') | mojo/public/cpp/bindings/strong_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698