OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DATABASE_VFS_BACKEND_H_ | 5 #ifndef WEBKIT_DATABASE_VFS_BACKEND_H_ |
6 #define WEBKIT_DATABASE_VFS_BACKEND_H_ | 6 #define WEBKIT_DATABASE_VFS_BACKEND_H_ |
7 | 7 |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "webkit/storage/webkit_storage_export.h" |
11 | 12 |
12 class FilePath; | 13 class FilePath; |
13 | 14 |
14 namespace webkit_database { | 15 namespace webkit_database { |
15 | 16 |
16 class VfsBackend { | 17 class WEBKIT_STORAGE_EXPORT VfsBackend { |
17 public: | 18 public: |
18 static void OpenFile(const FilePath& file_path, | 19 static void OpenFile(const FilePath& file_path, |
19 int desired_flags, | 20 int desired_flags, |
20 base::PlatformFile* file_handle); | 21 base::PlatformFile* file_handle); |
21 | 22 |
22 static void OpenTempFileInDirectory(const FilePath& dir_path, | 23 static void OpenTempFileInDirectory(const FilePath& dir_path, |
23 int desired_flags, | 24 int desired_flags, |
24 base::PlatformFile* file_handle); | 25 base::PlatformFile* file_handle); |
25 | 26 |
26 static int DeleteFile(const FilePath& file_path, bool sync_dir); | 27 static int DeleteFile(const FilePath& file_path, bool sync_dir); |
27 | 28 |
28 static uint32 GetFileAttributes(const FilePath& file_path); | 29 static uint32 GetFileAttributes(const FilePath& file_path); |
29 | 30 |
30 static int64 GetFileSize(const FilePath& file_path); | 31 static int64 GetFileSize(const FilePath& file_path); |
31 | 32 |
32 // Used to make decisions in the DatabaseDispatcherHost. | 33 // Used to make decisions in the DatabaseDispatcherHost. |
33 static bool OpenTypeIsReadWrite(int desired_flags); | 34 static bool OpenTypeIsReadWrite(int desired_flags); |
34 | 35 |
35 private: | 36 private: |
36 static bool OpenFileFlagsAreConsistent(int desired_flags); | 37 static bool OpenFileFlagsAreConsistent(int desired_flags); |
37 }; | 38 }; |
38 | 39 |
39 } // namespace webkit_database | 40 } // namespace webkit_database |
40 | 41 |
41 #endif // WEBKIT_DATABASE_VFS_BACKEND_H_ | 42 #endif // WEBKIT_DATABASE_VFS_BACKEND_H_ |
OLD | NEW |