| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/utility/media_galleries/media_metadata_parser.h" | 5 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "media/base/data_source.h" |
| 9 | 10 |
| 10 namespace metadata { | 11 namespace metadata { |
| 11 | 12 |
| 12 MediaMetadataParser::MediaMetadataParser(DataReader* reader, | 13 MediaMetadataParser::MediaMetadataParser(media::DataSource* source, |
| 13 const std::string& mime_type) | 14 const std::string& mime_type) |
| 14 : reader_(reader), | 15 : source_(source), |
| 15 metadata_(new MediaMetadata) { | 16 metadata_(new MediaMetadata) { |
| 16 metadata_->mime_type = mime_type; | 17 metadata_->mime_type = mime_type; |
| 17 } | 18 } |
| 18 | 19 |
| 19 MediaMetadataParser::~MediaMetadataParser() {} | 20 MediaMetadataParser::~MediaMetadataParser() {} |
| 20 | 21 |
| 21 void MediaMetadataParser::Start(const MetadataCallback& callback) { | 22 void MediaMetadataParser::Start(const MetadataCallback& callback) { |
| 22 DCHECK(callback_.is_null()); | 23 DCHECK(callback_.is_null()); |
| 23 callback_ = callback; | 24 callback_ = callback; |
| 24 | 25 |
| 25 // TODO(tommycli): Implement for various mime types. | 26 // TODO(tommycli): Implement for various mime types. |
| 26 callback_.Run(metadata_.Pass()); | 27 callback_.Run(metadata_.Pass()); |
| 27 } | 28 } |
| 28 | 29 |
| 29 } // namespace metadata | 30 } // namespace metadata |
| OLD | NEW |