OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_OPERATION_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Try to cancel the current operation [we support cancelling write or | 75 // Try to cancel the current operation [we support cancelling write or |
76 // truncate only]. Report failure for the current operation, then tell the | 76 // truncate only]. Report failure for the current operation, then tell the |
77 // passed-in operation to report success. | 77 // passed-in operation to report success. |
78 void Cancel(FileSystemOperation* cancel_operation); | 78 void Cancel(FileSystemOperation* cancel_operation); |
79 | 79 |
80 protected: | 80 protected: |
81 // Proxy for calling file_util_proxy methods. | 81 // Proxy for calling file_util_proxy methods. |
82 scoped_refptr<base::MessageLoopProxy> proxy_; | 82 scoped_refptr<base::MessageLoopProxy> proxy_; |
83 | 83 |
84 private: | 84 private: |
85 // Callbacks for above methods. | 85 // Callback for CreateFile for |exclusive|=true cases. |
86 void DidCreateFileExclusive( | 86 void DidEnsureFileExistsExclusive(base::PlatformFileError rv, |
87 base::PlatformFileError rv, base::PassPlatformFile file, bool created); | 87 bool created); |
88 | 88 |
89 // Returns success even if the file already existed. | 89 // Callback for CreateFile for |exclusive|=false cases. |
90 void DidCreateFileNonExclusive( | 90 void DidEnsureFileExistsNonExclusive(base::PlatformFileError rv, |
91 base::PlatformFileError rv, base::PassPlatformFile file, bool created); | 91 bool created); |
92 | 92 |
93 // Generic callback that translates platform errors to WebKit error codes. | 93 // Generic callback that translates platform errors to WebKit error codes. |
94 void DidFinishFileOperation(base::PlatformFileError rv); | 94 void DidFinishFileOperation(base::PlatformFileError rv); |
95 | 95 |
96 void DidDirectoryExists(base::PlatformFileError rv, | 96 void DidDirectoryExists(base::PlatformFileError rv, |
97 const base::PlatformFileInfo& file_info); | 97 const base::PlatformFileInfo& file_info); |
98 | 98 |
99 void DidFileExists(base::PlatformFileError rv, | 99 void DidFileExists(base::PlatformFileError rv, |
100 const base::PlatformFileInfo& file_info); | 100 const base::PlatformFileInfo& file_info); |
101 | 101 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // A flag to make sure we call operation only once per instance. | 149 // A flag to make sure we call operation only once per instance. |
150 OperationType pending_operation_; | 150 OperationType pending_operation_; |
151 #endif | 151 #endif |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); | 153 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace fileapi | 156 } // namespace fileapi |
157 | 157 |
158 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 158 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |