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 // A client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 using TokenBindingSignatureMap = | 49 using TokenBindingSignatureMap = |
50 base::MRUCache<std::string, std::vector<uint8_t>>; | 50 base::MRUCache<std::string, std::vector<uint8_t>>; |
51 | 51 |
52 namespace test { | 52 namespace test { |
53 class QuicChromiumClientSessionPeer; | 53 class QuicChromiumClientSessionPeer; |
54 } // namespace test | 54 } // namespace test |
55 | 55 |
56 class NET_EXPORT_PRIVATE QuicChromiumClientSession | 56 class NET_EXPORT_PRIVATE QuicChromiumClientSession |
57 : public QuicClientSessionBase, | 57 : public QuicClientSessionBase, |
58 public QuicChromiumPacketReader::Visitor, | 58 public QuicChromiumPacketReader::Visitor, |
59 public QuicChromiumPacketWriter::WriteErrorObserver { | 59 public QuicChromiumPacketWriter::Delegate { |
60 public: | 60 public: |
61 // Reasons to disable QUIC, that is under certain pathological | 61 // Reasons to disable QUIC, that is under certain pathological |
62 // connection errors. Note: these values must be kept in sync with | 62 // connection errors. Note: these values must be kept in sync with |
63 // the corresponding values of QuicDisabledReason in: | 63 // the corresponding values of QuicDisabledReason in: |
64 // tools/metrics/histograms/histograms.xml | 64 // tools/metrics/histograms/histograms.xml |
65 enum QuicDisabledReason { | 65 enum QuicDisabledReason { |
66 QUIC_DISABLED_NOT = 0, // default, not disabled | 66 QUIC_DISABLED_NOT = 0, // default, not disabled |
67 QUIC_DISABLED_PUBLIC_RESET_POST_HANDSHAKE = 1, | 67 QUIC_DISABLED_PUBLIC_RESET_POST_HANDSHAKE = 1, |
68 QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS = 2, | 68 QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS = 2, |
69 QUIC_DISABLED_BAD_PACKET_LOSS_RATE = 3, | 69 QUIC_DISABLED_BAD_PACKET_LOSS_RATE = 3, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // will be added to the stream requets queue and will | 151 // will be added to the stream requets queue and will |
152 // be completed asynchronously. | 152 // be completed asynchronously. |
153 // TODO(rch): remove |stream| from this and use setter on |request| | 153 // TODO(rch): remove |stream| from this and use setter on |request| |
154 // and fix in spdy too. | 154 // and fix in spdy too. |
155 int TryCreateStream(StreamRequest* request, | 155 int TryCreateStream(StreamRequest* request, |
156 QuicChromiumClientStream** stream); | 156 QuicChromiumClientStream** stream); |
157 | 157 |
158 // Cancels the pending stream creation request. | 158 // Cancels the pending stream creation request. |
159 void CancelRequest(StreamRequest* request); | 159 void CancelRequest(StreamRequest* request); |
160 | 160 |
161 // QuicChromiumPacketWriter::WriteErrorObserver override. | 161 // QuicChromiumPacketWriter::Delegate override. |
162 int OnWriteError(int error_code, | 162 int HandleWriteError(int error_code, |
163 scoped_refptr<StringIOBuffer> last_packet) override; | 163 scoped_refptr<StringIOBuffer> last_packet) override; |
| 164 void OnWriteError(int error_code) override; |
| 165 void OnWriteUnblocked() override; |
164 | 166 |
165 // QuicSpdySession methods: | 167 // QuicSpdySession methods: |
166 void OnHeadersHeadOfLineBlocking(QuicTime::Delta delta) override; | 168 void OnHeadersHeadOfLineBlocking(QuicTime::Delta delta) override; |
167 | 169 |
168 // QuicSession methods: | 170 // QuicSession methods: |
169 void OnStreamFrame(const QuicStreamFrame& frame) override; | 171 void OnStreamFrame(const QuicStreamFrame& frame) override; |
170 QuicChromiumClientStream* CreateOutgoingDynamicStream( | 172 QuicChromiumClientStream* CreateOutgoingDynamicStream( |
171 SpdyPriority priority) override; | 173 SpdyPriority priority) override; |
172 QuicCryptoClientStream* GetCryptoStream() override; | 174 QuicCryptoClientStream* GetCryptoStream() override; |
173 void CloseStream(QuicStreamId stream_id) override; | 175 void CloseStream(QuicStreamId stream_id) override; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 int error_code_from_rewrite_; | 370 int error_code_from_rewrite_; |
369 bool use_error_code_from_rewrite_; | 371 bool use_error_code_from_rewrite_; |
370 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; | 372 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; |
371 | 373 |
372 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); | 374 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); |
373 }; | 375 }; |
374 | 376 |
375 } // namespace net | 377 } // namespace net |
376 | 378 |
377 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 379 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
OLD | NEW |