Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: net/quic/quic_spdy_session.h

Issue 1877703002: Landing Recent QUIC changes until 4/8/2016 17:17 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/quic_spdy_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_QUIC_QUIC_SPDY_SESSION_H_ 5 #ifndef NET_QUIC_QUIC_SPDY_SESSION_H_
6 #define NET_QUIC_QUIC_SPDY_SESSION_H_ 6 #define NET_QUIC_QUIC_SPDY_SESSION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "net/quic/quic_header_list.h"
11 #include "net/quic/quic_headers_stream.h" 12 #include "net/quic/quic_headers_stream.h"
12 #include "net/quic/quic_session.h" 13 #include "net/quic/quic_session.h"
13 #include "net/quic/quic_spdy_stream.h" 14 #include "net/quic/quic_spdy_stream.h"
14 15
15 namespace net { 16 namespace net {
16 17
17 namespace test { 18 namespace test {
18 class QuicSpdySessionPeer; 19 class QuicSpdySessionPeer;
19 } // namespace test 20 } // namespace test
20 21
(...skipping 14 matching lines...) Expand all
35 // streams. 36 // streams.
36 virtual void OnStreamHeadersPriority(QuicStreamId stream_id, 37 virtual void OnStreamHeadersPriority(QuicStreamId stream_id,
37 SpdyPriority priority); 38 SpdyPriority priority);
38 // Called by |headers_stream_| when headers have been completely received 39 // Called by |headers_stream_| when headers have been completely received
39 // for a stream. |fin| will be true if the fin flag was set in the headers 40 // for a stream. |fin| will be true if the fin flag was set in the headers
40 // frame. 41 // frame.
41 virtual void OnStreamHeadersComplete(QuicStreamId stream_id, 42 virtual void OnStreamHeadersComplete(QuicStreamId stream_id,
42 bool fin, 43 bool fin,
43 size_t frame_len); 44 size_t frame_len);
44 45
46 // Called by |headers_stream_| when headers have been completely received
47 // for a stream. |fin| will be true if the fin flag was set in the headers
48 // frame.
49 virtual void OnStreamHeaderList(QuicStreamId stream_id,
50 bool fin,
51 size_t frame_len,
52 const QuicHeaderList& header_list);
53
45 // Called by |headers_stream_| when push promise headers have been 54 // Called by |headers_stream_| when push promise headers have been
46 // received for a stream. 55 // received for a stream.
47 virtual void OnPromiseHeaders(QuicStreamId stream_id, 56 virtual void OnPromiseHeaders(QuicStreamId stream_id,
48 StringPiece headers_data); 57 StringPiece headers_data);
49 58
50 // Called by |headers_stream_| when push promise headers have been 59 // Called by |headers_stream_| when push promise headers have been
51 // completely received. |fin| will be true if the fin flag was set 60 // completely received. |fin| will be true if the fin flag was set
52 // in the headers. 61 // in the headers.
53 virtual void OnPromiseHeadersComplete(QuicStreamId stream_id, 62 virtual void OnPromiseHeadersComplete(QuicStreamId stream_id,
54 QuicStreamId promised_stream_id, 63 QuicStreamId promised_stream_id,
55 size_t frame_len); 64 size_t frame_len);
56 65
66 // Called by |headers_stream_| when push promise headers have been
67 // completely received. |fin| will be true if the fin flag was set
68 // in the headers.
69 virtual void OnPromiseHeaderList(QuicStreamId stream_id,
70 QuicStreamId promised_stream_id,
71 size_t frame_len,
72 const QuicHeaderList& header_list);
73
57 // Writes |headers| for the stream |id| to the dedicated headers stream. 74 // Writes |headers| for the stream |id| to the dedicated headers stream.
58 // If |fin| is true, then no more data will be sent for the stream |id|. 75 // If |fin| is true, then no more data will be sent for the stream |id|.
59 // If provided, |ack_notifier_delegate| will be registered to be notified when 76 // If provided, |ack_notifier_delegate| will be registered to be notified when
60 // we have seen ACKs for all packets resulting from this call. 77 // we have seen ACKs for all packets resulting from this call.
61 virtual size_t WriteHeaders(QuicStreamId id, 78 virtual size_t WriteHeaders(QuicStreamId id,
62 const SpdyHeaderBlock& headers, 79 const SpdyHeaderBlock& headers,
63 bool fin, 80 bool fin,
64 SpdyPriority priority, 81 SpdyPriority priority,
65 QuicAckListenerInterface* ack_notifier_delegate); 82 QuicAckListenerInterface* ack_notifier_delegate);
66 83
67 QuicHeadersStream* headers_stream() { return headers_stream_.get(); } 84 QuicHeadersStream* headers_stream() { return headers_stream_.get(); }
68 85
69 // Called when Head of Line Blocking happens in the headers stream. 86 // Called when Head of Line Blocking happens in the headers stream.
70 // |delta| indicates how long that piece of data has been blocked. 87 // |delta| indicates how long that piece of data has been blocked.
71 virtual void OnHeadersHeadOfLineBlocking(QuicTime::Delta delta); 88 virtual void OnHeadersHeadOfLineBlocking(QuicTime::Delta delta);
72 89
73 // Called by the stream on creation to set priority in the write blocked list. 90 // Called by the stream on creation to set priority in the write blocked list.
74 void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority); 91 void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority);
75 // Called by the stream on deletion to clear priority crom the write blocked 92 // Called by the stream on deletion to clear priority crom the write blocked
76 // list. 93 // list.
77 void UnregisterStreamPriority(QuicStreamId id); 94 void UnregisterStreamPriority(QuicStreamId id);
78 // Called by the stream on SetPriority to update priority on the write blocked 95 // Called by the stream on SetPriority to update priority on the write blocked
79 // list. 96 // list.
80 void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority); 97 void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority);
81 98
99 void OnConfigNegotiated() override;
100
82 protected: 101 protected:
83 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream() 102 // Override CreateIncomingDynamicStream() and CreateOutgoingDynamicStream()
84 // with QuicSpdyStream return type to make sure that all data streams are 103 // with QuicSpdyStream return type to make sure that all data streams are
85 // QuicSpdyStreams. 104 // QuicSpdyStreams.
86 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0; 105 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override = 0;
87 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override = 106 QuicSpdyStream* CreateOutgoingDynamicStream(SpdyPriority priority) override =
88 0; 107 0;
89 108
90 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id); 109 QuicSpdyStream* GetSpdyDataStream(const QuicStreamId stream_id);
91 110
92 // If an incoming stream can be created, return true. 111 // If an incoming stream can be created, return true.
93 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0; 112 virtual bool ShouldCreateIncomingDynamicStream(QuicStreamId id) = 0;
94 113
95 // If an outgoing stream can be created, return true. 114 // If an outgoing stream can be created, return true.
96 virtual bool ShouldCreateOutgoingDynamicStream() = 0; 115 virtual bool ShouldCreateOutgoingDynamicStream() = 0;
97 116
98 private: 117 private:
99 friend class test::QuicSpdySessionPeer; 118 friend class test::QuicSpdySessionPeer;
100 119
101 scoped_ptr<QuicHeadersStream> headers_stream_; 120 scoped_ptr<QuicHeadersStream> headers_stream_;
102 121
103 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession); 122 DISALLOW_COPY_AND_ASSIGN(QuicSpdySession);
104 }; 123 };
105 124
106 } // namespace net 125 } // namespace net
107 126
108 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_ 127 #endif // NET_QUIC_QUIC_SPDY_SESSION_H_
OLDNEW
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/quic_spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698