| 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 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ | 5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ |
| 6 #define CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ | 6 #define CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/common/extensions/api/media_galleries.h" | 14 #include "chrome/common/extensions/api/media_galleries.h" |
| 15 #include "chrome/common/media_galleries/metadata_types.h" | 15 #include "chrome/common/media_galleries/metadata_types.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class Thread; | 18 class Thread; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace media { | 21 namespace media { |
| 22 class DataSource; | 22 class DataSource; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace metadata { | 25 namespace metadata { |
| 26 | 26 |
| 27 // This class takes a MIME type and data source and parses its metadata. It | 27 // This class takes a MIME type and data source and parses its metadata. It |
| 28 // handles audio, video, and images. It delegates its operations to FFMPEG, | 28 // handles audio, video, and images. It delegates its operations to FFMPEG. |
| 29 // libexif, etc. This class lives and operates on the utility thread of the | 29 // This class lives and operates on the utility thread of the utility process, |
| 30 // utility process, as we wish to sandbox potentially dangerous operations | 30 // as we wish to sandbox potentially dangerous operations on user-provided data. |
| 31 // on user-provided data. | |
| 32 class MediaMetadataParser { | 31 class MediaMetadataParser { |
| 33 public: | 32 public: |
| 34 typedef extensions::api::media_galleries::MediaMetadata MediaMetadata; | 33 typedef extensions::api::media_galleries::MediaMetadata MediaMetadata; |
| 35 typedef base::Callback< | 34 typedef base::Callback< |
| 36 void(const MediaMetadata& metadata, | 35 void(const MediaMetadata& metadata, |
| 37 const std::vector<AttachedImage>& attached_images)> | 36 const std::vector<AttachedImage>& attached_images)> |
| 38 MetadataCallback; | 37 MetadataCallback; |
| 39 | 38 |
| 40 // Does not take ownership of |source|. Caller is responsible for ensuring | 39 // Does not take ownership of |source|. Caller is responsible for ensuring |
| 41 // that |source| outlives this object. | 40 // that |source| outlives this object. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 60 // TODO(tommycli): Replace with a reference to a WorkerPool if we ever use | 59 // TODO(tommycli): Replace with a reference to a WorkerPool if we ever use |
| 61 // this class in batch mode. | 60 // this class in batch mode. |
| 62 scoped_ptr<base::Thread> media_thread_; | 61 scoped_ptr<base::Thread> media_thread_; |
| 63 | 62 |
| 64 DISALLOW_COPY_AND_ASSIGN(MediaMetadataParser); | 63 DISALLOW_COPY_AND_ASSIGN(MediaMetadataParser); |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 } // namespace metadata | 66 } // namespace metadata |
| 68 | 67 |
| 69 #endif // CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ | 68 #endif // CHROME_UTILITY_MEDIA_GALLERIES_MEDIA_METADATA_PARSER_H_ |
| OLD | NEW |