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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 if (out_value) | 1038 if (out_value) |
1039 *out_value = std::move(*Storage::iterator(iter)); | 1039 *out_value = std::move(*Storage::iterator(iter)); |
1040 | 1040 |
1041 return list_.erase(iter); | 1041 return list_.erase(iter); |
1042 } | 1042 } |
1043 | 1043 |
1044 void ListValue::Append(std::unique_ptr<Value> in_value) { | 1044 void ListValue::Append(std::unique_ptr<Value> in_value) { |
1045 list_.push_back(std::move(in_value)); | 1045 list_.push_back(std::move(in_value)); |
1046 } | 1046 } |
1047 | 1047 |
1048 #if !defined(OS_LINUX) || defined(OS_CHROMEOS) | 1048 #if !defined(OS_LINUX) |
1049 void ListValue::Append(Value* in_value) { | 1049 void ListValue::Append(Value* in_value) { |
1050 DCHECK(in_value); | 1050 DCHECK(in_value); |
1051 Append(WrapUnique(in_value)); | 1051 Append(WrapUnique(in_value)); |
1052 } | 1052 } |
1053 #endif | 1053 #endif |
1054 | 1054 |
1055 void ListValue::AppendBoolean(bool in_value) { | 1055 void ListValue::AppendBoolean(bool in_value) { |
1056 Append(MakeUnique<FundamentalValue>(in_value)); | 1056 Append(MakeUnique<FundamentalValue>(in_value)); |
1057 } | 1057 } |
1058 | 1058 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 ValueDeserializer::~ValueDeserializer() { | 1167 ValueDeserializer::~ValueDeserializer() { |
1168 } | 1168 } |
1169 | 1169 |
1170 std::ostream& operator<<(std::ostream& out, const Value& value) { | 1170 std::ostream& operator<<(std::ostream& out, const Value& value) { |
1171 std::string json; | 1171 std::string json; |
1172 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json); | 1172 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json); |
1173 return out << json; | 1173 return out << json; |
1174 } | 1174 } |
1175 | 1175 |
1176 } // namespace base | 1176 } // namespace base |
OLD | NEW |