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

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

Issue 399313007: Mojo: Convert assert()s under mojo/public/cpp/bindings/... to MOJO_DCHECK()s. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 <assert.h>
8
9 #include "mojo/public/cpp/environment/logging.h" 7 #include "mojo/public/cpp/environment/logging.h"
10 8
11 namespace mojo { 9 namespace mojo {
12 namespace internal { 10 namespace internal {
13 namespace { 11 namespace {
14 12
15 ValidationErrorObserverForTesting* g_validation_error_observer = NULL; 13 ValidationErrorObserverForTesting* g_validation_error_observer = NULL;
16 14
17 } // namespace 15 } // namespace
18 16
(...skipping 24 matching lines...) Expand all
43 41
44 void ReportValidationError(ValidationError error) { 42 void ReportValidationError(ValidationError error) {
45 if (g_validation_error_observer) 43 if (g_validation_error_observer)
46 g_validation_error_observer->set_last_error(error); 44 g_validation_error_observer->set_last_error(error);
47 else 45 else
48 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error); 46 MOJO_LOG(ERROR) << "Invalid message: " << ValidationErrorToString(error);
49 } 47 }
50 48
51 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting() 49 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting()
52 : last_error_(VALIDATION_ERROR_NONE) { 50 : last_error_(VALIDATION_ERROR_NONE) {
53 assert(!g_validation_error_observer); 51 MOJO_DCHECK(!g_validation_error_observer);
54 g_validation_error_observer = this; 52 g_validation_error_observer = this;
55 } 53 }
56 54
57 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() { 55 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() {
58 assert(g_validation_error_observer == this); 56 MOJO_DCHECK(g_validation_error_observer == this);
59 g_validation_error_observer = NULL; 57 g_validation_error_observer = NULL;
60 } 58 }
61 59
62 } // namespace internal 60 } // namespace internal
63 } // namespace mojo 61 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698