OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DELEGATE_H_ | 5 #ifndef WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_DELEGATE_H_ |
6 #define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_DELEGATE_H_ | 6 #define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "webkit/fileapi/file_system_file_util.h" | 10 #include "webkit/fileapi/file_system_file_util.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // the file entries of |root| path. The instance needs to be freed by the | 33 // the file entries of |root| path. The instance needs to be freed by the |
34 // caller, and its lifetime should not extend past when the current call | 34 // caller, and its lifetime should not extend past when the current call |
35 // returns to the main media task runner thread. | 35 // returns to the main media task runner thread. |
36 virtual scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> | 36 virtual scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> |
37 CreateFileEnumerator(const FilePath& root, | 37 CreateFileEnumerator(const FilePath& root, |
38 bool recursive) = 0; | 38 bool recursive) = 0; |
39 | 39 |
40 // Updates the temporary snapshot file contents given by |local_path| with | 40 // Updates the temporary snapshot file contents given by |local_path| with |
41 // media file contents given by |device_file_path| and also returns the | 41 // media file contents given by |device_file_path| and also returns the |
42 // metadata of the temporary file. | 42 // metadata of the temporary file. |
43 virtual PlatformFileError CreateSnapshotFile( | 43 virtual base::PlatformFileError CreateSnapshotFile( |
44 const FilePath& device_file_path, | 44 const FilePath& device_file_path, |
45 const FilePath& local_path, | 45 const FilePath& local_path, |
46 base::PlatformFileInfo* file_info) = 0; | 46 base::PlatformFileInfo* file_info) = 0; |
47 | 47 |
48 // Called when the | 48 // Called when the |
49 // (1) Browser application is in shutdown mode (or) | 49 // (1) Browser application is in shutdown mode (or) |
50 // (2) Last extension using this MTP device is destroyed (or) | 50 // (2) Last extension using this MTP device is destroyed (or) |
51 // (3) Attached MTP device is removed (or) | 51 // (3) Attached MTP device is removed (or) |
52 // (4) User revoked the MTP device gallery permission. | 52 // (4) User revoked the MTP device gallery permission. |
53 // Ownership of |MTPDeviceDelegate| is handed off to the delegate | 53 // Ownership of |MTPDeviceDelegate| is handed off to the delegate |
54 // implementation class by this call. This function should take care of | 54 // implementation class by this call. This function should take care of |
55 // deleting itself on the right thread. This function should cancel all the | 55 // deleting itself on the right thread. This function should cancel all the |
56 // pending requests before posting any message to delete itself. | 56 // pending requests before posting any message to delete itself. |
57 // Called on the UI thread. | 57 // Called on the UI thread. |
58 virtual void CancelPendingTasksAndDeleteDelegate() = 0; | 58 virtual void CancelPendingTasksAndDeleteDelegate() = 0; |
59 | 59 |
60 protected: | 60 protected: |
61 // Always destruct this object via CancelPendingTasksAndDeleteDelegate(). | 61 // Always destruct this object via CancelPendingTasksAndDeleteDelegate(). |
62 virtual ~MTPDeviceDelegate() {} | 62 virtual ~MTPDeviceDelegate() {} |
63 }; | 63 }; |
64 | 64 |
65 } // namespace fileapi | 65 } // namespace fileapi |
66 | 66 |
67 #endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_DELEGATE_H_ | 67 #endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_DELEGATE_H_ |
OLD | NEW |