| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "net/quic/quic_headers_stream.h" | 5 #include "net/quic/quic_headers_stream.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "net/quic/quic_bug_tracker.h" |
| 10 #include "net/quic/quic_flags.h" | 11 #include "net/quic/quic_flags.h" |
| 11 #include "net/quic/quic_headers_stream.h" | 12 #include "net/quic/quic_headers_stream.h" |
| 12 #include "net/quic/quic_spdy_session.h" | 13 #include "net/quic/quic_spdy_session.h" |
| 13 #include "net/quic/quic_time.h" | 14 #include "net/quic/quic_time.h" |
| 14 | 15 |
| 15 using base::StringPiece; | 16 using base::StringPiece; |
| 16 using net::HTTP2; | 17 using net::HTTP2; |
| 17 using net::SpdyFrameType; | 18 using net::SpdyFrameType; |
| 18 using std::string; | 19 using std::string; |
| 19 | 20 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 ack_listener); | 220 ack_listener); |
| 220 return frame->size(); | 221 return frame->size(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 size_t QuicHeadersStream::WritePushPromise( | 224 size_t QuicHeadersStream::WritePushPromise( |
| 224 QuicStreamId original_stream_id, | 225 QuicStreamId original_stream_id, |
| 225 QuicStreamId promised_stream_id, | 226 QuicStreamId promised_stream_id, |
| 226 const SpdyHeaderBlock& headers, | 227 const SpdyHeaderBlock& headers, |
| 227 QuicAckListenerInterface* ack_listener) { | 228 QuicAckListenerInterface* ack_listener) { |
| 228 if (session()->perspective() == Perspective::IS_CLIENT) { | 229 if (session()->perspective() == Perspective::IS_CLIENT) { |
| 229 LOG(DFATAL) << "Client shouldn't send PUSH_PROMISE"; | 230 QUIC_BUG << "Client shouldn't send PUSH_PROMISE"; |
| 230 return 0; | 231 return 0; |
| 231 } | 232 } |
| 232 | 233 |
| 233 SpdyPushPromiseIR push_promise(original_stream_id, promised_stream_id); | 234 SpdyPushPromiseIR push_promise(original_stream_id, promised_stream_id); |
| 234 push_promise.set_header_block(headers); | 235 push_promise.set_header_block(headers); |
| 235 // PUSH_PROMISE must not be the last frame sent out, at least followed by | 236 // PUSH_PROMISE must not be the last frame sent out, at least followed by |
| 236 // response headers. | 237 // response headers. |
| 237 push_promise.set_fin(false); | 238 push_promise.set_fin(false); |
| 238 | 239 |
| 239 scoped_ptr<SpdySerializedFrame> frame( | 240 scoped_ptr<SpdySerializedFrame> frame( |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 334 |
| 334 void QuicHeadersStream::OnCompressedFrameSize(size_t frame_len) { | 335 void QuicHeadersStream::OnCompressedFrameSize(size_t frame_len) { |
| 335 frame_len_ += frame_len; | 336 frame_len_ += frame_len; |
| 336 } | 337 } |
| 337 | 338 |
| 338 bool QuicHeadersStream::IsConnected() { | 339 bool QuicHeadersStream::IsConnected() { |
| 339 return session()->connection()->connected(); | 340 return session()->connection()->connected(); |
| 340 } | 341 } |
| 341 | 342 |
| 342 } // namespace net | 343 } // namespace net |
| OLD | NEW |