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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "webkit/browser/fileapi/async_file_util.h" | 11 #include "webkit/browser/fileapi/async_file_util.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace chrome { | |
18 | |
19 // Asynchronous delegate for media transfer protocol (MTP) device to perform | 17 // Asynchronous delegate for media transfer protocol (MTP) device to perform |
20 // media device isolated file system operations. Class that implements this | 18 // media device isolated file system operations. Class that implements this |
21 // delegate does the actual communication with the MTP device. | 19 // delegate does the actual communication with the MTP device. |
22 // ScopedMTPDeviceMapEntry class manages the lifetime of the delegate via | 20 // ScopedMTPDeviceMapEntry class manages the lifetime of the delegate via |
23 // MTPDeviceMapService class. Member functions and callbacks runs on the IO | 21 // MTPDeviceMapService class. Member functions and callbacks runs on the IO |
24 // thread. | 22 // thread. |
25 class MTPDeviceAsyncDelegate { | 23 class MTPDeviceAsyncDelegate { |
26 public: | 24 public: |
27 // A callback to be called when GetFileInfo method call succeeds. | 25 // A callback to be called when GetFileInfo method call succeeds. |
28 typedef base::Callback< | 26 typedef base::Callback< |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Ownership of |MTPDeviceAsyncDelegate| is handed off to the delegate | 71 // Ownership of |MTPDeviceAsyncDelegate| is handed off to the delegate |
74 // implementation class by this call. This function should take care of | 72 // implementation class by this call. This function should take care of |
75 // cancelling all the pending tasks before deleting itself. | 73 // cancelling all the pending tasks before deleting itself. |
76 virtual void CancelPendingTasksAndDeleteDelegate() = 0; | 74 virtual void CancelPendingTasksAndDeleteDelegate() = 0; |
77 | 75 |
78 protected: | 76 protected: |
79 // Always destruct this object via CancelPendingTasksAndDeleteDelegate(). | 77 // Always destruct this object via CancelPendingTasksAndDeleteDelegate(). |
80 virtual ~MTPDeviceAsyncDelegate() {} | 78 virtual ~MTPDeviceAsyncDelegate() {} |
81 }; | 79 }; |
82 | 80 |
83 } // namespace chrome | |
84 | |
85 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ | 81 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_ASYNC_DELEGATE_H_ |
OLD | NEW |