| 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 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // the session as permanently closed. Callers must assume that the | 346 // the session as permanently closed. Callers must assume that the |
| 347 // session is destroyed after this is called. (However, it may not | 347 // session is destroyed after this is called. (However, it may not |
| 348 // be destroyed right away, e.g. when a SpdySession function is | 348 // be destroyed right away, e.g. when a SpdySession function is |
| 349 // present in the call stack.) | 349 // present in the call stack.) |
| 350 // | 350 // |
| 351 // |err| should be < ERR_IO_PENDING; this function is intended to be | 351 // |err| should be < ERR_IO_PENDING; this function is intended to be |
| 352 // called on error. | 352 // called on error. |
| 353 // |description| indicates the reason for the error. | 353 // |description| indicates the reason for the error. |
| 354 void CloseSessionOnError(Error err, const std::string& description); | 354 void CloseSessionOnError(Error err, const std::string& description); |
| 355 | 355 |
| 356 // Mark this session as going away. It should not be used for new streams but |
| 357 // currently active streams are left alone. Pending requests for new streams |
| 358 // and created-but-inactive streams fail with |err|. |
| 359 void Deprecate(Error err); |
| 360 |
| 356 // Retrieves information on the current state of the SPDY session as a | 361 // Retrieves information on the current state of the SPDY session as a |
| 357 // Value. Caller takes possession of the returned value. | 362 // Value. Caller takes possession of the returned value. |
| 358 base::Value* GetInfoAsValue() const; | 363 base::Value* GetInfoAsValue() const; |
| 359 | 364 |
| 360 // Indicates whether the session is being reused after having successfully | 365 // Indicates whether the session is being reused after having successfully |
| 361 // used to send/receive data in the past. | 366 // used to send/receive data in the past. |
| 362 bool IsReused() const; | 367 bool IsReused() const; |
| 363 | 368 |
| 364 // Returns true if the underlying transport socket ever had any reads or | 369 // Returns true if the underlying transport socket ever had any reads or |
| 365 // writes. | 370 // writes. |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 void QueueSendStalledStream(const SpdyStream& stream); | 885 void QueueSendStalledStream(const SpdyStream& stream); |
| 881 | 886 |
| 882 // Go through the queue of send-stalled streams and try to resume as | 887 // Go through the queue of send-stalled streams and try to resume as |
| 883 // many as possible. | 888 // many as possible. |
| 884 void ResumeSendStalledStreams(); | 889 void ResumeSendStalledStreams(); |
| 885 | 890 |
| 886 // Returns the next stream to possibly resume, or 0 if the queue is | 891 // Returns the next stream to possibly resume, or 0 if the queue is |
| 887 // empty. | 892 // empty. |
| 888 SpdyStreamId PopStreamToPossiblyResume(); | 893 SpdyStreamId PopStreamToPossiblyResume(); |
| 889 | 894 |
| 895 // Perform the work resulting from reception of a GOAWAY message. |
| 896 void GoAway(SpdyStreamId last_accepted_stream_id, Error err); |
| 897 |
| 890 // -------------------------- | 898 // -------------------------- |
| 891 // Helper methods for testing | 899 // Helper methods for testing |
| 892 // -------------------------- | 900 // -------------------------- |
| 893 | 901 |
| 894 void set_connection_at_risk_of_loss_time(base::TimeDelta duration) { | 902 void set_connection_at_risk_of_loss_time(base::TimeDelta duration) { |
| 895 connection_at_risk_of_loss_time_ = duration; | 903 connection_at_risk_of_loss_time_ = duration; |
| 896 } | 904 } |
| 897 | 905 |
| 898 void set_hung_interval(base::TimeDelta duration) { | 906 void set_hung_interval(base::TimeDelta duration) { |
| 899 hung_interval_ = duration; | 907 hung_interval_ = duration; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 // This SPDY proxy is allowed to push resources from origins that are | 1120 // This SPDY proxy is allowed to push resources from origins that are |
| 1113 // different from those of their associated streams. | 1121 // different from those of their associated streams. |
| 1114 HostPortPair trusted_spdy_proxy_; | 1122 HostPortPair trusted_spdy_proxy_; |
| 1115 | 1123 |
| 1116 TimeFunc time_func_; | 1124 TimeFunc time_func_; |
| 1117 }; | 1125 }; |
| 1118 | 1126 |
| 1119 } // namespace net | 1127 } // namespace net |
| 1120 | 1128 |
| 1121 #endif // NET_SPDY_SPDY_SESSION_H_ | 1129 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |