| 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 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 FilePath* local_path) OVERRIDE; | 91 FilePath* local_path) OVERRIDE; |
| 92 virtual base::PlatformFileError Touch( | 92 virtual base::PlatformFileError Touch( |
| 93 FileSystemOperationContext* context, | 93 FileSystemOperationContext* context, |
| 94 const FileSystemURL& url, | 94 const FileSystemURL& url, |
| 95 const base::Time& last_access_time, | 95 const base::Time& last_access_time, |
| 96 const base::Time& last_modified_time) OVERRIDE; | 96 const base::Time& last_modified_time) OVERRIDE; |
| 97 virtual base::PlatformFileError Truncate( | 97 virtual base::PlatformFileError Truncate( |
| 98 FileSystemOperationContext* context, | 98 FileSystemOperationContext* context, |
| 99 const FileSystemURL& url, | 99 const FileSystemURL& url, |
| 100 int64 length) OVERRIDE; | 100 int64 length) OVERRIDE; |
| 101 virtual bool IsDirectoryEmpty( | |
| 102 FileSystemOperationContext* context, | |
| 103 const FileSystemURL& url) OVERRIDE; | |
| 104 virtual base::PlatformFileError CopyOrMoveFile( | 101 virtual base::PlatformFileError CopyOrMoveFile( |
| 105 FileSystemOperationContext* context, | 102 FileSystemOperationContext* context, |
| 106 const FileSystemURL& src_url, | 103 const FileSystemURL& src_url, |
| 107 const FileSystemURL& dest_url, | 104 const FileSystemURL& dest_url, |
| 108 bool copy) OVERRIDE; | 105 bool copy) OVERRIDE; |
| 109 virtual base::PlatformFileError CopyInForeignFile( | 106 virtual base::PlatformFileError CopyInForeignFile( |
| 110 FileSystemOperationContext* context, | 107 FileSystemOperationContext* context, |
| 111 const FilePath& src_file_path, | 108 const FilePath& src_file_path, |
| 112 const FileSystemURL& dest_url) OVERRIDE; | 109 const FileSystemURL& dest_url) OVERRIDE; |
| 113 virtual base::PlatformFileError DeleteFile( | 110 virtual base::PlatformFileError DeleteFile( |
| 114 FileSystemOperationContext* context, | 111 FileSystemOperationContext* context, |
| 115 const FileSystemURL& url) OVERRIDE; | 112 const FileSystemURL& url) OVERRIDE; |
| 116 virtual base::PlatformFileError DeleteSingleDirectory( | 113 virtual base::PlatformFileError DeleteDirectory( |
| 117 FileSystemOperationContext* context, | 114 FileSystemOperationContext* context, |
| 118 const FileSystemURL& url) OVERRIDE; | 115 const FileSystemURL& url) OVERRIDE; |
| 119 virtual base::PlatformFileError CreateSnapshotFile( | 116 virtual base::PlatformFileError CreateSnapshotFile( |
| 120 FileSystemOperationContext* context, | 117 FileSystemOperationContext* context, |
| 121 const FileSystemURL& url, | 118 const FileSystemURL& url, |
| 122 base::PlatformFileInfo* file_info, | 119 base::PlatformFileInfo* file_info, |
| 123 FilePath* platform_path, | 120 FilePath* platform_path, |
| 124 SnapshotFilePolicy* policy) OVERRIDE; | 121 SnapshotFilePolicy* policy) OVERRIDE; |
| 125 | 122 |
| 123 // Returns true if the directory |url| is empty. |
| 124 bool IsDirectoryEmpty( |
| 125 FileSystemOperationContext* context, |
| 126 const FileSystemURL& url); |
| 127 |
| 126 // Gets the topmost directory specific to this origin and type. This will | 128 // Gets the topmost directory specific to this origin and type. This will |
| 127 // contain both the directory database's files and all the backing file | 129 // contain both the directory database's files and all the backing file |
| 128 // subdirectories. | 130 // subdirectories. |
| 129 // Returns an empty path if the directory is undefined (e.g. because |type| | 131 // Returns an empty path if the directory is undefined (e.g. because |type| |
| 130 // is invalid). If the directory is defined, it will be returned, even if | 132 // is invalid). If the directory is defined, it will be returned, even if |
| 131 // there is a file system error (e.g. the directory doesn't exist on disk and | 133 // there is a file system error (e.g. the directory doesn't exist on disk and |
| 132 // |create| is false). Callers should always check |error_code| to make sure | 134 // |create| is false). Callers should always check |error_code| to make sure |
| 133 // the returned path is usable. | 135 // the returned path is usable. |
| 134 FilePath GetDirectoryForOriginAndType( | 136 FilePath GetDirectoryForOriginAndType( |
| 135 const GURL& origin, | 137 const GURL& origin, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 scoped_ptr<FileSystemOriginDatabase> origin_database_; | 240 scoped_ptr<FileSystemOriginDatabase> origin_database_; |
| 239 FilePath file_system_directory_; | 241 FilePath file_system_directory_; |
| 240 base::OneShotTimer<ObfuscatedFileUtil> timer_; | 242 base::OneShotTimer<ObfuscatedFileUtil> timer_; |
| 241 | 243 |
| 242 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); | 244 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); |
| 243 }; | 245 }; |
| 244 | 246 |
| 245 } // namespace fileapi | 247 } // namespace fileapi |
| 246 | 248 |
| 247 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ | 249 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_UTIL_H_ |
| OLD | NEW |