| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 virtual void ReadDirectory( | 97 virtual void ReadDirectory( |
| 98 const base::FilePath& root, | 98 const base::FilePath& root, |
| 99 const ReadDirectorySuccessCallback& success_callback, | 99 const ReadDirectorySuccessCallback& success_callback, |
| 100 const ErrorCallback& error_callback) OVERRIDE; | 100 const ErrorCallback& error_callback) OVERRIDE; |
| 101 virtual void CreateSnapshotFile( | 101 virtual void CreateSnapshotFile( |
| 102 const base::FilePath& device_file_path, | 102 const base::FilePath& device_file_path, |
| 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( | 107 virtual void ReadBytes(const base::FilePath& device_file_path, |
| 108 const base::FilePath& device_file_path, | 108 const scoped_refptr<net::IOBuffer>& buf, |
| 109 net::IOBuffer* buf, int64 offset, int buf_len, | 109 int64 offset, |
| 110 const ReadBytesSuccessCallback& success_callback, | 110 int buf_len, |
| 111 const ErrorCallback& error_callback) OVERRIDE; | 111 const ReadBytesSuccessCallback& success_callback, |
| 112 const ErrorCallback& error_callback) OVERRIDE; |
| 112 virtual void CancelPendingTasksAndDeleteDelegate() OVERRIDE; | 113 virtual void CancelPendingTasksAndDeleteDelegate() OVERRIDE; |
| 113 | 114 |
| 114 // Ensures the device is initialized for communication by doing a | 115 // Ensures the device is initialized for communication by doing a |
| 115 // call-and-reply to a blocking pool thread. |task_info.task| runs on a | 116 // call-and-reply to a blocking pool thread. |task_info.task| runs on a |
| 116 // blocking pool thread and |task_info.reply| runs on the IO thread. | 117 // blocking pool thread and |task_info.reply| runs on the IO thread. |
| 117 // | 118 // |
| 118 // If the device is already initialized, post the |task_info.task| | 119 // If the device is already initialized, post the |task_info.task| |
| 119 // immediately on a blocking pool thread. | 120 // immediately on a blocking pool thread. |
| 120 // | 121 // |
| 121 // If the device is uninitialized, store the |task_info| in a pending task | 122 // 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... |
| 213 // Used to make sure only one task is in progress at any time. | 214 // Used to make sure only one task is in progress at any time. |
| 214 bool task_in_progress_; | 215 bool task_in_progress_; |
| 215 | 216 |
| 216 // For callbacks that may run after destruction. | 217 // For callbacks that may run after destruction. |
| 217 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; | 218 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; |
| 218 | 219 |
| 219 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); | 220 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); |
| 220 }; | 221 }; |
| 221 | 222 |
| 222 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 223 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
| OLD | NEW |