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

Unified Diff: media/base/video_frame_metadata.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 | « media/base/video_frame_metadata.h ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame_metadata.cc
diff --git a/media/base/video_frame_metadata.cc b/media/base/video_frame_metadata.cc
index 0ce0b2cdc588c01c20a596f772711c2053a8ed40..292274e5add1a746fd1953507c2d85ded05b2dd9 100644
--- a/media/base/video_frame_metadata.cc
+++ b/media/base/video_frame_metadata.cc
@@ -53,7 +53,7 @@ void VideoFrameMetadata::SetString(Key key, const std::string& value) {
// Using BinaryValue since we don't want the |value| interpreted as having
// any particular character encoding (e.g., UTF-8) by
// base::DictionaryValue.
- base::BinaryValue::CreateWithCopiedBuffer(value.data(), value.size()));
+ base::Value::CreateWithCopiedBuffer(value.data(), value.size()));
}
namespace {
@@ -63,10 +63,9 @@ void SetTimeValue(VideoFrameMetadata::Key key,
base::DictionaryValue* dictionary) {
const int64_t internal_value = value.ToInternalValue();
dictionary->SetWithoutPathExpansion(
- ToInternalKey(key),
- base::BinaryValue::CreateWithCopiedBuffer(
- reinterpret_cast<const char*>(&internal_value),
- sizeof(internal_value)));
+ ToInternalKey(key), base::Value::CreateWithCopiedBuffer(
+ reinterpret_cast<const char*>(&internal_value),
+ sizeof(internal_value)));
}
} // namespace
@@ -110,15 +109,15 @@ bool VideoFrameMetadata::GetRotation(Key key, VideoRotation* value) const {
bool VideoFrameMetadata::GetString(Key key, std::string* value) const {
DCHECK(value);
- const base::BinaryValue* const binary_value = GetBinaryValue(key);
+ const base::Value* const binary_value = GetBinaryValue(key);
if (binary_value)
value->assign(binary_value->GetBuffer(), binary_value->GetSize());
return !!binary_value;
}
namespace {
-template<class TimeType>
-bool ToTimeValue(const base::BinaryValue& binary_value, TimeType* value) {
+template <class TimeType>
+bool ToTimeValue(const base::Value& binary_value, TimeType* value) {
DCHECK(value);
int64_t internal_value;
if (binary_value.GetSize() != sizeof(internal_value))
@@ -130,12 +129,12 @@ bool ToTimeValue(const base::BinaryValue& binary_value, TimeType* value) {
} // namespace
bool VideoFrameMetadata::GetTimeDelta(Key key, base::TimeDelta* value) const {
- const base::BinaryValue* const binary_value = GetBinaryValue(key);
+ const base::Value* const binary_value = GetBinaryValue(key);
return binary_value && ToTimeValue(*binary_value, value);
}
bool VideoFrameMetadata::GetTimeTicks(Key key, base::TimeTicks* value) const {
- const base::BinaryValue* const binary_value = GetBinaryValue(key);
+ const base::Value* const binary_value = GetBinaryValue(key);
return binary_value && ToTimeValue(*binary_value, value);
}
@@ -166,7 +165,7 @@ void VideoFrameMetadata::MergeMetadataFrom(
dictionary_.MergeDictionary(&metadata_source->dictionary_);
}
-const base::BinaryValue* VideoFrameMetadata::GetBinaryValue(Key key) const {
+const base::Value* VideoFrameMetadata::GetBinaryValue(Key key) const {
const base::Value* internal_value = nullptr;
if (dictionary_.GetWithoutPathExpansion(ToInternalKey(key),
&internal_value) &&
« no previous file with comments | « media/base/video_frame_metadata.h ('k') | mojo/common/common_custom_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698