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

Side by Side Diff: webkit/browser/fileapi/file_system_operation_impl.h

Issue 23135019: Make SyncableFileSystemOperation not inherit from FileSystemOperationImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_OPERATION_IMPL_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_ 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const StatusCallback& callback) OVERRIDE; 72 const StatusCallback& callback) OVERRIDE;
73 virtual void TouchFile(const FileSystemURL& url, 73 virtual void TouchFile(const FileSystemURL& url,
74 const base::Time& last_access_time, 74 const base::Time& last_access_time,
75 const base::Time& last_modified_time, 75 const base::Time& last_modified_time,
76 const StatusCallback& callback) OVERRIDE; 76 const StatusCallback& callback) OVERRIDE;
77 virtual void OpenFile(const FileSystemURL& url, 77 virtual void OpenFile(const FileSystemURL& url,
78 int file_flags, 78 int file_flags,
79 base::ProcessHandle peer_handle, 79 base::ProcessHandle peer_handle,
80 const OpenFileCallback& callback) OVERRIDE; 80 const OpenFileCallback& callback) OVERRIDE;
81 virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE; 81 virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE;
82 virtual FileSystemOperationImpl* AsFileSystemOperationImpl() OVERRIDE;
83 virtual void CreateSnapshotFile( 82 virtual void CreateSnapshotFile(
84 const FileSystemURL& path, 83 const FileSystemURL& path,
85 const SnapshotFileCallback& callback) OVERRIDE; 84 const SnapshotFileCallback& callback) OVERRIDE;
86
87 // Copies in a single file from a different filesystem.
88 //
89 // This returns:
90 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path|
91 // or the parent directory of |dest_url| does not exist.
92 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and
93 // is not a file.
94 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
95 // its parent path is a file.
96 //
97 virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path, 85 virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path,
98 const FileSystemURL& dest_url, 86 const FileSystemURL& dest_url,
99 const StatusCallback& callback); 87 const StatusCallback& callback) OVERRIDE;
100 88 virtual void RemoveFile(const FileSystemURL& url,
101 // Removes a single file. 89 const StatusCallback& callback) OVERRIDE;
102 // 90 virtual void RemoveDirectory(const FileSystemURL& url,
103 // This returns: 91 const StatusCallback& callback) OVERRIDE;
104 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. 92 virtual void CopyFileLocal(const FileSystemURL& src_url,
105 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. 93 const FileSystemURL& dest_url,
106 // 94 const StatusCallback& callback) OVERRIDE;
107 void RemoveFile(const FileSystemURL& url, 95 virtual void MoveFileLocal(const FileSystemURL& src_url,
108 const StatusCallback& callback); 96 const FileSystemURL& dest_url,
109 97 const StatusCallback& callback) OVERRIDE;
110 // Removes a single empty directory. 98 virtual base::PlatformFileError SyncGetPlatformPath(
111 // 99 const FileSystemURL& url,
112 // This returns: 100 base::FilePath* platform_path) OVERRIDE;
113 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist.
114 // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if |url| is not a directory.
115 // - PLATFORM_FILE_ERROR_NOT_EMPTY if |url| is not empty.
116 //
117 void RemoveDirectory(const FileSystemURL& url,
118 const StatusCallback& callback);
119
120 // Copies a file from |src_url| to |dest_url|.
121 // This must be called for files that belong to the same filesystem
122 // (i.e. type() and origin() of the |src_url| and |dest_url| must match).
123 //
124 // This returns:
125 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
126 // or the parent directory of |dest_url| does not exist.
127 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file.
128 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and
129 // is not a file.
130 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
131 // its parent path is a file.
132 //
133 void CopyFileLocal(const FileSystemURL& src_url,
134 const FileSystemURL& dest_url,
135 const StatusCallback& callback);
136
137 // Moves a local file from |src_url| to |dest_url|.
138 // This must be called for files that belong to the same filesystem
139 // (i.e. type() and origin() of the |src_url| and |dest_url| must match).
140 //
141 // This returns:
142 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
143 // or the parent directory of |dest_url| does not exist.
144 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file.
145 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and
146 // is not a file.
147 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
148 // its parent path is a file.
149 //
150 void MoveFileLocal(const FileSystemURL& src_url,
151 const FileSystemURL& dest_url,
152 const StatusCallback& callback);
153
154 // Synchronously gets the platform path for the given |url|.
155 // This may fail if |file_system_context| returns NULL on GetFileUtil().
156 // In such a case, base::PLATFORM_FILE_ERROR_INVALID_OPERATION will be
157 // returned.
158 base::PlatformFileError SyncGetPlatformPath(const FileSystemURL& url,
159 base::FilePath* platform_path);
160 101
161 FileSystemContext* file_system_context() const { 102 FileSystemContext* file_system_context() const {
162 return file_system_context_.get(); 103 return file_system_context_.get();
163 } 104 }
164 105
165 protected: 106 private:
166 // Queries the quota and usage and then runs the given |task|. 107 // Queries the quota and usage and then runs the given |task|.
167 // If an error occurs during the quota query it runs |error_callback| instead. 108 // If an error occurs during the quota query it runs |error_callback| instead.
168 void GetUsageAndQuotaThenRunTask( 109 void GetUsageAndQuotaThenRunTask(
169 const FileSystemURL& url, 110 const FileSystemURL& url,
170 const base::Closure& task, 111 const base::Closure& task,
171 const base::Closure& error_callback); 112 const base::Closure& error_callback);
172 113
173 // Called after the quota info is obtained from the quota manager 114 // Called after the quota info is obtained from the quota manager
174 // (which is triggered by GetUsageAndQuotaThenRunTask). 115 // (which is triggered by GetUsageAndQuotaThenRunTask).
175 // Sets the quota info in the operation_context_ and then runs the given 116 // Sets the quota info in the operation_context_ and then runs the given
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 195
255 // A flag to make sure we call operation only once per instance. 196 // A flag to make sure we call operation only once per instance.
256 OperationType pending_operation_; 197 OperationType pending_operation_;
257 198
258 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImpl); 199 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImpl);
259 }; 200 };
260 201
261 } // namespace fileapi 202 } // namespace fileapi
262 203
263 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_ 204 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_operation.h ('k') | webkit/browser/fileapi/file_system_operation_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698