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 STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "net/base/file_stream.h" | 13 #include "net/base/file_stream.h" |
14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
16 #include "storage/browser/storage_browser_export.h" | 16 #include "storage/browser/storage_browser_export.h" |
17 | 17 |
18 namespace storage { | 18 namespace storage { |
19 | 19 |
20 class FileStreamWriter; | 20 class FileStreamWriter; |
21 enum class FlushPolicy; | 21 enum class FlushPolicy; |
22 | 22 |
23 class STORAGE_EXPORT_PRIVATE FileWriterDelegate | 23 class STORAGE_EXPORT FileWriterDelegate : public net::URLRequest::Delegate { |
24 : public net::URLRequest::Delegate { | |
25 public: | 24 public: |
26 enum WriteProgressStatus { | 25 enum WriteProgressStatus { |
27 SUCCESS_IO_PENDING, | 26 SUCCESS_IO_PENDING, |
28 SUCCESS_COMPLETED, | 27 SUCCESS_COMPLETED, |
29 ERROR_WRITE_STARTED, | 28 ERROR_WRITE_STARTED, |
30 ERROR_WRITE_NOT_STARTED, | 29 ERROR_WRITE_NOT_STARTED, |
31 }; | 30 }; |
32 | 31 |
33 typedef base::Callback<void(base::File::Error result, | 32 typedef base::Callback<void(base::File::Error result, |
34 int64 bytes, | 33 int64 bytes, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 scoped_ptr<net::URLRequest> request_; | 95 scoped_ptr<net::URLRequest> request_; |
97 | 96 |
98 base::WeakPtrFactory<FileWriterDelegate> weak_factory_; | 97 base::WeakPtrFactory<FileWriterDelegate> weak_factory_; |
99 | 98 |
100 DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); | 99 DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); |
101 }; | 100 }; |
102 | 101 |
103 } // namespace storage | 102 } // namespace storage |
104 | 103 |
105 #endif // STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ | 104 #endif // STORAGE_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ |
OLD | NEW |