| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Creates or opens a file with the given flags. It is invalid to pass NULL | 48 // Creates or opens a file with the given flags. It is invalid to pass NULL |
| 49 // for the callback. | 49 // for the callback. |
| 50 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 50 // 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 | 51 // a new file at the given |file_path| and calls back with |
| 52 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists. | 52 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |file_path| already exists. |
| 53 static bool CreateOrOpen(const FileSystemOperationContext& context, | 53 static bool CreateOrOpen(const FileSystemOperationContext& context, |
| 54 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 54 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 55 const FilePath& file_path, | 55 const FilePath& file_path, |
| 56 int file_flags, | 56 int file_flags, |
| 57 CreateOrOpenCallback* callback); | 57 const CreateOrOpenCallback& callback); |
| 58 | 58 |
| 59 // Close the given file handle. | 59 // Close the given file handle. |
| 60 static bool Close(const FileSystemOperationContext& context, | 60 static bool Close(const FileSystemOperationContext& context, |
| 61 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 61 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 62 PlatformFile, | 62 PlatformFile, |
| 63 StatusCallback* callback); | 63 StatusCallback* callback); |
| 64 | 64 |
| 65 // Ensures that the given |file_path| exist. This creates a empty new file | 65 // Ensures that the given |file_path| exist. This creates a empty new file |
| 66 // at |file_path| if the |file_path| does not exist. | 66 // 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|, | 67 // 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 Loading... |
| 157 int64 length, | 157 int64 length, |
| 158 StatusCallback* callback); | 158 StatusCallback* callback); |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); | 161 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // namespace fileapi | 164 } // namespace fileapi |
| 165 | 165 |
| 166 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 166 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
| OLD | NEW |