OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/values.h" | 5 #include "base/values.h" |
6 | 6 |
7 #include "base/float_util.h" | 7 #include "base/float_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 | 62 |
63 namespace base { | 63 namespace base { |
64 | 64 |
65 ///////////////////// Value //////////////////// | 65 ///////////////////// Value //////////////////// |
66 | 66 |
67 Value::~Value() { | 67 Value::~Value() { |
68 #if !defined(OS_CHROMEOS) | |
69 CHECK(!check_on_delete_); | |
70 #endif | |
71 } | 68 } |
72 | 69 |
73 // static | 70 // static |
74 Value* Value::CreateNullValue() { | 71 Value* Value::CreateNullValue() { |
75 return new Value(TYPE_NULL); | 72 return new Value(TYPE_NULL); |
76 } | 73 } |
77 | 74 |
78 // static | 75 // static |
79 FundamentalValue* Value::CreateBooleanValue(bool in_value) { | 76 FundamentalValue* Value::CreateBooleanValue(bool in_value) { |
80 return new FundamentalValue(in_value); | 77 return new FundamentalValue(in_value); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return other->IsType(TYPE_NULL); | 139 return other->IsType(TYPE_NULL); |
143 } | 140 } |
144 | 141 |
145 // static | 142 // static |
146 bool Value::Equals(const Value* a, const Value* b) { | 143 bool Value::Equals(const Value* a, const Value* b) { |
147 if ((a == NULL) && (b == NULL)) return true; | 144 if ((a == NULL) && (b == NULL)) return true; |
148 if ((a == NULL) ^ (b == NULL)) return false; | 145 if ((a == NULL) ^ (b == NULL)) return false; |
149 return a->Equals(b); | 146 return a->Equals(b); |
150 } | 147 } |
151 | 148 |
152 Value::Value(Type type) | 149 Value::Value(Type type) : type_(type) { |
153 : type_(type) | |
154 #if !defined(OS_CHROMEOS) | |
155 , check_on_delete_(false) | |
156 #endif | |
157 { | |
158 } | 150 } |
159 | 151 |
160 ///////////////////// FundamentalValue //////////////////// | 152 ///////////////////// FundamentalValue //////////////////// |
161 | 153 |
162 FundamentalValue::FundamentalValue(bool in_value) | 154 FundamentalValue::FundamentalValue(bool in_value) |
163 : Value(TYPE_BOOLEAN), boolean_value_(in_value) { | 155 : Value(TYPE_BOOLEAN), boolean_value_(in_value) { |
164 } | 156 } |
165 | 157 |
166 FundamentalValue::FundamentalValue(int in_value) | 158 FundamentalValue::FundamentalValue(int in_value) |
167 : Value(TYPE_INTEGER), integer_value_(in_value) { | 159 : Value(TYPE_INTEGER), integer_value_(in_value) { |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 if (lhs_it != end() || rhs_it != other_list->end()) | 902 if (lhs_it != end() || rhs_it != other_list->end()) |
911 return false; | 903 return false; |
912 | 904 |
913 return true; | 905 return true; |
914 } | 906 } |
915 | 907 |
916 ValueSerializer::~ValueSerializer() { | 908 ValueSerializer::~ValueSerializer() { |
917 } | 909 } |
918 | 910 |
919 } // namespace base | 911 } // namespace base |
OLD | NEW |