Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: webkit/fileapi/media/mtp_device_async_delegate.h

Issue 12255023: [Media Galleries] Switch Mac MTP delegate to async interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle multiple async calls Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ 5 #ifndef WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_
6 #define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ 6 #define WEBKIT_FILEAPI_MEDIA_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/fileapi/async_file_util.h" 11 #include "webkit/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 fileapi { 17 namespace fileapi {
18 18
19 // Asynchronous delegate for media transfer protocol (MTP) device to perform 19 // Asynchronous delegate for media transfer protocol (MTP) device to perform
20 // media device isolated file system operations. Class that implements this 20 // media device isolated file system operations. Class that implements this
21 // delegate does the actual communication with the MTP device. 21 // delegate does the actual communication with the MTP device.
22 // ScopedMTPDeviceMapEntry class manages the lifetime of the delegate via 22 // ScopedMTPDeviceMapEntry class manages the lifetime of the delegate via
23 // MTPDeviceMapService class. Member functions and callbacks runs on the IO 23 // MTPDeviceMapService class. Member functions and callbacks runs on the IO
24 // thread. 24 // thread.
25 // Note: caller must ensure that the deleting call is not made while there are
Lei Zhang 2013/03/18 09:25:55 I don't think the caller to CancelPendingTasksAndD
Greg Billock 2013/03/20 23:43:55 Uggh. I wasn't sure about this. OK, I'll switch it
26 // outstanding async calls to the delegate.
25 class MTPDeviceAsyncDelegate { 27 class MTPDeviceAsyncDelegate {
26 public: 28 public:
27 // A callback to be called when GetFileInfo method call succeeds. 29 // A callback to be called when GetFileInfo method call succeeds.
28 typedef base::Callback< 30 typedef base::Callback<
29 void(const base::PlatformFileInfo& file_info)> GetFileInfoSuccessCallback; 31 void(const base::PlatformFileInfo& file_info)> GetFileInfoSuccessCallback;
30 32
31 // A callback to be called when ReadDirectory method call succeeds. 33 // A callback to be called when ReadDirectory method call succeeds.
32 typedef base::Callback< 34 typedef base::Callback<
33 void(const AsyncFileUtil::EntryList& file_list, 35 void(const AsyncFileUtil::EntryList& file_list,
34 bool has_more)> ReadDirectorySuccessCallback; 36 bool has_more)> ReadDirectorySuccessCallback;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 virtual void CancelPendingTasksAndDeleteDelegate() = 0; 78 virtual void CancelPendingTasksAndDeleteDelegate() = 0;
77 79
78 protected: 80 protected:
79 // Always destruct this object via CancelPendingTasksAndDeleteDelegate(). 81 // Always destruct this object via CancelPendingTasksAndDeleteDelegate().
80 virtual ~MTPDeviceAsyncDelegate() {} 82 virtual ~MTPDeviceAsyncDelegate() {}
81 }; 83 };
82 84
83 } // namespace fileapi 85 } // namespace fileapi
84 86
85 #endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_ 87 #endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_ASYNC_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698