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_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const base::FilePath& local_path, | 103 const base::FilePath& local_path, |
104 const CreateSnapshotFileSuccessCallback& success_callback, | 104 const CreateSnapshotFileSuccessCallback& success_callback, |
105 const ErrorCallback& error_callback) override; | 105 const ErrorCallback& error_callback) override; |
106 virtual bool IsStreaming() override; | 106 virtual bool IsStreaming() override; |
107 virtual void ReadBytes(const base::FilePath& device_file_path, | 107 virtual void ReadBytes(const base::FilePath& device_file_path, |
108 const scoped_refptr<net::IOBuffer>& buf, | 108 const scoped_refptr<net::IOBuffer>& buf, |
109 int64 offset, | 109 int64 offset, |
110 int buf_len, | 110 int buf_len, |
111 const ReadBytesSuccessCallback& success_callback, | 111 const ReadBytesSuccessCallback& success_callback, |
112 const ErrorCallback& error_callback) override; | 112 const ErrorCallback& error_callback) override; |
| 113 bool IsReadOnly() override; |
| 114 void CopyFileFromLocal( |
| 115 const base::FilePath& source_file_path, |
| 116 const base::FilePath& device_file_path, |
| 117 const CopyFileFromLocalSuccessCallback& success_callback, |
| 118 const ErrorCallback& error_callback) override; |
113 virtual void CancelPendingTasksAndDeleteDelegate() override; | 119 virtual void CancelPendingTasksAndDeleteDelegate() override; |
114 | 120 |
115 // Ensures the device is initialized for communication by doing a | 121 // Ensures the device is initialized for communication by doing a |
116 // call-and-reply to a blocking pool thread. |task_info.task| runs on a | 122 // call-and-reply to a blocking pool thread. |task_info.task| runs on a |
117 // blocking pool thread and |task_info.reply| runs on the IO thread. | 123 // blocking pool thread and |task_info.reply| runs on the IO thread. |
118 // | 124 // |
119 // If the device is already initialized, post the |task_info.task| | 125 // If the device is already initialized, post the |task_info.task| |
120 // immediately on a blocking pool thread. | 126 // immediately on a blocking pool thread. |
121 // | 127 // |
122 // If the device is uninitialized, store the |task_info| in a pending task | 128 // If the device is uninitialized, store the |task_info| in a pending task |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Used to make sure only one task is in progress at any time. | 220 // Used to make sure only one task is in progress at any time. |
215 bool task_in_progress_; | 221 bool task_in_progress_; |
216 | 222 |
217 // For callbacks that may run after destruction. | 223 // For callbacks that may run after destruction. |
218 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; | 224 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; |
219 | 225 |
220 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); | 226 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); |
221 }; | 227 }; |
222 | 228 |
223 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 229 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
OLD | NEW |