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

Unified Diff: base/values.cc

Issue 851673003: Cleanup: Some simplifications in json_schema_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_dart_tests
Patch Set: Add unit test for GetAsBinary. 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
« base/values.h ('K') | « 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..1e617a5fd9d3a4b4682851fdea65889af6ab75b7 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -89,6 +89,10 @@ Value* Value::CreateNullValue() {
return new Value(TYPE_NULL);
}
+bool Value::GetAsBinary(std::string* out_value) const {
+ return false;
+}
+
bool Value::GetAsBoolean(bool* out_value) const {
return false;
}
@@ -319,6 +323,11 @@ BinaryValue* BinaryValue::CreateWithCopiedBuffer(const char* buffer,
return new BinaryValue(scoped_buffer_copy.Pass(), size);
}
+bool BinaryValue::GetAsBinary(std::string* out_value) const {
+ out_value->assign(buffer_.get(), size_);
+ return true;
+}
+
BinaryValue* BinaryValue::DeepCopy() const {
return CreateWithCopiedBuffer(buffer_.get(), size_);
}
« base/values.h ('K') | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698