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

Unified Diff: base/values.cc

Issue 820673004: json_schema_compiler: Use std::vector<char> for binary values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_json_schema
Patch Set: Fix merge error. Created 5 years, 11 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 b478b620ca56b0e2a3ed13ff2a007841dd5d9de7..061b7a1a0253454d51a14fb18b5328bcac99cf49 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -89,6 +89,10 @@ Value* Value::CreateNullValue() {
return new Value(TYPE_NULL);
}
+bool Value::GetAsBinary(const BinaryValue** out_value) const {
+ return false;
+}
+
bool Value::GetAsBoolean(bool* out_value) const {
return false;
}
@@ -319,6 +323,12 @@ BinaryValue* BinaryValue::CreateWithCopiedBuffer(const char* buffer,
return new BinaryValue(scoped_buffer_copy.Pass(), size);
}
+bool BinaryValue::GetAsBinary(const BinaryValue** out_value) const {
+ if (out_value)
+ *out_value = this;
+ return true;
+}
+
BinaryValue* BinaryValue::DeepCopy() const {
return CreateWithCopiedBuffer(buffer_.get(), size_);
}
« 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