| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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< | 47 typedef base::Callback< |
| 48 void(const base::File::Info& file_info, | 48 void(const base::File::Info& file_info, |
| 49 int bytes_read)> ReadBytesSuccessCallback; | 49 int bytes_read)> ReadBytesSuccessCallback; |
| 50 | 50 |
| 51 struct ReadBytesRequest { | 51 struct ReadBytesRequest { |
| 52 ReadBytesRequest(const std::string& device_file_relative_path, | 52 ReadBytesRequest(uint32 file_id, |
| 53 net::IOBuffer* buf, int64 offset, int buf_len, | 53 net::IOBuffer* buf, int64 offset, int buf_len, |
| 54 const ReadBytesSuccessCallback& success_callback, | 54 const ReadBytesSuccessCallback& success_callback, |
| 55 const ErrorCallback& error_callback); | 55 const ErrorCallback& error_callback); |
| 56 ~ReadBytesRequest(); | 56 ~ReadBytesRequest(); |
| 57 | 57 |
| 58 std::string device_file_relative_path; | 58 uint32 file_id; |
| 59 scoped_refptr<net::IOBuffer> buf; | 59 scoped_refptr<net::IOBuffer> buf; |
| 60 int64 offset; | 60 int64 offset; |
| 61 int buf_len; | 61 int buf_len; |
| 62 ReadBytesSuccessCallback success_callback; | 62 ReadBytesSuccessCallback success_callback; |
| 63 ErrorCallback error_callback; | 63 ErrorCallback error_callback; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Gets information about the given |file_path| and invokes the appropriate | 66 // Gets information about the given |file_path| and invokes the appropriate |
| 67 // callback asynchronously when complete. | 67 // callback asynchronously when complete. |
| 68 virtual void GetFileInfo( | 68 virtual void GetFileInfo( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 typedef base::Callback<void(MTPDeviceAsyncDelegate*)> | 116 typedef base::Callback<void(MTPDeviceAsyncDelegate*)> |
| 117 CreateMTPDeviceAsyncDelegateCallback; | 117 CreateMTPDeviceAsyncDelegateCallback; |
| 118 | 118 |
| 119 void CreateMTPDeviceAsyncDelegate( | 119 void CreateMTPDeviceAsyncDelegate( |
| 120 const base::FilePath::StringType& device_location, | 120 const base::FilePath::StringType& device_location, |
| 121 const CreateMTPDeviceAsyncDelegateCallback& callback); | 121 const CreateMTPDeviceAsyncDelegateCallback& callback); |
| 122 | 122 |
| 123 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ | 123 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ |
| OLD | NEW |