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_OBFUSCATED_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ |
6 #define WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util_proxy.h" | 13 #include "base/file_util_proxy.h" |
14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
15 #include "base/timer.h" | 15 #include "base/timer.h" |
| 16 #include "webkit/fileapi/fileapi_export.h" |
16 #include "webkit/fileapi/file_system_directory_database.h" | 17 #include "webkit/fileapi/file_system_directory_database.h" |
17 #include "webkit/fileapi/file_system_file_util.h" | 18 #include "webkit/fileapi/file_system_file_util.h" |
18 #include "webkit/fileapi/file_system_origin_database.h" | 19 #include "webkit/fileapi/file_system_origin_database.h" |
19 #include "webkit/fileapi/file_system_path.h" | 20 #include "webkit/fileapi/file_system_path.h" |
20 #include "webkit/fileapi/file_system_types.h" | 21 #include "webkit/fileapi/file_system_types.h" |
21 | 22 |
22 namespace base { | 23 namespace base { |
23 struct PlatformFileInfo; | 24 struct PlatformFileInfo; |
24 class Time; | 25 class Time; |
25 } | 26 } |
26 | 27 |
27 class GURL; | 28 class GURL; |
28 | 29 |
29 namespace fileapi { | 30 namespace fileapi { |
30 | 31 |
31 class FileSystemOperationContext; | 32 class FileSystemOperationContext; |
32 | 33 |
33 // The overall implementation philosophy of this class is that partial failures | 34 // The overall implementation philosophy of this class is that partial failures |
34 // should leave us with an intact database; we'd prefer to leak the occasional | 35 // should leave us with an intact database; we'd prefer to leak the occasional |
35 // backing file than have a database entry whose backing file is missing. When | 36 // backing file than have a database entry whose backing file is missing. When |
36 // doing FSCK operations, if you find a loose backing file with no reference, | 37 // doing FSCK operations, if you find a loose backing file with no reference, |
37 // you may safely delete it. | 38 // you may safely delete it. |
38 // | 39 // |
39 // This class must be deleted on the FILE thread, because that's where | 40 // This class must be deleted on the FILE thread, because that's where |
40 // DropDatabases needs to be called. | 41 // DropDatabases needs to be called. |
41 class ObfuscatedFileUtil : public FileSystemFileUtil { | 42 class FILEAPI_EXPORT_PRIVATE ObfuscatedFileUtil : public FileSystemFileUtil { |
42 public: | 43 public: |
43 // Origin enumerator interface. | 44 // Origin enumerator interface. |
44 // An instance of this interface is assumed to be called on the file thread. | 45 // An instance of this interface is assumed to be called on the file thread. |
45 class AbstractOriginEnumerator { | 46 class AbstractOriginEnumerator { |
46 public: | 47 public: |
47 virtual ~AbstractOriginEnumerator() {} | 48 virtual ~AbstractOriginEnumerator() {} |
48 | 49 |
49 // Returns the next origin. Returns empty if there are no more origins. | 50 // Returns the next origin. Returns empty if there are no more origins. |
50 virtual GURL Next() = 0; | 51 virtual GURL Next() = 0; |
51 | 52 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 scoped_ptr<FileSystemOriginDatabase> origin_database_; | 266 scoped_ptr<FileSystemOriginDatabase> origin_database_; |
266 FilePath file_system_directory_; | 267 FilePath file_system_directory_; |
267 base::OneShotTimer<ObfuscatedFileUtil> timer_; | 268 base::OneShotTimer<ObfuscatedFileUtil> timer_; |
268 | 269 |
269 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); | 270 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); |
270 }; | 271 }; |
271 | 272 |
272 } // namespace fileapi | 273 } // namespace fileapi |
273 | 274 |
274 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ | 275 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ |
OLD | NEW |