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

Unified Diff: mojo/common/values_struct_traits.h

Issue 2839753005: Remove base::Value::GetAsBinary (Closed)
Patch Set: 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
Index: mojo/common/values_struct_traits.h
diff --git a/mojo/common/values_struct_traits.h b/mojo/common/values_struct_traits.h
index c9cd09e07262ee653ca7515b400d8b0f29f83ccf..2613f6bfd580abcd0c9b718c331ba34c208def1f 100644
--- a/mojo/common/values_struct_traits.h
+++ b/mojo/common/values_struct_traits.h
@@ -173,12 +173,11 @@ struct UnionTraits<common::mojom::ValueDataView, base::Value> {
}
static mojo::ConstCArray<uint8_t> binary_value(const base::Value& value) {
- const base::Value* binary_value = nullptr;
- if (!value.GetAsBinary(&binary_value))
+ if (!value.is_blob())
jdoerrie 2017/04/25 12:49:16 Technically this if-clause is not required either
Robert Sesek 2017/04/25 14:06:42 I'd keep it given the pattern in the rest of the f
jdoerrie 2017/04/25 14:14:33 Acknowledged.
NOTREACHED();
return mojo::ConstCArray<uint8_t>(
- binary_value->GetBlob().size(),
- reinterpret_cast<const uint8_t*>(binary_value->GetBlob().data()));
+ value.GetBlob().size(),
+ reinterpret_cast<const uint8_t*>(value.GetBlob().data()));
}
static const base::ListValue& list_value(const base::Value& value) {

Powered by Google App Engine
This is Rietveld 408576698