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

Unified Diff: chrome/utility/media_galleries/media_metadata_parser.cc

Issue 2667443002: Convert utility process ParseMediaMetadata blob reading IPC to mojo (Closed)
Patch Set: Remove the damn helper: call ReleaseProcessIfNeeded directly. Created 3 years, 10 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: chrome/utility/media_galleries/media_metadata_parser.cc
diff --git a/chrome/utility/media_galleries/media_metadata_parser.cc b/chrome/utility/media_galleries/media_metadata_parser.cc
index 7085cb6ae0750258d8e204a1be1589cba3a1e0f1..aee251c8c6fb517cae5c598de120c2d04e00dc5d 100644
--- a/chrome/utility/media_galleries/media_metadata_parser.cc
+++ b/chrome/utility/media_galleries/media_metadata_parser.cc
@@ -114,15 +114,15 @@ void FinishParseAudioVideoMetadata(
} // namespace
-MediaMetadataParser::MediaMetadataParser(media::DataSource* source,
- const std::string& mime_type,
- bool get_attached_images)
- : source_(source),
+MediaMetadataParser::MediaMetadataParser(
+ std::unique_ptr<media::DataSource> source,
+ const std::string& mime_type,
+ bool get_attached_images)
+ : source_(std::move(source)),
mime_type_(mime_type),
- get_attached_images_(get_attached_images) {
-}
+ get_attached_images_(get_attached_images) {}
-MediaMetadataParser::~MediaMetadataParser() {}
+MediaMetadataParser::~MediaMetadataParser() = default;
void MediaMetadataParser::Start(const MetadataCallback& callback) {
if (base::StartsWith(mime_type_, "audio/", base::CompareCase::SENSITIVE) ||
@@ -135,7 +135,7 @@ void MediaMetadataParser::Start(const MetadataCallback& callback) {
media_thread_.reset(new base::Thread("media_thread"));
CHECK(media_thread_->Start());
media_thread_->task_runner()->PostTaskAndReply(
- FROM_HERE, base::Bind(&ParseAudioVideoMetadata, source_,
+ FROM_HERE, base::Bind(&ParseAudioVideoMetadata, source_.get(),
get_attached_images_, metadata, attached_images),
base::Bind(&FinishParseAudioVideoMetadata, callback,
base::Owned(metadata), base::Owned(attached_images)));

Powered by Google App Engine
This is Rietveld 408576698