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

Side by Side Diff: chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.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
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 26 matching lines...) Expand all
37 // A callback to be called when GetFileInfo/ReadDirectory/CreateSnapshot 37 // A callback to be called when GetFileInfo/ReadDirectory/CreateSnapshot
38 // method call fails. 38 // method call fails.
39 typedef base::Callback<void(base::File::Error error)> ErrorCallback; 39 typedef base::Callback<void(base::File::Error error)> ErrorCallback;
40 40
41 // A callback to be called when CreateSnapshotFile method call succeeds. 41 // A callback to be called when CreateSnapshotFile method call succeeds.
42 typedef base::Callback< 42 typedef base::Callback<
43 void(const base::File::Info& file_info, 43 void(const base::File::Info& file_info,
44 const base::FilePath& local_path)> CreateSnapshotFileSuccessCallback; 44 const base::FilePath& local_path)> CreateSnapshotFileSuccessCallback;
45 45
46 // A callback to be called when ReadBytes method call succeeds. 46 // A callback to be called when ReadBytes method call succeeds.
47 typedef base::Callback<void(int)> ReadBytesSuccessCallback; 47 typedef base::Callback<
48 void(const base::File::Info& file_info,
49 int bytes_read)> ReadBytesSuccessCallback;
48 50
49 struct ReadBytesRequest { 51 struct ReadBytesRequest {
50 ReadBytesRequest(const std::string& device_file_relative_path, 52 ReadBytesRequest(const std::string& device_file_relative_path,
51 net::IOBuffer* buf, int64 offset, int buf_len, 53 net::IOBuffer* buf, int64 offset, int buf_len,
52 const ReadBytesSuccessCallback& success_callback, 54 const ReadBytesSuccessCallback& success_callback,
53 const ErrorCallback& error_callback); 55 const ErrorCallback& error_callback);
54 ~ReadBytesRequest(); 56 ~ReadBytesRequest();
55 57
56 std::string device_file_relative_path; 58 std::string device_file_relative_path;
57 scoped_refptr<net::IOBuffer> buf; 59 scoped_refptr<net::IOBuffer> buf;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 }; 114 };
113 115
114 typedef base::Callback<void(MTPDeviceAsyncDelegate*)> 116 typedef base::Callback<void(MTPDeviceAsyncDelegate*)>
115 CreateMTPDeviceAsyncDelegateCallback; 117 CreateMTPDeviceAsyncDelegateCallback;
116 118
117 void CreateMTPDeviceAsyncDelegate( 119 void CreateMTPDeviceAsyncDelegate(
118 const base::FilePath::StringType& device_location, 120 const base::FilePath::StringType& device_location,
119 const CreateMTPDeviceAsyncDelegateCallback& callback); 121 const CreateMTPDeviceAsyncDelegateCallback& callback);
120 122
121 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ 123 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698