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 NET_SPDY_SPDY_HTTP_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ |
6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ | 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession. | 30 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession. |
31 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate, | 31 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate, |
32 public MultiplexedHttpStream { | 32 public MultiplexedHttpStream { |
33 public: | 33 public: |
34 static const size_t kRequestBodyBufferSize; | 34 static const size_t kRequestBodyBufferSize; |
35 // |spdy_session| must not be NULL. | 35 // |spdy_session| must not be NULL. |
36 SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct); | 36 SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct); |
37 ~SpdyHttpStream() override; | 37 ~SpdyHttpStream() override; |
38 | 38 |
39 SpdyStream* stream() { return stream_.get(); } | 39 SpdyStream* stream() { return stream_; } |
40 | 40 |
41 // Cancels any callbacks from being invoked and deletes the stream. | 41 // Cancels any callbacks from being invoked and deletes the stream. |
42 void Cancel(); | 42 void Cancel(); |
43 | 43 |
44 // HttpStream implementation. | 44 // HttpStream implementation. |
45 | 45 |
46 int InitializeStream(const HttpRequestInfo* request_info, | 46 int InitializeStream(const HttpRequestInfo* request_info, |
47 RequestPriority priority, | 47 RequestPriority priority, |
48 const NetLogWithSource& net_log, | 48 const NetLogWithSource& net_log, |
49 const CompletionCallback& callback) override; | 49 const CompletionCallback& callback) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 // Call the user callback associated with reading the response. | 121 // Call the user callback associated with reading the response. |
122 void DoResponseCallback(int rv); | 122 void DoResponseCallback(int rv); |
123 | 123 |
124 void ScheduleBufferedReadCallback(); | 124 void ScheduleBufferedReadCallback(); |
125 void DoBufferedReadCallback(); | 125 void DoBufferedReadCallback(); |
126 bool ShouldWaitForMoreBufferedData() const; | 126 bool ShouldWaitForMoreBufferedData() const; |
127 | 127 |
128 const base::WeakPtr<SpdySession> spdy_session_; | 128 const base::WeakPtr<SpdySession> spdy_session_; |
129 bool is_reused_; | 129 bool is_reused_; |
130 SpdyStreamRequest stream_request_; | 130 SpdyStreamRequest stream_request_; |
131 base::WeakPtr<SpdyStream> stream_; | 131 SpdyStream* stream_; |
xunjieli
2017/01/20 02:57:20
Can you add a comment here on who owns |stream_| a
Bence
2017/01/20 15:53:13
Done. Also added a comment for |stream_closed_| o
| |
132 | 132 |
133 bool stream_closed_; | 133 bool stream_closed_; |
134 | 134 |
135 // Set only when |stream_closed_| is true. | 135 // Set only when |stream_closed_| is true. |
136 int closed_stream_status_; | 136 int closed_stream_status_; |
137 SpdyStreamId closed_stream_id_; | 137 SpdyStreamId closed_stream_id_; |
138 bool closed_stream_has_load_timing_info_; | 138 bool closed_stream_has_load_timing_info_; |
139 LoadTimingInfo closed_stream_load_timing_info_; | 139 LoadTimingInfo closed_stream_load_timing_info_; |
140 // After |stream_| has been closed, this keeps track of the total number of | 140 // After |stream_| has been closed, this keeps track of the total number of |
141 // bytes received over the network for |stream_| while it was open. | 141 // bytes received over the network for |stream_| while it was open. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 bool was_alpn_negotiated_; | 185 bool was_alpn_negotiated_; |
186 | 186 |
187 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; | 187 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; |
188 | 188 |
189 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); | 189 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); |
190 }; | 190 }; |
191 | 191 |
192 } // namespace net | 192 } // namespace net |
193 | 193 |
194 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ | 194 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ |
OLD | NEW |