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

Side by Side Diff: chrome/utility/media_galleries/media_metadata_parser.cc

Issue 103283003: Media Galleries API Metadata: SafeMediaMetadataParser and IPCTunnelDataReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ownership issues Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698