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

Side by Side Diff: chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h

Issue 180783005: MTP Streaming: Optimize block reading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to 129 // Called when GetFileInfo() succeeds. GetFileInfo() is invoked to
130 // create the snapshot file of |snapshot_request_info.device_file_path|. 130 // create the snapshot file of |snapshot_request_info.device_file_path|.
131 // |file_info| specifies the device file metadata details. 131 // |file_info| specifies the device file metadata details.
132 // 132 //
133 // Posts a task on the UI thread to copy the data contents of the device file 133 // Posts a task on the UI thread to copy the data contents of the device file
134 // to the snapshot file. 134 // to the snapshot file.
135 void OnDidGetFileInfoToCreateSnapshotFile( 135 void OnDidGetFileInfoToCreateSnapshotFile(
136 scoped_ptr<SnapshotRequestInfo> snapshot_request_info, 136 scoped_ptr<SnapshotRequestInfo> snapshot_request_info,
137 const base::File::Info& file_info); 137 const base::File::Info& file_info);
138 138
139 // Called when GetFileInfo() succeeds to read a range of bytes.
140 void OnDidGetFileInfoToReadBytes(const ReadBytesRequest& request,
141 const base::File::Info& file_info);
142
143 // Called when ReadDirectory() succeeds. 139 // Called when ReadDirectory() succeeds.
144 // 140 //
145 // |file_list| contains the directory file entries. 141 // |file_list| contains the directory file entries.
146 // |success_callback| is invoked to notify the caller about the directory 142 // |success_callback| is invoked to notify the caller about the directory
147 // file entries. 143 // file entries.
148 void OnDidReadDirectory(const ReadDirectorySuccessCallback& success_callback, 144 void OnDidReadDirectory(const ReadDirectorySuccessCallback& success_callback,
149 const fileapi::AsyncFileUtil::EntryList& file_list); 145 const fileapi::AsyncFileUtil::EntryList& file_list);
150 146
151 // Called when WriteDataIntoSnapshotFile() succeeds. 147 // Called when WriteDataIntoSnapshotFile() succeeds.
152 // 148 //
(...skipping 11 matching lines...) Expand all
164 // 160 //
165 // |current_snapshot_request_info_.error_callback| is invoked to notify the 161 // |current_snapshot_request_info_.error_callback| is invoked to notify the
166 // caller about |error|. 162 // caller about |error|.
167 void OnWriteDataIntoSnapshotFileError(base::File::Error error); 163 void OnWriteDataIntoSnapshotFileError(base::File::Error error);
168 164
169 // Called when ReadBytes() succeeds. 165 // Called when ReadBytes() succeeds.
170 // 166 //
171 // |success_callback| is invoked to notify the caller about the read bytes. 167 // |success_callback| is invoked to notify the caller about the read bytes.
172 // |bytes_read| is the number of bytes read. 168 // |bytes_read| is the number of bytes read.
173 void OnDidReadBytes(const ReadBytesSuccessCallback& success_callback, 169 void OnDidReadBytes(const ReadBytesSuccessCallback& success_callback,
174 int bytes_read); 170 const base::File::Info& file_info, int bytes_read);
175 171
176 // Handles the device file |error|. |error_callback| is invoked to notify the 172 // Handles the device file |error|. |error_callback| is invoked to notify the
177 // caller about the file error. 173 // caller about the file error.
178 void HandleDeviceFileError(const ErrorCallback& error_callback, 174 void HandleDeviceFileError(const ErrorCallback& error_callback,
179 base::File::Error error); 175 base::File::Error error);
180 176
181 // MTP device initialization state. 177 // MTP device initialization state.
182 InitializationState init_state_; 178 InitializationState init_state_;
183 179
184 // Used to make sure only one task is in progress at any time. 180 // Used to make sure only one task is in progress at any time.
(...skipping 17 matching lines...) Expand all
202 // request at any time. 198 // request at any time.
203 scoped_ptr<SnapshotRequestInfo> current_snapshot_request_info_; 199 scoped_ptr<SnapshotRequestInfo> current_snapshot_request_info_;
204 200
205 // For callbacks that may run after destruction. 201 // For callbacks that may run after destruction.
206 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; 202 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_;
207 203
208 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); 204 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux);
209 }; 205 };
210 206
211 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H _ 207 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698