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

Side by Side Diff: dbus/values_util.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « dbus/string_util_unittest.cc ('k') | device/bluetooth/bluetooth_utils.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 "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 case base::Value::TYPE_DOUBLE: 72 case base::Value::TYPE_DOUBLE:
73 return "d"; 73 return "d";
74 case base::Value::TYPE_STRING: 74 case base::Value::TYPE_STRING:
75 return "s"; 75 return "s";
76 case base::Value::TYPE_BINARY: 76 case base::Value::TYPE_BINARY:
77 return "ay"; 77 return "ay";
78 case base::Value::TYPE_DICTIONARY: 78 case base::Value::TYPE_DICTIONARY:
79 return "a{sv}"; 79 return "a{sv}";
80 default: 80 default:
81 DLOG(ERROR) << "Unexpected type " << value.GetType(); 81 DLOG(ERROR) << "Unexpected type " << value.GetType();
82 return ""; 82 return std::string();
83 } 83 }
84 } 84 }
85 85
86 } // namespace 86 } // namespace
87 87
88 base::Value* PopDataAsValue(MessageReader* reader) { 88 base::Value* PopDataAsValue(MessageReader* reader) {
89 base::Value* result = NULL; 89 base::Value* result = NULL;
90 switch (reader->GetDataType()) { 90 switch (reader->GetDataType()) {
91 case Message::INVALID_DATA: 91 case Message::INVALID_DATA:
92 // Do nothing. 92 // Do nothing.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 void AppendBasicTypeValueDataAsVariant(MessageWriter* writer, 248 void AppendBasicTypeValueDataAsVariant(MessageWriter* writer,
249 const base::Value& value) { 249 const base::Value& value) {
250 MessageWriter sub_writer(NULL); 250 MessageWriter sub_writer(NULL);
251 writer->OpenVariant(GetTypeSignature(value), &sub_writer); 251 writer->OpenVariant(GetTypeSignature(value), &sub_writer);
252 AppendBasicTypeValueData(&sub_writer, value); 252 AppendBasicTypeValueData(&sub_writer, value);
253 writer->CloseContainer(&sub_writer); 253 writer->CloseContainer(&sub_writer);
254 } 254 }
255 255
256 } // namespace dbus 256 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/string_util_unittest.cc ('k') | device/bluetooth/bluetooth_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698