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

Side by Side Diff: dbus/values_util.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « content/shell/test_runner/tracked_dictionary.cc ('k') | dbus/values_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "dbus/values_util.h" 5 #include "dbus/values_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 case Message::DOUBLE: { 153 case Message::DOUBLE: {
154 double value = 0; 154 double value = 0;
155 if (reader->PopDouble(&value)) 155 if (reader->PopDouble(&value))
156 result = base::MakeUnique<base::Value>(value); 156 result = base::MakeUnique<base::Value>(value);
157 break; 157 break;
158 } 158 }
159 case Message::STRING: { 159 case Message::STRING: {
160 std::string value; 160 std::string value;
161 if (reader->PopString(&value)) 161 if (reader->PopString(&value))
162 result = base::MakeUnique<base::StringValue>(value); 162 result = base::MakeUnique<base::Value>(value);
163 break; 163 break;
164 } 164 }
165 case Message::OBJECT_PATH: { 165 case Message::OBJECT_PATH: {
166 ObjectPath value; 166 ObjectPath value;
167 if (reader->PopObjectPath(&value)) 167 if (reader->PopObjectPath(&value))
168 result = base::MakeUnique<base::StringValue>(value.value()); 168 result = base::MakeUnique<base::Value>(value.value());
169 break; 169 break;
170 } 170 }
171 case Message::UNIX_FD: { 171 case Message::UNIX_FD: {
172 // Cannot distinguish a file descriptor from an int 172 // Cannot distinguish a file descriptor from an int
173 NOTREACHED(); 173 NOTREACHED();
174 break; 174 break;
175 } 175 }
176 case Message::ARRAY: { 176 case Message::ARRAY: {
177 MessageReader sub_reader(NULL); 177 MessageReader sub_reader(NULL);
178 if (reader->PopArray(&sub_reader)) { 178 if (reader->PopArray(&sub_reader)) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 300
301 void AppendValueDataAsVariant(MessageWriter* writer, const base::Value& value) { 301 void AppendValueDataAsVariant(MessageWriter* writer, const base::Value& value) {
302 MessageWriter variant_writer(NULL); 302 MessageWriter variant_writer(NULL);
303 writer->OpenVariant(GetTypeSignature(value), &variant_writer); 303 writer->OpenVariant(GetTypeSignature(value), &variant_writer);
304 AppendValueData(&variant_writer, value); 304 AppendValueData(&variant_writer, value);
305 writer->CloseContainer(&variant_writer); 305 writer->CloseContainer(&variant_writer);
306 } 306 }
307 307
308 } // namespace dbus 308 } // namespace dbus
OLDNEW
« no previous file with comments | « content/shell/test_runner/tracked_dictionary.cc ('k') | dbus/values_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698