OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_COPY_OR_MOVE_OPERATION_DELEGATE_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <stack> | 9 #include <stack> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void Read(const StatusCallback& callback); | 66 void Read(const StatusCallback& callback); |
67 void DidRead(const StatusCallback& callback, int result); | 67 void DidRead(const StatusCallback& callback, int result); |
68 | 68 |
69 // Writes the content in |buffer| to |writer_|. | 69 // Writes the content in |buffer| to |writer_|. |
70 void Write(const StatusCallback& callback, | 70 void Write(const StatusCallback& callback, |
71 scoped_refptr<net::DrainableIOBuffer> buffer); | 71 scoped_refptr<net::DrainableIOBuffer> buffer); |
72 void DidWrite(const StatusCallback& callback, | 72 void DidWrite(const StatusCallback& callback, |
73 scoped_refptr<net::DrainableIOBuffer> buffer, int result); | 73 scoped_refptr<net::DrainableIOBuffer> buffer, int result); |
74 | 74 |
75 // Flushes the written content in |writer_|. | 75 // Flushes the written content in |writer_|. |
76 void Flush(const StatusCallback& callback); | 76 void Flush(const StatusCallback& callback, bool is_eof); |
77 void DidFlush(const StatusCallback& callback, int result); | 77 void DidFlush(const StatusCallback& callback, bool is_eof, int result); |
78 | 78 |
79 scoped_ptr<webkit_blob::FileStreamReader> reader_; | 79 scoped_ptr<webkit_blob::FileStreamReader> reader_; |
80 scoped_ptr<FileStreamWriter> writer_; | 80 scoped_ptr<FileStreamWriter> writer_; |
81 const bool need_flush_; | 81 const bool need_flush_; |
82 FileSystemOperation::CopyFileProgressCallback file_progress_callback_; | 82 FileSystemOperation::CopyFileProgressCallback file_progress_callback_; |
83 scoped_refptr<net::IOBufferWithSize> io_buffer_; | 83 scoped_refptr<net::IOBufferWithSize> io_buffer_; |
84 int64 num_copied_bytes_; | 84 int64 num_copied_bytes_; |
| 85 int64 previous_flush_offset_; |
85 base::Time last_progress_callback_invocation_time_; | 86 base::Time last_progress_callback_invocation_time_; |
86 base::TimeDelta min_progress_callback_invocation_span_; | 87 base::TimeDelta min_progress_callback_invocation_span_; |
87 bool cancel_requested_; | 88 bool cancel_requested_; |
88 base::WeakPtrFactory<StreamCopyHelper> weak_factory_; | 89 base::WeakPtrFactory<StreamCopyHelper> weak_factory_; |
89 DISALLOW_COPY_AND_ASSIGN(StreamCopyHelper); | 90 DISALLOW_COPY_AND_ASSIGN(StreamCopyHelper); |
90 }; | 91 }; |
91 | 92 |
92 CopyOrMoveOperationDelegate( | 93 CopyOrMoveOperationDelegate( |
93 FileSystemContext* file_system_context, | 94 FileSystemContext* file_system_context, |
94 const FileSystemURL& src_root, | 95 const FileSystemURL& src_root, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 153 |
153 std::set<CopyOrMoveImpl*> running_copy_set_; | 154 std::set<CopyOrMoveImpl*> running_copy_set_; |
154 base::WeakPtrFactory<CopyOrMoveOperationDelegate> weak_factory_; | 155 base::WeakPtrFactory<CopyOrMoveOperationDelegate> weak_factory_; |
155 | 156 |
156 DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate); | 157 DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate); |
157 }; | 158 }; |
158 | 159 |
159 } // namespace fileapi | 160 } // namespace fileapi |
160 | 161 |
161 #endif // WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ | 162 #endif // WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ |
OLD | NEW |