| 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/blob/shareable_file_reference.h" | 16 #include "webkit/blob/shareable_file_reference.h" |
| 17 #include "webkit/fileapi/file_system_directory_database.h" | 17 #include "webkit/fileapi/file_system_directory_database.h" |
| 18 #include "webkit/fileapi/file_system_file_util.h" | 18 #include "webkit/fileapi/file_system_file_util.h" |
| 19 #include "webkit/fileapi/file_system_origin_database.h" | 19 #include "webkit/fileapi/file_system_origin_database.h" |
| 20 #include "webkit/fileapi/file_system_types.h" | 20 #include "webkit/fileapi/file_system_types.h" |
| 21 #include "webkit/fileapi/file_system_url.h" | 21 #include "webkit/fileapi/file_system_url.h" |
| 22 #include "webkit/fileapi/fileapi_export.h" | 22 #include "webkit/storage/webkit_storage_export.h" |
| 23 | 23 |
| 24 namespace base { | 24 namespace base { |
| 25 struct PlatformFileInfo; | 25 struct PlatformFileInfo; |
| 26 class Time; | 26 class Time; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class GURL; | 29 class GURL; |
| 30 | 30 |
| 31 namespace fileapi { | 31 namespace fileapi { |
| 32 | 32 |
| 33 class FileSystemOperationContext; | 33 class FileSystemOperationContext; |
| 34 | 34 |
| 35 // The overall implementation philosophy of this class is that partial failures | 35 // The overall implementation philosophy of this class is that partial failures |
| 36 // should leave us with an intact database; we'd prefer to leak the occasional | 36 // should leave us with an intact database; we'd prefer to leak the occasional |
| 37 // backing file than have a database entry whose backing file is missing. When | 37 // backing file than have a database entry whose backing file is missing. When |
| 38 // doing FSCK operations, if you find a loose backing file with no reference, | 38 // doing FSCK operations, if you find a loose backing file with no reference, |
| 39 // you may safely delete it. | 39 // you may safely delete it. |
| 40 // | 40 // |
| 41 // This class must be deleted on the FILE thread, because that's where | 41 // This class must be deleted on the FILE thread, because that's where |
| 42 // DropDatabases needs to be called. | 42 // DropDatabases needs to be called. |
| 43 class FILEAPI_EXPORT_PRIVATE ObfuscatedFileUtil : public FileSystemFileUtil { | 43 class WEBKIT_STORAGE_EXPORT_PRIVATE ObfuscatedFileUtil |
| 44 : public FileSystemFileUtil { |
| 44 public: | 45 public: |
| 45 // Origin enumerator interface. | 46 // Origin enumerator interface. |
| 46 // An instance of this interface is assumed to be called on the file thread. | 47 // An instance of this interface is assumed to be called on the file thread. |
| 47 class AbstractOriginEnumerator { | 48 class AbstractOriginEnumerator { |
| 48 public: | 49 public: |
| 49 virtual ~AbstractOriginEnumerator() {} | 50 virtual ~AbstractOriginEnumerator() {} |
| 50 | 51 |
| 51 // Returns the next origin. Returns empty if there are no more origins. | 52 // Returns the next origin. Returns empty if there are no more origins. |
| 52 virtual GURL Next() = 0; | 53 virtual GURL Next() = 0; |
| 53 | 54 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 scoped_ptr<FileSystemOriginDatabase> origin_database_; | 252 scoped_ptr<FileSystemOriginDatabase> origin_database_; |
| 252 FilePath file_system_directory_; | 253 FilePath file_system_directory_; |
| 253 base::OneShotTimer<ObfuscatedFileUtil> timer_; | 254 base::OneShotTimer<ObfuscatedFileUtil> timer_; |
| 254 | 255 |
| 255 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); | 256 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); |
| 256 }; | 257 }; |
| 257 | 258 |
| 258 } // namespace fileapi | 259 } // namespace fileapi |
| 259 | 260 |
| 260 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ | 261 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ |
| OLD | NEW |