OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 if (out_value) | 1242 if (out_value) |
1243 *out_value = MakeUnique<Value>(std::move(*iter)); | 1243 *out_value = MakeUnique<Value>(std::move(*iter)); |
1244 | 1244 |
1245 return list_->erase(iter); | 1245 return list_->erase(iter); |
1246 } | 1246 } |
1247 | 1247 |
1248 void ListValue::Append(std::unique_ptr<Value> in_value) { | 1248 void ListValue::Append(std::unique_ptr<Value> in_value) { |
1249 list_->push_back(std::move(*in_value)); | 1249 list_->push_back(std::move(*in_value)); |
1250 } | 1250 } |
1251 | 1251 |
1252 #if !defined(OS_LINUX) && !defined(OS_MACOSX) | 1252 #if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
1253 void ListValue::Append(Value* in_value) { | 1253 void ListValue::Append(Value* in_value) { |
1254 DCHECK(in_value); | 1254 DCHECK(in_value); |
1255 Append(WrapUnique(in_value)); | 1255 Append(WrapUnique(in_value)); |
1256 } | 1256 } |
1257 #endif | 1257 #endif |
1258 | 1258 |
1259 void ListValue::AppendBoolean(bool in_value) { | 1259 void ListValue::AppendBoolean(bool in_value) { |
1260 Append(MakeUnique<Value>(in_value)); | 1260 Append(MakeUnique<Value>(in_value)); |
1261 } | 1261 } |
1262 | 1262 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 } | 1338 } |
1339 | 1339 |
1340 std::ostream& operator<<(std::ostream& out, const Value::Type& type) { | 1340 std::ostream& operator<<(std::ostream& out, const Value::Type& type) { |
1341 if (static_cast<int>(type) < 0 || | 1341 if (static_cast<int>(type) < 0 || |
1342 static_cast<size_t>(type) >= arraysize(kTypeNames)) | 1342 static_cast<size_t>(type) >= arraysize(kTypeNames)) |
1343 return out << "Invalid Type (index = " << static_cast<int>(type) << ")"; | 1343 return out << "Invalid Type (index = " << static_cast<int>(type) << ")"; |
1344 return out << Value::GetTypeName(type); | 1344 return out << Value::GetTypeName(type); |
1345 } | 1345 } |
1346 | 1346 |
1347 } // namespace base | 1347 } // namespace base |
OLD | NEW |