When enabling new profile management programmatically, make sure to set the
[chromium-blink-merge.git] / webkit / browser / fileapi / local_file_util.h
blob18199ad6f5614f68a38859fb59d647d0887ce4df
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
3 // found in the LICENSE file.
5 #ifndef WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_
6 #define WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_
8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "webkit/browser/fileapi/file_system_file_util.h"
12 #include "webkit/browser/webkit_storage_browser_export.h"
14 namespace base {
15 class Time;
18 class GURL;
20 namespace fileapi {
22 class FileSystemOperationContext;
23 class FileSystemURL;
25 // An instance of this class is created and owned by *FileSystemBackend.
26 class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileUtil
27 : public FileSystemFileUtil {
28 public:
29 LocalFileUtil();
30 virtual ~LocalFileUtil();
32 virtual base::File CreateOrOpen(
33 FileSystemOperationContext* context,
34 const FileSystemURL& url,
35 int file_flags) OVERRIDE;
36 virtual base::File::Error EnsureFileExists(
37 FileSystemOperationContext* context,
38 const FileSystemURL& url, bool* created) OVERRIDE;
39 virtual base::File::Error CreateDirectory(
40 FileSystemOperationContext* context,
41 const FileSystemURL& url,
42 bool exclusive,
43 bool recursive) OVERRIDE;
44 virtual base::File::Error GetFileInfo(
45 FileSystemOperationContext* context,
46 const FileSystemURL& url,
47 base::File::Info* file_info,
48 base::FilePath* platform_file) OVERRIDE;
49 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator(
50 FileSystemOperationContext* context,
51 const FileSystemURL& root_url) OVERRIDE;
52 virtual base::File::Error GetLocalFilePath(
53 FileSystemOperationContext* context,
54 const FileSystemURL& file_system_url,
55 base::FilePath* local_file_path) OVERRIDE;
56 virtual base::File::Error Touch(
57 FileSystemOperationContext* context,
58 const FileSystemURL& url,
59 const base::Time& last_access_time,
60 const base::Time& last_modified_time) OVERRIDE;
61 virtual base::File::Error Truncate(
62 FileSystemOperationContext* context,
63 const FileSystemURL& url,
64 int64 length) OVERRIDE;
65 virtual base::File::Error CopyOrMoveFile(
66 FileSystemOperationContext* context,
67 const FileSystemURL& src_url,
68 const FileSystemURL& dest_url,
69 CopyOrMoveOption option,
70 bool copy) OVERRIDE;
71 virtual base::File::Error CopyInForeignFile(
72 FileSystemOperationContext* context,
73 const base::FilePath& src_file_path,
74 const FileSystemURL& dest_url) OVERRIDE;
75 virtual base::File::Error DeleteFile(
76 FileSystemOperationContext* context,
77 const FileSystemURL& url) OVERRIDE;
78 virtual base::File::Error DeleteDirectory(
79 FileSystemOperationContext* context,
80 const FileSystemURL& url) OVERRIDE;
81 virtual webkit_blob::ScopedFile CreateSnapshotFile(
82 FileSystemOperationContext* context,
83 const FileSystemURL& url,
84 base::File::Error* error,
85 base::File::Info* file_info,
86 base::FilePath* platform_path) OVERRIDE;
88 private:
89 DISALLOW_COPY_AND_ASSIGN(LocalFileUtil);
92 } // namespace fileapi
94 #endif // WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_