| 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; | 113 bool IsReadOnly() const override; |
| 114 void CopyFileFromLocal( | 114 void CopyFileFromLocal( |
| 115 const base::FilePath& source_file_path, | 115 const base::FilePath& source_file_path, |
| 116 const base::FilePath& device_file_path, | 116 const base::FilePath& device_file_path, |
| 117 const CopyFileFromLocalSuccessCallback& success_callback, | 117 const CopyFileFromLocalSuccessCallback& success_callback, |
| 118 const ErrorCallback& error_callback) override; | 118 const ErrorCallback& error_callback) override; |
| 119 void DeleteFile(const base::FilePath& file_path, |
| 120 const DeleteFileSuccessCallback& success_callback, |
| 121 const ErrorCallback& error_callback) override; |
| 122 void DeleteDirectory(const base::FilePath& file_path, |
| 123 const DeleteDirectorySuccessCallback& success_callback, |
| 124 const ErrorCallback& error_callback) override; |
| 119 virtual void CancelPendingTasksAndDeleteDelegate() override; | 125 virtual void CancelPendingTasksAndDeleteDelegate() override; |
| 120 | 126 |
| 121 // Ensures the device is initialized for communication by doing a | 127 // Ensures the device is initialized for communication by doing a |
| 122 // call-and-reply to a blocking pool thread. |task_info.task| runs on a | 128 // call-and-reply to a blocking pool thread. |task_info.task| runs on a |
| 123 // blocking pool thread and |task_info.reply| runs on the IO thread. | 129 // blocking pool thread and |task_info.reply| runs on the IO thread. |
| 124 // | 130 // |
| 125 // If the device is already initialized, post the |task_info.task| | 131 // If the device is already initialized, post the |task_info.task| |
| 126 // immediately on a blocking pool thread. | 132 // immediately on a blocking pool thread. |
| 127 // | 133 // |
| 128 // If the device is uninitialized, store the |task_info| in a pending task | 134 // 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... |
| 220 // Used to make sure only one task is in progress at any time. | 226 // Used to make sure only one task is in progress at any time. |
| 221 bool task_in_progress_; | 227 bool task_in_progress_; |
| 222 | 228 |
| 223 // For callbacks that may run after destruction. | 229 // For callbacks that may run after destruction. |
| 224 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; | 230 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; |
| 225 | 231 |
| 226 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); | 232 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); |
| 227 }; | 233 }; |
| 228 | 234 |
| 229 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 235 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
| OLD | NEW |