| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WRITER_DELEGATE_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 
| 6 #define WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 
| 7 | 7 | 
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" | 
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" | 
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 28     SUCCESS_COMPLETED, | 28     SUCCESS_COMPLETED, | 
| 29     ERROR_WRITE_STARTED, | 29     ERROR_WRITE_STARTED, | 
| 30     ERROR_WRITE_NOT_STARTED, | 30     ERROR_WRITE_NOT_STARTED, | 
| 31   }; | 31   }; | 
| 32 | 32 | 
| 33   typedef base::Callback<void(base::PlatformFileError result, | 33   typedef base::Callback<void(base::PlatformFileError result, | 
| 34                               int64 bytes, | 34                               int64 bytes, | 
| 35                               WriteProgressStatus write_status)> | 35                               WriteProgressStatus write_status)> | 
| 36       DelegateWriteCallback; | 36       DelegateWriteCallback; | 
| 37 | 37 | 
| 38   FileWriterDelegate( | 38   FileWriterDelegate(scoped_ptr<FileStreamWriter> file_writer); | 
| 39       const DelegateWriteCallback& write_callback, |  | 
| 40       scoped_ptr<FileStreamWriter> file_writer); |  | 
| 41   virtual ~FileWriterDelegate(); | 39   virtual ~FileWriterDelegate(); | 
| 42 | 40 | 
| 43   void Start(scoped_ptr<net::URLRequest> request); | 41   void Start(scoped_ptr<net::URLRequest> request, | 
|  | 42              const DelegateWriteCallback& write_callback); | 
| 44 | 43 | 
| 45   // Cancels the current write operation.  This will synchronously or | 44   // Cancels the current write operation.  This will synchronously or | 
| 46   // asynchronously call the given write callback (which may result in | 45   // asynchronously call the given write callback (which may result in | 
| 47   // deleting this). | 46   // deleting this). | 
| 48   void Cancel(); | 47   void Cancel(); | 
| 49 | 48 | 
| 50   virtual void OnReceivedRedirect(net::URLRequest* request, | 49   virtual void OnReceivedRedirect(net::URLRequest* request, | 
| 51                                   const GURL& new_url, | 50                                   const GURL& new_url, | 
| 52                                   bool* defer_redirect) OVERRIDE; | 51                                   bool* defer_redirect) OVERRIDE; | 
| 53   virtual void OnAuthRequired(net::URLRequest* request, | 52   virtual void OnAuthRequired(net::URLRequest* request, | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 92   int bytes_written_; | 91   int bytes_written_; | 
| 93   int bytes_read_; | 92   int bytes_read_; | 
| 94   scoped_refptr<net::IOBufferWithSize> io_buffer_; | 93   scoped_refptr<net::IOBufferWithSize> io_buffer_; | 
| 95   scoped_refptr<net::DrainableIOBuffer> cursor_; | 94   scoped_refptr<net::DrainableIOBuffer> cursor_; | 
| 96   scoped_ptr<net::URLRequest> request_; | 95   scoped_ptr<net::URLRequest> request_; | 
| 97 }; | 96 }; | 
| 98 | 97 | 
| 99 }  // namespace fileapi | 98 }  // namespace fileapi | 
| 100 | 99 | 
| 101 #endif  // WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 100 #endif  // WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 
| OLD | NEW | 
|---|