OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ |
6 #define CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ | 6 #define CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/browser/streams/stream_write_observer.h" | 10 #include "content/browser/streams/stream_write_observer.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 int min_size); | 61 int min_size); |
62 | 62 |
63 // A read was completed, forward the data to the Stream. If |*defer| is set to | 63 // A read was completed, forward the data to the Stream. If |*defer| is set to |
64 // true, the implementation must not continue to process the request until | 64 // true, the implementation must not continue to process the request until |
65 // Resume is called on |controller_|. | 65 // Resume is called on |controller_|. |
66 // | 66 // |
67 // InitializeStream must have been called before calling OnReadCompleted. | 67 // InitializeStream must have been called before calling OnReadCompleted. |
68 void OnReadCompleted(int bytes_read, bool* defer); | 68 void OnReadCompleted(int bytes_read, bool* defer); |
69 | 69 |
70 // Called when there is no more data to read to the stream. | 70 // Called when there is no more data to read to the stream. |
71 void Finalize(); | 71 void Finalize(int status); |
72 | 72 |
73 private: | 73 private: |
74 // StreamWriteObserver implementation. | 74 // StreamWriteObserver implementation. |
75 void OnSpaceAvailable(Stream* stream) override; | 75 void OnSpaceAvailable(Stream* stream) override; |
76 void OnClose(Stream* stream) override; | 76 void OnClose(Stream* stream) override; |
77 | 77 |
78 ResourceController* controller_; | 78 ResourceController* controller_; |
79 scoped_refptr<Stream> stream_; | 79 scoped_refptr<Stream> stream_; |
80 scoped_refptr<net::IOBuffer> read_buffer_; | 80 scoped_refptr<net::IOBuffer> read_buffer_; |
81 bool immediate_mode_; | 81 bool immediate_mode_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(StreamWriter); | 83 DISALLOW_COPY_AND_ASSIGN(StreamWriter); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace content | 86 } // namespace content |
87 | 87 |
88 #endif // CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ | 88 #endif // CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ |
OLD | NEW |