OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | |
9 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
10 #include "base/platform_file.h" | 9 #include "webkit/browser/fileapi/async_file_util.h" |
11 #include "webkit/browser/fileapi/file_system_file_util.h" | 10 #include "webkit/browser/fileapi/file_system_file_util.h" |
12 #include "webkit/storage/webkit_storage_export.h" | |
13 | |
14 namespace base { | |
15 class FilePath; | |
16 class Time; | |
17 } | |
18 | |
19 class GURL; | |
20 | 11 |
21 namespace fileapi { | 12 namespace fileapi { |
22 | 13 |
23 class FileSystemOperationContext; | 14 class FileSystemContext; |
24 class FileSystemURL; | 15 class FileSystemURL; |
25 | 16 |
26 // An instance of this class is created and owned by *MountPointProvider. | 17 // A helper class to perform async file operations in a synchronous way. |
27 class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil { | 18 class AsyncFileUtilTestHelper : public FileSystemFileUtil { |
vandebo (ex-Chrome)
2013/05/31 23:22:17
Since this no longer implements the interface, jus
tommycli
2013/06/01 01:40:54
Done.
| |
28 public: | 19 public: |
29 LocalFileUtil(); | 20 explicit AsyncFileUtilTestHelper(AsyncFileUtil* async_file_util); |
30 virtual ~LocalFileUtil(); | 21 virtual ~AsyncFileUtilTestHelper(); |
31 | 22 |
23 // FileSystemFileUtil overrides. | |
32 virtual base::PlatformFileError CreateOrOpen( | 24 virtual base::PlatformFileError CreateOrOpen( |
33 FileSystemOperationContext* context, | 25 FileSystemOperationContext* context, |
34 const FileSystemURL& url, | 26 const FileSystemURL& url, |
35 int file_flags, | 27 int file_flags, |
36 base::PlatformFile* file_handle, | 28 base::PlatformFile* file_handle, |
37 bool* created) OVERRIDE; | 29 bool* created) OVERRIDE; |
38 virtual base::PlatformFileError Close( | 30 virtual base::PlatformFileError Close( |
39 FileSystemOperationContext* context, | 31 FileSystemOperationContext* context, |
40 base::PlatformFile file) OVERRIDE; | 32 base::PlatformFile file) OVERRIDE; |
41 virtual base::PlatformFileError EnsureFileExists( | 33 virtual base::PlatformFileError EnsureFileExists( |
42 FileSystemOperationContext* context, | 34 FileSystemOperationContext* context, |
43 const FileSystemURL& url, bool* created) OVERRIDE; | 35 const FileSystemURL& url, bool* created) OVERRIDE; |
44 virtual base::PlatformFileError CreateDirectory( | 36 virtual base::PlatformFileError CreateDirectory( |
45 FileSystemOperationContext* context, | 37 FileSystemOperationContext* context, |
46 const FileSystemURL& url, | 38 const FileSystemURL& url, |
47 bool exclusive, | 39 bool exclusive, |
48 bool recursive) OVERRIDE; | 40 bool recursive) OVERRIDE; |
49 virtual base::PlatformFileError GetFileInfo( | 41 virtual base::PlatformFileError GetFileInfo( |
50 FileSystemOperationContext* context, | 42 FileSystemOperationContext* context, |
51 const FileSystemURL& url, | 43 const FileSystemURL& url, |
52 base::PlatformFileInfo* file_info, | 44 base::PlatformFileInfo* file_info, |
53 base::FilePath* platform_file) OVERRIDE; | 45 base::FilePath* platform_path) OVERRIDE; |
46 // Not implemented. Use ReadDirectorySync instead. | |
54 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( | 47 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( |
55 FileSystemOperationContext* context, | 48 FileSystemOperationContext* context, |
56 const FileSystemURL& root_url) OVERRIDE; | 49 const FileSystemURL& root_url) OVERRIDE; |
50 // Not implemented. | |
57 virtual base::PlatformFileError GetLocalFilePath( | 51 virtual base::PlatformFileError GetLocalFilePath( |
58 FileSystemOperationContext* context, | 52 FileSystemOperationContext* context, |
59 const FileSystemURL& file_system_url, | 53 const FileSystemURL& file_system_url, |
60 base::FilePath* local_file_path) OVERRIDE; | 54 base::FilePath* local_file_path) OVERRIDE; |
61 virtual base::PlatformFileError Touch( | 55 virtual base::PlatformFileError Touch( |
62 FileSystemOperationContext* context, | 56 FileSystemOperationContext* context, |
63 const FileSystemURL& url, | 57 const FileSystemURL& url, |
64 const base::Time& last_access_time, | 58 const base::Time& last_access_time, |
65 const base::Time& last_modified_time) OVERRIDE; | 59 const base::Time& last_modified_time) OVERRIDE; |
66 virtual base::PlatformFileError Truncate( | 60 virtual base::PlatformFileError Truncate( |
67 FileSystemOperationContext* context, | 61 FileSystemOperationContext* context, |
68 const FileSystemURL& url, | 62 const FileSystemURL& url, |
69 int64 length) OVERRIDE; | 63 int64 length) OVERRIDE; |
64 // Not implemented. | |
70 virtual base::PlatformFileError CopyOrMoveFile( | 65 virtual base::PlatformFileError CopyOrMoveFile( |
71 FileSystemOperationContext* context, | 66 FileSystemOperationContext* context, |
72 const FileSystemURL& src_url, | 67 const FileSystemURL& src_url, |
73 const FileSystemURL& dest_url, | 68 const FileSystemURL& dest_url, |
74 bool copy) OVERRIDE; | 69 bool copy) OVERRIDE; |
70 // Not implemented. | |
75 virtual base::PlatformFileError CopyInForeignFile( | 71 virtual base::PlatformFileError CopyInForeignFile( |
76 FileSystemOperationContext* context, | 72 FileSystemOperationContext* context, |
77 const base::FilePath& src_file_path, | 73 const base::FilePath& src_file_path, |
78 const FileSystemURL& dest_url) OVERRIDE; | 74 const FileSystemURL& dest_url) OVERRIDE; |
75 // Not implemented. | |
79 virtual base::PlatformFileError DeleteFile( | 76 virtual base::PlatformFileError DeleteFile( |
80 FileSystemOperationContext* context, | 77 FileSystemOperationContext* context, |
81 const FileSystemURL& url) OVERRIDE; | 78 const FileSystemURL& url) OVERRIDE; |
79 // Not implemented. | |
82 virtual base::PlatformFileError DeleteDirectory( | 80 virtual base::PlatformFileError DeleteDirectory( |
83 FileSystemOperationContext* context, | 81 FileSystemOperationContext* context, |
84 const FileSystemURL& url) OVERRIDE; | 82 const FileSystemURL& url) OVERRIDE; |
83 // Not implemented. Use CreateSnapshotFileSharable instead. | |
85 virtual webkit_blob::ScopedFile CreateSnapshotFile( | 84 virtual webkit_blob::ScopedFile CreateSnapshotFile( |
86 FileSystemOperationContext* context, | 85 FileSystemOperationContext* context, |
87 const FileSystemURL& url, | 86 const FileSystemURL& url, |
88 base::PlatformFileError* error, | 87 base::PlatformFileError* error, |
89 base::PlatformFileInfo* file_info, | 88 base::PlatformFileInfo* file_info, |
90 base::FilePath* platform_path) OVERRIDE; | 89 base::FilePath* platform_path) OVERRIDE; |
91 | 90 |
91 virtual base::PlatformFileError ReadDirectorySync( | |
92 FileSystemOperationContext* context, | |
93 const FileSystemURL& url, | |
94 AsyncFileUtil::EntryList* file_list, | |
95 bool* has_more); | |
96 | |
97 virtual scoped_refptr<webkit_blob::ShareableFileReference> | |
98 CreateSnapshotFileSharable( | |
99 FileSystemOperationContext* context, | |
100 const FileSystemURL& url, | |
101 base::PlatformFileError* error, | |
102 base::PlatformFileInfo* file_info, | |
103 base::FilePath* platform_path); | |
92 private: | 104 private: |
93 DISALLOW_COPY_AND_ASSIGN(LocalFileUtil); | 105 scoped_ptr<AsyncFileUtil> async_file_util_; |
94 }; | 106 }; |
95 | 107 |
96 } // namespace fileapi | 108 } // namespace fileapi |
97 | 109 |
98 #endif // WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_ | 110 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_ASYNC_FILE_UTIL_TEST_HELPER_H_ |
OLD | NEW |