| 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 // The base class for streams which deliver data to/from an application. | 5 // The base class for streams which deliver data to/from an application. |
| 6 // In each direction, the data on such a stream first contains compressed | 6 // In each direction, the data on such a stream first contains compressed |
| 7 // headers then body data. | 7 // headers then body data. |
| 8 | 8 |
| 9 #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 9 #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| 10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| 11 | 11 |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 #include <sys/types.h> | 13 #include <sys/types.h> |
| 14 | 14 |
| 15 #include <list> | 15 #include <list> |
| 16 #include <string> | 16 #include <string> |
| 17 | 17 |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
| 20 #include "net/base/iovec.h" | 20 #include "net/base/iovec.h" |
| 21 #include "net/base/net_export.h" | |
| 22 #include "net/quic/core/quic_flags.h" | 21 #include "net/quic/core/quic_flags.h" |
| 23 #include "net/quic/core/quic_header_list.h" | 22 #include "net/quic/core/quic_header_list.h" |
| 24 #include "net/quic/core/quic_packets.h" | 23 #include "net/quic/core/quic_packets.h" |
| 25 #include "net/quic/core/quic_stream.h" | 24 #include "net/quic/core/quic_stream.h" |
| 26 #include "net/quic/core/quic_stream_sequencer.h" | 25 #include "net/quic/core/quic_stream_sequencer.h" |
| 26 #include "net/quic/platform/api/quic_export.h" |
| 27 #include "net/quic/platform/api/quic_socket_address.h" | 27 #include "net/quic/platform/api/quic_socket_address.h" |
| 28 #include "net/spdy/spdy_framer.h" | 28 #include "net/spdy/spdy_framer.h" |
| 29 | 29 |
| 30 namespace net { | 30 namespace net { |
| 31 | 31 |
| 32 namespace test { | 32 namespace test { |
| 33 class QuicSpdyStreamPeer; | 33 class QuicSpdyStreamPeer; |
| 34 class QuicStreamPeer; | 34 class QuicStreamPeer; |
| 35 } // namespace test | 35 } // namespace test |
| 36 | 36 |
| 37 class QuicSpdySession; | 37 class QuicSpdySession; |
| 38 | 38 |
| 39 // This is somewhat arbitrary. It's possible, but unlikely, we will either fail | 39 // This is somewhat arbitrary. It's possible, but unlikely, we will either fail |
| 40 // to set a priority client-side, or cancel a stream before stripping the | 40 // to set a priority client-side, or cancel a stream before stripping the |
| 41 // priority from the wire server-side. In either case, start out with a | 41 // priority from the wire server-side. In either case, start out with a |
| 42 // priority in the middle. | 42 // priority in the middle. |
| 43 const SpdyPriority kDefaultPriority = 3; | 43 const SpdyPriority kDefaultPriority = 3; |
| 44 | 44 |
| 45 // A QUIC stream that can send and receive HTTP2 (SPDY) headers. | 45 // A QUIC stream that can send and receive HTTP2 (SPDY) headers. |
| 46 class NET_EXPORT_PRIVATE QuicSpdyStream : public QuicStream { | 46 class QUIC_EXPORT_PRIVATE QuicSpdyStream : public QuicStream { |
| 47 public: | 47 public: |
| 48 // Visitor receives callbacks from the stream. | 48 // Visitor receives callbacks from the stream. |
| 49 class NET_EXPORT_PRIVATE Visitor { | 49 class QUIC_EXPORT_PRIVATE Visitor { |
| 50 public: | 50 public: |
| 51 Visitor() {} | 51 Visitor() {} |
| 52 | 52 |
| 53 // Called when the stream is closed. | 53 // Called when the stream is closed. |
| 54 virtual void OnClose(QuicSpdyStream* stream) = 0; | 54 virtual void OnClose(QuicSpdyStream* stream) = 0; |
| 55 | 55 |
| 56 // Allows subclasses to override and do work. | 56 // Allows subclasses to override and do work. |
| 57 virtual void OnPromiseHeadersComplete(QuicStreamId promised_id, | 57 virtual void OnPromiseHeadersComplete(QuicStreamId promised_id, |
| 58 size_t frame_len) {} | 58 size_t frame_len) {} |
| 59 | 59 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bool trailers_consumed_; | 226 bool trailers_consumed_; |
| 227 // The parsed trailers received from the peer. | 227 // The parsed trailers received from the peer. |
| 228 SpdyHeaderBlock received_trailers_; | 228 SpdyHeaderBlock received_trailers_; |
| 229 | 229 |
| 230 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 230 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 } // namespace net | 233 } // namespace net |
| 234 | 234 |
| 235 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 235 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| OLD | NEW |