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

Side by Side Diff: chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.h

Issue 2867013002: Use OnceCallback on Mojo interfaces in //chrome/common/extensions (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/safe_media_metadata_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698