| 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_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" |
| 11 #include "base/file_util_proxy.h" | 11 #include "base/file_util_proxy.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
| 15 #include "base/scoped_callback_factory.h" | 15 #include "base/scoped_callback_factory.h" |
| 16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "webkit/fileapi/file_system_types.h" | 18 #include "webkit/fileapi/file_system_types.h" |
| 19 #include "webkit/fileapi/file_system_operation_context.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class Time; | 22 class Time; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 class URLRequest; | 26 class URLRequest; |
| 26 class URLRequestContext; | 27 class URLRequestContext; |
| 27 } // namespace net | 28 } // namespace net |
| 28 | 29 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 48 FileSystemContext* file_system_context); | 49 FileSystemContext* file_system_context); |
| 49 virtual ~FileSystemOperation(); | 50 virtual ~FileSystemOperation(); |
| 50 | 51 |
| 51 void OpenFileSystem(const GURL& origin_url, | 52 void OpenFileSystem(const GURL& origin_url, |
| 52 fileapi::FileSystemType type, | 53 fileapi::FileSystemType type, |
| 53 bool create); | 54 bool create); |
| 54 void CreateFile(const FilePath& path, | 55 void CreateFile(const FilePath& path, |
| 55 bool exclusive); | 56 bool exclusive); |
| 56 void CreateDirectory(const FilePath& path, | 57 void CreateDirectory(const FilePath& path, |
| 57 bool exclusive, | 58 bool exclusive, |
| 58 bool recursive); | 59 bool unused); |
| 59 void Copy(const FilePath& src_path, | 60 void Copy(const FilePath& src_path, |
| 60 const FilePath& dest_path); | 61 const FilePath& dest_path); |
| 61 void Move(const FilePath& src_path, | 62 void Move(const FilePath& src_path, |
| 62 const FilePath& dest_path); | 63 const FilePath& dest_path); |
| 63 void DirectoryExists(const FilePath& path); | 64 void DirectoryExists(const FilePath& path); |
| 64 void FileExists(const FilePath& path); | 65 void FileExists(const FilePath& path); |
| 65 void GetMetadata(const FilePath& path); | 66 void GetMetadata(const FilePath& path); |
| 66 void ReadDirectory(const FilePath& path); | 67 void ReadDirectory(const FilePath& path); |
| 67 void Remove(const FilePath& path, bool recursive); | 68 void Remove(const FilePath& path, bool recursive); |
| 68 void Write(scoped_refptr<net::URLRequestContext> url_request_context, | 69 void Write(scoped_refptr<net::URLRequestContext> url_request_context, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // A flag to make sure we call operation only once per instance. | 166 // A flag to make sure we call operation only once per instance. |
| 166 OperationType pending_operation_; | 167 OperationType pending_operation_; |
| 167 #endif | 168 #endif |
| 168 | 169 |
| 169 // Proxy for calling file_util_proxy methods. | 170 // Proxy for calling file_util_proxy methods. |
| 170 scoped_refptr<base::MessageLoopProxy> proxy_; | 171 scoped_refptr<base::MessageLoopProxy> proxy_; |
| 171 | 172 |
| 172 scoped_ptr<FileSystemCallbackDispatcher> dispatcher_; | 173 scoped_ptr<FileSystemCallbackDispatcher> dispatcher_; |
| 173 | 174 |
| 174 scoped_refptr<FileSystemContext> file_system_context_; | 175 scoped_refptr<FileSystemContext> file_system_context_; |
| 176 FileSystemOperationContext file_system_operation_context_; |
| 175 | 177 |
| 176 base::ScopedCallbackFactory<FileSystemOperation> callback_factory_; | 178 base::ScopedCallbackFactory<FileSystemOperation> callback_factory_; |
| 177 | 179 |
| 178 // These are all used only by Write(). | 180 // These are all used only by Write(). |
| 179 friend class FileWriterDelegate; | 181 friend class FileWriterDelegate; |
| 180 scoped_ptr<FileWriterDelegate> file_writer_delegate_; | 182 scoped_ptr<FileWriterDelegate> file_writer_delegate_; |
| 181 scoped_ptr<net::URLRequest> blob_request_; | 183 scoped_ptr<net::URLRequest> blob_request_; |
| 182 scoped_ptr<FileSystemOperation> cancel_operation_; | 184 scoped_ptr<FileSystemOperation> cancel_operation_; |
| 183 | 185 |
| 184 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); | 186 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |
| 185 }; | 187 }; |
| 186 | 188 |
| 187 } // namespace fileapi | 189 } // namespace fileapi |
| 188 | 190 |
| 189 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 191 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| OLD | NEW |