| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // Callback from utility process when it finishes parsing metadata. | 64 // Callback from utility process when it finishes parsing metadata. |
| 65 // Runs on the IO thread. | 65 // Runs on the IO thread. |
| 66 void ParseMediaMetadataDone( | 66 void ParseMediaMetadataDone( |
| 67 bool parse_success, | 67 bool parse_success, |
| 68 std::unique_ptr<base::DictionaryValue> metadata_dictionary, | 68 std::unique_ptr<base::DictionaryValue> metadata_dictionary, |
| 69 const std::vector<AttachedImage>& attached_images); | 69 const std::vector<AttachedImage>& attached_images); |
| 70 | 70 |
| 71 // Sequence of functions that bounces from the IO thread to the UI thread to | 71 // Sequence of functions that bounces from the IO thread to the UI thread to |
| 72 // read the blob data, then sends the data back to the utility process. | 72 // read the blob data, then sends the data back to the utility process. |
| 73 void StartBlobRequest( | 73 void StartBlobRequest( |
| 74 const extensions::mojom::MediaDataSource::ReadBlobCallback& callback, | 74 extensions::mojom::MediaDataSource::ReadBlobCallback callback, |
| 75 int64_t position, | 75 int64_t position, |
| 76 int64_t length); | 76 int64_t length); |
| 77 void StartBlobReaderOnUIThread( | 77 void StartBlobReaderOnUIThread( |
| 78 const extensions::mojom::MediaDataSource::ReadBlobCallback& callback, | 78 extensions::mojom::MediaDataSource::ReadBlobCallback callback, |
| 79 int64_t position, | 79 int64_t position, |
| 80 int64_t length); | 80 int64_t length); |
| 81 void BlobReaderDoneOnUIThread( | 81 void BlobReaderDoneOnUIThread( |
| 82 const extensions::mojom::MediaDataSource::ReadBlobCallback& callback, | 82 extensions::mojom::MediaDataSource::ReadBlobCallback callback, |
| 83 std::unique_ptr<std::string> data, | 83 std::unique_ptr<std::string> data, |
| 84 int64_t /* blob_total_size */); | 84 int64_t /* blob_total_size */); |
| 85 void FinishBlobRequest( | 85 void FinishBlobRequest( |
| 86 const extensions::mojom::MediaDataSource::ReadBlobCallback& callback, | 86 extensions::mojom::MediaDataSource::ReadBlobCallback callback, |
| 87 std::unique_ptr<std::string> data); | 87 std::unique_ptr<std::string> data); |
| 88 | 88 |
| 89 // All member variables are only accessed on the IO thread. | 89 // All member variables are only accessed on the IO thread. |
| 90 Profile* const profile_; | 90 Profile* const profile_; |
| 91 const std::string blob_uuid_; | 91 const std::string blob_uuid_; |
| 92 const int64_t blob_size_; | 92 const int64_t blob_size_; |
| 93 const std::string mime_type_; | 93 const std::string mime_type_; |
| 94 bool get_attached_images_; | 94 bool get_attached_images_; |
| 95 | 95 |
| 96 DoneCallback callback_; | 96 DoneCallback callback_; |
| 97 | 97 |
| 98 std::unique_ptr< | 98 std::unique_ptr< |
| 99 content::UtilityProcessMojoClient<extensions::mojom::MediaParser>> | 99 content::UtilityProcessMojoClient<extensions::mojom::MediaParser>> |
| 100 utility_process_mojo_client_; | 100 utility_process_mojo_client_; |
| 101 | 101 |
| 102 std::unique_ptr<MediaDataSourceImpl> media_data_source_; | 102 std::unique_ptr<MediaDataSourceImpl> media_data_source_; |
| 103 | 103 |
| 104 DISALLOW_COPY_AND_ASSIGN(SafeMediaMetadataParser); | 104 DISALLOW_COPY_AND_ASSIGN(SafeMediaMetadataParser); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace metadata | 107 } // namespace metadata |
| 108 | 108 |
| 109 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ | 109 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_SAFE_MEDIA_METADATA_PARSER_H_ |
| OLD | NEW |