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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <queue> | 11 #include <queue> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/files/file.h" | 14 #include "base/files/file.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/win/scoped_comptr.h" | 19 #include "base/win/scoped_comptr.h" |
20 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" | 20 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" |
21 #include "storage/browser/fileapi/async_file_util.h" | 21 #include "storage/browser/fileapi/async_file_util.h" |
22 | 22 |
23 namespace base { | 23 namespace base { |
24 class FilePath; | 24 class FilePath; |
25 class SequencedTaskRunner; | 25 class SequencedTaskRunner; |
26 } | 26 } |
27 | 27 |
28 class SnapshotFileDetails; | 28 class SnapshotFileDetails; |
29 struct SnapshotRequestInfo; | |
30 | 29 |
31 // MTPDeviceDelegateImplWin is used to communicate with the media transfer | 30 // MTPDeviceDelegateImplWin is used to communicate with the media transfer |
32 // protocol (MTP) device to complete file system operations. These operations | 31 // protocol (MTP) device to complete file system operations. These operations |
33 // are performed asynchronously on a blocking pool thread since the device | 32 // are performed asynchronously on a blocking pool thread since the device |
34 // access may be slow and may take a long time to complete. MTP | 33 // access may be slow and may take a long time to complete. MTP |
35 // device can have multiple data storage partitions. MTPDeviceDelegateImplWin | 34 // device can have multiple data storage partitions. MTPDeviceDelegateImplWin |
36 // is instantiated per MTP device storage partition using | 35 // is instantiated per MTP device storage partition using |
37 // CreateMTPDeviceAsyncDelegate(). MTPDeviceDelegateImplWin lives on the IO | 36 // CreateMTPDeviceAsyncDelegate(). MTPDeviceDelegateImplWin lives on the IO |
38 // thread. | 37 // thread. |
39 class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { | 38 class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // Used to make sure only one task is in progress at any time. | 259 // Used to make sure only one task is in progress at any time. |
261 bool task_in_progress_; | 260 bool task_in_progress_; |
262 | 261 |
263 // For callbacks that may run after destruction. | 262 // For callbacks that may run after destruction. |
264 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; | 263 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; |
265 | 264 |
266 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); | 265 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); |
267 }; | 266 }; |
268 | 267 |
269 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 268 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
OLD | NEW |