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

Unified Diff: mojo/common/values_struct_traits.h

Issue 2839753005: Remove base::Value::GetAsBinary (Closed)
Patch Set: ASSERT_TRUE 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 | « chrome/browser/extensions/extension_action.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
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) {
« no previous file with comments | « chrome/browser/extensions/extension_action.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698