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

Unified Diff: base/values.cc

Issue 2799093006: Remove base::BinaryValue (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index 23d2b384639c6dbd7e7bb27e75bf67330a573b82..ca12edcb00cd611d2199611640c8b09f9711c481 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -76,10 +76,9 @@ std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node) {
} // namespace
// static
-std::unique_ptr<BinaryValue> BinaryValue::CreateWithCopiedBuffer(
- const char* buffer,
- size_t size) {
- return MakeUnique<BinaryValue>(std::vector<char>(buffer, buffer + size));
+std::unique_ptr<Value> Value::CreateWithCopiedBuffer(const char* buffer,
+ size_t size) {
+ return MakeUnique<Value>(std::vector<char>(buffer, buffer + size));
}
Value::Value(const Value& that) {
@@ -298,7 +297,7 @@ bool Value::GetAsString(StringPiece* out_value) const {
return is_string();
}
-bool Value::GetAsBinary(const BinaryValue** out_value) const {
+bool Value::GetAsBinary(const Value** out_value) const {
if (out_value && is_blob()) {
*out_value = this;
return true;
@@ -795,7 +794,7 @@ bool DictionaryValue::GetStringASCII(StringPiece path,
}
bool DictionaryValue::GetBinary(StringPiece path,
- const BinaryValue** out_value) const {
+ const Value** out_value) const {
const Value* value;
bool result = Get(path, &value);
if (!result || !value->IsType(Type::BINARY))
@@ -807,10 +806,9 @@ bool DictionaryValue::GetBinary(StringPiece path,
return true;
}
-bool DictionaryValue::GetBinary(StringPiece path, BinaryValue** out_value) {
+bool DictionaryValue::GetBinary(StringPiece path, Value** out_value) {
return static_cast<const DictionaryValue&>(*this).GetBinary(
- path,
- const_cast<const BinaryValue**>(out_value));
+ path, const_cast<const Value**>(out_value));
}
bool DictionaryValue::GetDictionary(StringPiece path,
@@ -1156,7 +1154,7 @@ bool ListValue::GetString(size_t index, string16* out_value) const {
return value->GetAsString(out_value);
}
-bool ListValue::GetBinary(size_t index, const BinaryValue** out_value) const {
+bool ListValue::GetBinary(size_t index, const Value** out_value) const {
const Value* value;
bool result = Get(index, &value);
if (!result || !value->IsType(Type::BINARY))
@@ -1168,10 +1166,9 @@ bool ListValue::GetBinary(size_t index, const BinaryValue** out_value) const {
return true;
}
-bool ListValue::GetBinary(size_t index, BinaryValue** out_value) {
+bool ListValue::GetBinary(size_t index, Value** out_value) {
return static_cast<const ListValue&>(*this).GetBinary(
- index,
- const_cast<const BinaryValue**>(out_value));
+ index, const_cast<const Value**>(out_value));
}
bool ListValue::GetDictionary(size_t index,
« no previous file with comments | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698