Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320)
[chromium-blink-merge.git] / storage / browser / database / vfs_backend.h
blob2b625d13de32e4ec2282c9b0ef617cb879d5620f
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
3 // found in the LICENSE file.
5 #ifndef STORAGE_BROWSER_DATABASE_VFS_BACKEND_H_
6 #define STORAGE_BROWSER_DATABASE_VFS_BACKEND_H_
8 #include "base/files/file.h"
9 #include "base/process/process.h"
10 #include "base/strings/string16.h"
11 #include "storage/browser/storage_browser_export.h"
13 namespace base {
14 class FilePath;
17 namespace storage {
19 class STORAGE_EXPORT VfsBackend {
20 public:
21 static base::File OpenFile(const base::FilePath& file_path,
22 int desired_flags);
24 static base::File OpenTempFileInDirectory(const base::FilePath& dir_path,
25 int desired_flags);
27 static int DeleteFile(const base::FilePath& file_path, bool sync_dir);
29 static uint32 GetFileAttributes(const base::FilePath& file_path);
31 static int64 GetFileSize(const base::FilePath& file_path);
33 static bool SetFileSize(const base::FilePath& file_path, int64 size);
35 // Used to make decisions in the DatabaseDispatcherHost.
36 static bool OpenTypeIsReadWrite(int desired_flags);
38 private:
39 static bool OpenFileFlagsAreConsistent(int desired_flags);
42 } // namespace storage
44 #endif // STORAGE_BROWSER_DATABASE_VFS_BACKEND_H_