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

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

Issue 613053002: Mojo: NULL -> nullptr in mojo/public/cpp/bindings and also for the bindings generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 {
11 namespace { 11 namespace {
12 12
13 ValidationErrorObserverForTesting* g_validation_error_observer = NULL; 13 ValidationErrorObserverForTesting* g_validation_error_observer = nullptr;
14 SerializationWarningObserverForTesting* g_serialization_warning_observer = NULL; 14 SerializationWarningObserverForTesting* g_serialization_warning_observer =
15 nullptr;
15 16
16 } // namespace 17 } // namespace
17 18
18 const char* ValidationErrorToString(ValidationError error) { 19 const char* ValidationErrorToString(ValidationError error) {
19 switch (error) { 20 switch (error) {
20 case VALIDATION_ERROR_NONE: 21 case VALIDATION_ERROR_NONE:
21 return "VALIDATION_ERROR_NONE"; 22 return "VALIDATION_ERROR_NONE";
22 case VALIDATION_ERROR_MISALIGNED_OBJECT: 23 case VALIDATION_ERROR_MISALIGNED_OBJECT:
23 return "VALIDATION_ERROR_MISALIGNED_OBJECT"; 24 return "VALIDATION_ERROR_MISALIGNED_OBJECT";
24 case VALIDATION_ERROR_ILLEGAL_MEMORY_RANGE: 25 case VALIDATION_ERROR_ILLEGAL_MEMORY_RANGE:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 57 }
57 58
58 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting() 59 ValidationErrorObserverForTesting::ValidationErrorObserverForTesting()
59 : last_error_(VALIDATION_ERROR_NONE) { 60 : last_error_(VALIDATION_ERROR_NONE) {
60 MOJO_DCHECK(!g_validation_error_observer); 61 MOJO_DCHECK(!g_validation_error_observer);
61 g_validation_error_observer = this; 62 g_validation_error_observer = this;
62 } 63 }
63 64
64 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() { 65 ValidationErrorObserverForTesting::~ValidationErrorObserverForTesting() {
65 MOJO_DCHECK(g_validation_error_observer == this); 66 MOJO_DCHECK(g_validation_error_observer == this);
66 g_validation_error_observer = NULL; 67 g_validation_error_observer = nullptr;
67 } 68 }
68 69
69 bool ReportSerializationWarning(ValidationError error) { 70 bool ReportSerializationWarning(ValidationError error) {
70 if (g_serialization_warning_observer) { 71 if (g_serialization_warning_observer) {
71 g_serialization_warning_observer->set_last_warning(error); 72 g_serialization_warning_observer->set_last_warning(error);
72 return true; 73 return true;
73 } 74 }
74 75
75 return false; 76 return false;
76 } 77 }
77 78
78 SerializationWarningObserverForTesting::SerializationWarningObserverForTesting() 79 SerializationWarningObserverForTesting::SerializationWarningObserverForTesting()
79 : last_warning_(VALIDATION_ERROR_NONE) { 80 : last_warning_(VALIDATION_ERROR_NONE) {
80 MOJO_DCHECK(!g_serialization_warning_observer); 81 MOJO_DCHECK(!g_serialization_warning_observer);
81 g_serialization_warning_observer = this; 82 g_serialization_warning_observer = this;
82 } 83 }
83 84
84 SerializationWarningObserverForTesting:: 85 SerializationWarningObserverForTesting::
85 ~SerializationWarningObserverForTesting() { 86 ~SerializationWarningObserverForTesting() {
86 MOJO_DCHECK(g_serialization_warning_observer == this); 87 MOJO_DCHECK(g_serialization_warning_observer == this);
87 g_serialization_warning_observer = NULL; 88 g_serialization_warning_observer = nullptr;
88 } 89 }
89 90
90 } // namespace internal 91 } // namespace internal
91 } // namespace mojo 92 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.h ('k') | mojo/public/cpp/bindings/message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698