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_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 #include <queue> | 12 #include <queue> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/linked_ptr.h" | |
17 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
19 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
20 #include "net/base/load_states.h" | 19 #include "net/base/load_states.h" |
21 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
22 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
23 #include "net/base/ssl_config_service.h" | 22 #include "net/base/ssl_config_service.h" |
24 #include "net/base/upload_data_stream.h" | 23 #include "net/base/upload_data_stream.h" |
25 #include "net/socket/client_socket_handle.h" | 24 #include "net/socket/client_socket_handle.h" |
26 #include "net/socket/ssl_client_socket.h" | 25 #include "net/socket/ssl_client_socket.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // authentication now. | 157 // authentication now. |
159 bool VerifyDomainAuthentication(const std::string& domain); | 158 bool VerifyDomainAuthentication(const std::string& domain); |
160 | 159 |
161 // Send the SYN frame for |stream_id|. This also sends PING message to check | 160 // Send the SYN frame for |stream_id|. This also sends PING message to check |
162 // the status of the connection. | 161 // the status of the connection. |
163 int WriteSynStream( | 162 int WriteSynStream( |
164 SpdyStreamId stream_id, | 163 SpdyStreamId stream_id, |
165 RequestPriority priority, | 164 RequestPriority priority, |
166 uint8 credential_slot, | 165 uint8 credential_slot, |
167 SpdyControlFlags flags, | 166 SpdyControlFlags flags, |
168 const linked_ptr<SpdyHeaderBlock>& headers); | 167 const SpdyHeaderBlock& headers); |
169 | 168 |
170 // Write a CREDENTIAL frame to the session. | 169 // Write a CREDENTIAL frame to the session. |
171 int WriteCredentialFrame(const std::string& origin, | 170 int WriteCredentialFrame(const std::string& origin, |
172 SSLClientCertType type, | 171 SSLClientCertType type, |
173 const std::string& key, | 172 const std::string& key, |
174 const std::string& cert, | 173 const std::string& cert, |
175 RequestPriority priority); | 174 RequestPriority priority); |
176 | 175 |
177 // Write a data frame to the stream. | 176 // Write a data frame to the stream. |
178 // Used to create and queue a data frame for the given stream. | 177 // Used to create and queue a data frame for the given stream. |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 int delta_window_size) OVERRIDE; | 480 int delta_window_size) OVERRIDE; |
482 virtual void OnControlFrameCompressed( | 481 virtual void OnControlFrameCompressed( |
483 const SpdyControlFrame& uncompressed_frame, | 482 const SpdyControlFrame& uncompressed_frame, |
484 const SpdyControlFrame& compressed_frame) OVERRIDE; | 483 const SpdyControlFrame& compressed_frame) OVERRIDE; |
485 virtual void OnSynStream(SpdyStreamId stream_id, | 484 virtual void OnSynStream(SpdyStreamId stream_id, |
486 SpdyStreamId associated_stream_id, | 485 SpdyStreamId associated_stream_id, |
487 SpdyPriority priority, | 486 SpdyPriority priority, |
488 uint8 credential_slot, | 487 uint8 credential_slot, |
489 bool fin, | 488 bool fin, |
490 bool unidirectional, | 489 bool unidirectional, |
491 const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; | 490 const SpdyHeaderBlock& headers) OVERRIDE; |
492 virtual void OnSynReply( | 491 virtual void OnSynReply( |
493 SpdyStreamId stream_id, | 492 SpdyStreamId stream_id, |
494 bool fin, | 493 bool fin, |
495 const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; | 494 const SpdyHeaderBlock& headers) OVERRIDE; |
496 virtual void OnHeaders( | 495 virtual void OnHeaders( |
497 SpdyStreamId stream_id, | 496 SpdyStreamId stream_id, |
498 bool fin, | 497 bool fin, |
499 const linked_ptr<SpdyHeaderBlock>& headers) OVERRIDE; | 498 const SpdyHeaderBlock& headers) OVERRIDE; |
500 | 499 |
501 // -------------------------- | 500 // -------------------------- |
502 // Helper methods for testing | 501 // Helper methods for testing |
503 // -------------------------- | 502 // -------------------------- |
504 void set_connection_at_risk_of_loss_time(base::TimeDelta duration) { | 503 void set_connection_at_risk_of_loss_time(base::TimeDelta duration) { |
505 connection_at_risk_of_loss_time_ = duration; | 504 connection_at_risk_of_loss_time_ = duration; |
506 } | 505 } |
507 | 506 |
508 void set_hung_interval(base::TimeDelta duration) { | 507 void set_hung_interval(base::TimeDelta duration) { |
509 hung_interval_ = duration; | 508 hung_interval_ = duration; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 base::TimeDelta hung_interval_; | 669 base::TimeDelta hung_interval_; |
671 | 670 |
672 // This SPDY proxy is allowed to push resources from origins that are | 671 // This SPDY proxy is allowed to push resources from origins that are |
673 // different from those of their associated streams. | 672 // different from those of their associated streams. |
674 HostPortPair trusted_spdy_proxy_; | 673 HostPortPair trusted_spdy_proxy_; |
675 }; | 674 }; |
676 | 675 |
677 } // namespace net | 676 } // namespace net |
678 | 677 |
679 #endif // NET_SPDY_SPDY_SESSION_H_ | 678 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |