Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: webkit/fileapi/file_system_file_util_proxy.h

Issue 7433006: Pepper quota support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 15 matching lines...) Expand all
26 using base::MessageLoopProxy; 26 using base::MessageLoopProxy;
27 using base::PlatformFile; 27 using base::PlatformFile;
28 using base::PlatformFileError; 28 using base::PlatformFileError;
29 using base::PlatformFileInfo; 29 using base::PlatformFileInfo;
30 30
31 // This class provides asynchronous access to common file routines for the 31 // This class provides asynchronous access to common file routines for the
32 // FileSystem API. 32 // FileSystem API.
33 class FileSystemFileUtilProxy { 33 class FileSystemFileUtilProxy {
34 public: 34 public:
35 typedef base::FileUtilProxy::StatusCallback StatusCallback; 35 typedef base::FileUtilProxy::StatusCallback StatusCallback;
36 typedef base::FileUtilProxy::CreateOrOpenCallback CreateOrOpenCallback; 36 typedef Callback4<PlatformFileError /* error code */,
37 base::PassPlatformFile,
38 bool /* created */,
39 int64 /* file_size, or -1 when there was an error. */
40 >::Type CreateOrOpenCallback;
37 typedef base::FileUtilProxy::EnsureFileExistsCallback 41 typedef base::FileUtilProxy::EnsureFileExistsCallback
38 EnsureFileExistsCallback; 42 EnsureFileExistsCallback;
39 typedef Callback3<PlatformFileError /* error code */, 43 typedef Callback3<PlatformFileError /* error code */,
40 const PlatformFileInfo& /* file_info */, 44 const PlatformFileInfo& /* file_info */,
41 const FilePath& /* platform_path, where possible */ 45 const FilePath& /* platform_path, where possible */
42 >::Type GetFileInfoCallback; 46 >::Type GetFileInfoCallback;
43 typedef Callback2<PlatformFileError /* error code */, 47 typedef Callback2<PlatformFileError /* error code */,
44 const FilePath& /* local_path, where possible */ 48 const FilePath& /* local_path, where possible */
45 >::Type GetLocalPathCallback; 49 >::Type GetLocalPathCallback;
46 typedef base::FileUtilProxy::ReadDirectoryCallback ReadDirectoryCallback; 50 typedef base::FileUtilProxy::ReadDirectoryCallback ReadDirectoryCallback;
47 51
48 // Creates or opens a file with the given flags. It is invalid to pass NULL 52 // Creates or opens a file with the given flags.
49 // for the callback. 53 // It is invalid to pass NULL for the callback.
50 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create 54 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create
51 // a new file at the given |file_path| and calls back with 55 // a new file at the given |file_path| and calls back with
52 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists. 56 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists.
53 static bool CreateOrOpen(const FileSystemOperationContext& context, 57 // |file_size| parameter of the CreateOrOpenCallback is set to -1 if
54 scoped_refptr<MessageLoopProxy> message_loop_proxy, 58 // the error code is not PLATFORM_FILE_OK.
55 const FilePath& file_path, 59 static bool CreateOrOpenAndQuerySize(
56 int file_flags, 60 const FileSystemOperationContext& context,
57 CreateOrOpenCallback* callback); 61 scoped_refptr<MessageLoopProxy> message_loop_proxy,
62 const FilePath& file_path,
63 int file_flags,
64 CreateOrOpenCallback* callback);
58 65
59 // Close the given file handle. 66 // Close the given file handle.
60 static bool Close(const FileSystemOperationContext& context, 67 static bool Close(const FileSystemOperationContext& context,
61 scoped_refptr<MessageLoopProxy> message_loop_proxy, 68 scoped_refptr<MessageLoopProxy> message_loop_proxy,
62 PlatformFile, 69 PlatformFile,
63 StatusCallback* callback); 70 StatusCallback* callback);
64 71
65 // Ensures that the given |file_path| exist. This creates a empty new file 72 // Ensures that the given |file_path| exist. This creates a empty new file
66 // at |file_path| if the |file_path| does not exist. 73 // at |file_path| if the |file_path| does not exist.
67 // If a new file han not existed and is created at the |file_path|, 74 // If a new file han not existed and is created at the |file_path|,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 int64 length, 164 int64 length,
158 StatusCallback* callback); 165 StatusCallback* callback);
159 166
160 private: 167 private:
161 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); 168 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy);
162 }; 169 };
163 170
164 } // namespace fileapi 171 } // namespace fileapi
165 172
166 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ 173 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698