Chromium Code Reviews| Index: webkit/fileapi/file_writer_delegate.h |
| diff --git a/webkit/fileapi/file_writer_delegate.h b/webkit/fileapi/file_writer_delegate.h |
| index 3b58ae0f647572549c74e38b6e1d45b7414962d8..192b2cf54130fd48ab3b076f7c066f1c3d139704 100644 |
| --- a/webkit/fileapi/file_writer_delegate.h |
| +++ b/webkit/fileapi/file_writer_delegate.h |
| @@ -20,17 +20,16 @@ namespace fileapi { |
| class FileSystemOperation; |
| class FileSystemOperationContext; |
| class FileSystemQuotaUtil; |
| +class FileWriter; |
| class FileWriterDelegate : public net::URLRequest::Delegate { |
| public: |
| FileWriterDelegate( |
| FileSystemOperation* write_operation, |
|
kinaba
2012/05/21 09:27:00
Can you replace the parameter with const FileSyste
kinuko
2012/05/21 11:20:22
Sounds good, done.
|
| - const FileSystemPath& path, |
| - int64 offset); |
| + scoped_ptr<FileWriter> file_writer); |
| virtual ~FileWriterDelegate(); |
| - void Start(base::PlatformFile file, |
| - scoped_ptr<net::URLRequest> request); |
| + void Start(scoped_ptr<net::URLRequest> request); |
| // Cancels the current write operation. Returns true if it is ok to |
| // delete this instance immediately. Otherwise this will call |
| @@ -38,8 +37,6 @@ class FileWriterDelegate : public net::URLRequest::Delegate { |
| // perform the final cleanup. |
| bool Cancel(); |
| - base::PlatformFile file() const { return file_; } |
| - |
| virtual void OnReceivedRedirect(net::URLRequest* request, |
| const GURL& new_url, |
| bool* defer_redirect) OVERRIDE; |
| @@ -66,25 +63,19 @@ class FileWriterDelegate : public net::URLRequest::Delegate { |
| void OnDataWritten(int write_response); |
| void OnError(base::PlatformFileError error); |
| void OnProgress(int bytes_read, bool done); |
| + void OnWriteCancelled(int status); |
| FileSystemOperationContext* file_system_operation_context() const; |
| FileSystemQuotaUtil* quota_util() const; |
| FileSystemOperation* file_system_operation_; |
| - base::PlatformFile file_; |
| - FileSystemPath path_; |
| - int64 size_; |
| - int64 offset_; |
| - bool has_pending_write_; |
| + scoped_ptr<FileWriter> file_writer_; |
| base::Time last_progress_event_time_; |
| int bytes_written_backlog_; |
| int bytes_written_; |
| int bytes_read_; |
| - int64 total_bytes_written_; |
| - int64 allowed_bytes_to_write_; |
| scoped_refptr<net::IOBufferWithSize> io_buffer_; |
| scoped_refptr<net::DrainableIOBuffer> cursor_; |
| - scoped_ptr<net::FileStream> file_stream_; |
| scoped_ptr<net::URLRequest> request_; |
| base::WeakPtrFactory<FileWriterDelegate> weak_factory_; |
| }; |