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_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/platform_file.h" | |
12 #include "webkit/browser/fileapi/file_system_operation.h" | 11 #include "webkit/browser/fileapi/file_system_operation.h" |
13 #include "webkit/browser/webkit_storage_browser_export.h" | 12 #include "webkit/browser/webkit_storage_browser_export.h" |
14 #include "webkit/common/blob/scoped_file.h" | 13 #include "webkit/common/blob/scoped_file.h" |
15 | 14 |
16 namespace base { | 15 namespace base { |
17 class Time; | 16 class Time; |
18 } | 17 } |
19 | 18 |
20 namespace fileapi { | 19 namespace fileapi { |
21 | 20 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual int64 Size() OVERRIDE; | 53 virtual int64 Size() OVERRIDE; |
55 virtual base::Time LastModifiedTime() OVERRIDE; | 54 virtual base::Time LastModifiedTime() OVERRIDE; |
56 virtual bool IsDirectory() OVERRIDE; | 55 virtual bool IsDirectory() OVERRIDE; |
57 }; | 56 }; |
58 | 57 |
59 virtual ~FileSystemFileUtil() {} | 58 virtual ~FileSystemFileUtil() {} |
60 | 59 |
61 // Creates or opens a file with the given flags. | 60 // Creates or opens a file with the given flags. |
62 // See header comments for AsyncFileUtil::CreateOrOpen() for more details. | 61 // See header comments for AsyncFileUtil::CreateOrOpen() for more details. |
63 // This is used only by Pepper/NaCl File API. | 62 // This is used only by Pepper/NaCl File API. |
64 virtual base::File::Error CreateOrOpen( | 63 virtual base::File CreateOrOpen( |
65 FileSystemOperationContext* context, | 64 FileSystemOperationContext* context, |
66 const FileSystemURL& url, | 65 const FileSystemURL& url, |
67 int file_flags, | 66 int file_flags) = 0; |
68 base::PlatformFile* file_handle, | |
69 bool* created) = 0; | |
70 | |
71 // Closes the given file handle. | |
72 // This is used only for Pepper/NaCl File API. | |
73 virtual base::File::Error Close( | |
74 FileSystemOperationContext* context, | |
75 base::PlatformFile file) = 0; | |
76 | 67 |
77 // Ensures that the given |url| exist. This creates a empty new file | 68 // Ensures that the given |url| exist. This creates a empty new file |
78 // at |url| if the |url| does not exist. | 69 // at |url| if the |url| does not exist. |
79 // See header comments for AsyncFileUtil::EnsureFileExists() for more details. | 70 // See header comments for AsyncFileUtil::EnsureFileExists() for more details. |
80 virtual base::File::Error EnsureFileExists( | 71 virtual base::File::Error EnsureFileExists( |
81 FileSystemOperationContext* context, | 72 FileSystemOperationContext* context, |
82 const FileSystemURL& url, bool* created) = 0; | 73 const FileSystemURL& url, bool* created) = 0; |
83 | 74 |
84 // Creates directory at given url. | 75 // Creates directory at given url. |
85 // See header comments for AsyncFileUtil::CreateDirectory() for more details. | 76 // See header comments for AsyncFileUtil::CreateDirectory() for more details. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 protected: | 177 protected: |
187 FileSystemFileUtil() {} | 178 FileSystemFileUtil() {} |
188 | 179 |
189 private: | 180 private: |
190 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 181 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
191 }; | 182 }; |
192 | 183 |
193 } // namespace fileapi | 184 } // namespace fileapi |
194 | 185 |
195 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 186 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |