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

Side by Side Diff: base/values.cc

Issue 1997153002: libchrome: Several upstreamable fixes from libchrome Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Addressed feedback Created 4 years, 7 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
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 "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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } // namespace 87 } // namespace
88 88
89 Value::~Value() { 89 Value::~Value() {
90 } 90 }
91 91
92 // static 92 // static
93 std::unique_ptr<Value> Value::CreateNullValue() { 93 std::unique_ptr<Value> Value::CreateNullValue() {
94 return WrapUnique(new Value(TYPE_NULL)); 94 return WrapUnique(new Value(TYPE_NULL));
95 } 95 }
96 96
97 bool Value::GetAsBinary(const BinaryValue** out_value) const { 97 bool Value::GetAsBinary(const BinaryValue**) const {
98 return false; 98 return false;
99 } 99 }
100 100
101 bool Value::GetAsBoolean(bool* out_value) const { 101 bool Value::GetAsBoolean(bool*) const {
102 return false; 102 return false;
103 } 103 }
104 104
105 bool Value::GetAsInteger(int* out_value) const { 105 bool Value::GetAsInteger(int*) const {
106 return false; 106 return false;
107 } 107 }
108 108
109 bool Value::GetAsDouble(double* out_value) const { 109 bool Value::GetAsDouble(double*) const {
110 return false; 110 return false;
111 } 111 }
112 112
113 bool Value::GetAsString(std::string* out_value) const { 113 bool Value::GetAsString(std::string*) const {
114 return false; 114 return false;
115 } 115 }
116 116
117 bool Value::GetAsString(string16* out_value) const { 117 bool Value::GetAsString(string16*) const {
118 return false; 118 return false;
119 } 119 }
120 120
121 bool Value::GetAsString(const StringValue** out_value) const { 121 bool Value::GetAsString(const StringValue**) const {
122 return false; 122 return false;
123 } 123 }
124 124
125 bool Value::GetAsList(ListValue** out_value) { 125 bool Value::GetAsList(ListValue**) {
126 return false; 126 return false;
127 } 127 }
128 128
129 bool Value::GetAsList(const ListValue** out_value) const { 129 bool Value::GetAsList(const ListValue**) const {
130 return false; 130 return false;
131 } 131 }
132 132
133 bool Value::GetAsDictionary(DictionaryValue** out_value) { 133 bool Value::GetAsDictionary(DictionaryValue**) {
134 return false; 134 return false;
135 } 135 }
136 136
137 bool Value::GetAsDictionary(const DictionaryValue** out_value) const { 137 bool Value::GetAsDictionary(const DictionaryValue**) const {
138 return false; 138 return false;
139 } 139 }
140 140
141 Value* Value::DeepCopy() const { 141 Value* Value::DeepCopy() const {
142 // This method should only be getting called for null Values--all subclasses 142 // This method should only be getting called for null Values--all subclasses
143 // need to provide their own implementation;. 143 // need to provide their own implementation;.
144 DCHECK(IsType(TYPE_NULL)); 144 DCHECK(IsType(TYPE_NULL));
145 return CreateNullValue().release(); 145 return CreateNullValue().release();
146 } 146 }
147 147
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 ValueDeserializer::~ValueDeserializer() { 1201 ValueDeserializer::~ValueDeserializer() {
1202 } 1202 }
1203 1203
1204 std::ostream& operator<<(std::ostream& out, const Value& value) { 1204 std::ostream& operator<<(std::ostream& out, const Value& value) {
1205 std::string json; 1205 std::string json;
1206 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json); 1206 JSONWriter::WriteWithOptions(value, JSONWriter::OPTIONS_PRETTY_PRINT, &json);
1207 return out << json; 1207 return out << json;
1208 } 1208 }
1209 1209
1210 } // namespace base 1210 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698