| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 11 |
| 12 class FilePath; | 12 class FilePath; |
| 13 | 13 |
| 14 namespace webkit_database { | 14 namespace webkit_database { |
| 15 | 15 |
| 16 class VfsBackend { | 16 class VfsBackend { |
| 17 public: | 17 public: |
| 18 static void GetFileHandleForProcess(base::ProcessHandle process_handle, |
| 19 const base::PlatformFile& file_handle, |
| 20 base::PlatformFile* target_handle, |
| 21 bool close_source_handle); |
| 22 |
| 18 static void OpenFile(const FilePath& file_path, | 23 static void OpenFile(const FilePath& file_path, |
| 19 int desired_flags, | 24 int desired_flags, |
| 20 base::ProcessHandle handle, | 25 base::PlatformFile* file_handle); |
| 21 base::PlatformFile* target_handle); | |
| 22 | 26 |
| 23 static void OpenTempFileInDirectory(const FilePath& dir_path, | 27 static void OpenTempFileInDirectory(const FilePath& dir_path, |
| 24 int desired_flags, | 28 int desired_flags, |
| 25 base::ProcessHandle handle, | 29 base::PlatformFile* file_handle); |
| 26 base::PlatformFile* target_handle); | |
| 27 | 30 |
| 28 static int DeleteFile(const FilePath& file_path, bool sync_dir); | 31 static int DeleteFile(const FilePath& file_path, bool sync_dir); |
| 29 | 32 |
| 30 static uint32 GetFileAttributes(const FilePath& file_path); | 33 static uint32 GetFileAttributes(const FilePath& file_path); |
| 31 | 34 |
| 32 static int64 GetFileSize(const FilePath& file_path); | 35 static int64 GetFileSize(const FilePath& file_path); |
| 33 | 36 |
| 34 // Used to make decisions in the DatabaseDispatcherHost. | 37 // Used to make decisions in the DatabaseDispatcherHost. |
| 35 static bool FileTypeIsMainDB(int desired_flags); | 38 static bool FileTypeIsMainDB(int desired_flags); |
| 39 static bool FileTypeIsJournal(int desired_flags); |
| 36 static bool OpenTypeIsReadWrite(int desired_flags); | 40 static bool OpenTypeIsReadWrite(int desired_flags); |
| 37 | 41 |
| 38 private: | 42 private: |
| 39 static bool OpenFileFlagsAreConsistent(int desired_flags); | 43 static bool OpenFileFlagsAreConsistent(int desired_flags); |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 } // namespace webkit_database | 46 } // namespace webkit_database |
| 43 | 47 |
| 44 #endif // WEBKIT_DATABASE_VFS_BACKEND_H_ | 48 #endif // WEBKIT_DATABASE_VFS_BACKEND_H_ |
| OLD | NEW |