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_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "webkit/browser/fileapi/file_system_operation.h" | 11 #include "webkit/browser/fileapi/file_system_operation.h" |
12 #include "webkit/browser/webkit_storage_browser_export.h" | 12 #include "webkit/browser/storage_export.h" |
13 #include "webkit/common/blob/scoped_file.h" | 13 #include "webkit/common/blob/scoped_file.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class Time; | 16 class Time; |
17 } | 17 } |
18 | 18 |
19 namespace storage { | 19 namespace storage { |
20 | 20 |
21 class FileSystemOperationContext; | 21 class FileSystemOperationContext; |
22 class FileSystemURL; | 22 class FileSystemURL; |
23 | 23 |
24 // A file utility interface that provides basic file utility methods for | 24 // A file utility interface that provides basic file utility methods for |
25 // FileSystem API. | 25 // FileSystem API. |
26 // | 26 // |
27 // Layering structure of the FileSystemFileUtil was split out. | 27 // Layering structure of the FileSystemFileUtil was split out. |
28 // See http://crbug.com/128136 if you need it. | 28 // See http://crbug.com/128136 if you need it. |
29 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemFileUtil { | 29 class STORAGE_EXPORT FileSystemFileUtil { |
30 public: | 30 public: |
31 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; | 31 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; |
32 | 32 |
33 // It will be implemented by each subclass such as FileSystemFileEnumerator. | 33 // It will be implemented by each subclass such as FileSystemFileEnumerator. |
34 class WEBKIT_STORAGE_BROWSER_EXPORT AbstractFileEnumerator { | 34 class STORAGE_EXPORT AbstractFileEnumerator { |
35 public: | 35 public: |
36 virtual ~AbstractFileEnumerator() {} | 36 virtual ~AbstractFileEnumerator() {} |
37 | 37 |
38 // Returns an empty string if there are no more results. | 38 // Returns an empty string if there are no more results. |
39 virtual base::FilePath Next() = 0; | 39 virtual base::FilePath Next() = 0; |
40 | 40 |
41 // These methods return metadata for the file most recently returned by | 41 // These methods return metadata for the file most recently returned by |
42 // Next(). If Next() has never been called, or if Next() most recently | 42 // Next(). If Next() has never been called, or if Next() most recently |
43 // returned an empty string, then return the default values of 0, | 43 // returned an empty string, then return the default values of 0, |
44 // "null time", and false, respectively. | 44 // "null time", and false, respectively. |
45 virtual int64 Size() = 0; | 45 virtual int64 Size() = 0; |
46 virtual base::Time LastModifiedTime() = 0; | 46 virtual base::Time LastModifiedTime() = 0; |
47 virtual bool IsDirectory() = 0; | 47 virtual bool IsDirectory() = 0; |
48 }; | 48 }; |
49 | 49 |
50 class WEBKIT_STORAGE_BROWSER_EXPORT EmptyFileEnumerator | 50 class STORAGE_EXPORT EmptyFileEnumerator |
51 : public AbstractFileEnumerator { | 51 : public AbstractFileEnumerator { |
52 virtual base::FilePath Next() OVERRIDE; | 52 virtual base::FilePath Next() OVERRIDE; |
53 virtual int64 Size() OVERRIDE; | 53 virtual int64 Size() OVERRIDE; |
54 virtual base::Time LastModifiedTime() OVERRIDE; | 54 virtual base::Time LastModifiedTime() OVERRIDE; |
55 virtual bool IsDirectory() OVERRIDE; | 55 virtual bool IsDirectory() OVERRIDE; |
56 }; | 56 }; |
57 | 57 |
58 virtual ~FileSystemFileUtil() {} | 58 virtual ~FileSystemFileUtil() {} |
59 | 59 |
60 // Creates or opens a file with the given flags. | 60 // Creates or opens a file with the given flags. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 protected: | 177 protected: |
178 FileSystemFileUtil() {} | 178 FileSystemFileUtil() {} |
179 | 179 |
180 private: | 180 private: |
181 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 181 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace storage | 184 } // namespace storage |
185 | 185 |
186 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 186 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |