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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 void OnRequestCompleteFailure(int rv); | 173 void OnRequestCompleteFailure(int rv); |
174 | 174 |
175 // Accessors called by |session_|. | 175 // Accessors called by |session_|. |
176 SpdyStreamType type() const { return type_; } | 176 SpdyStreamType type() const { return type_; } |
177 const GURL& url() const { return url_; } | 177 const GURL& url() const { return url_; } |
178 RequestPriority priority() const { return priority_; } | 178 RequestPriority priority() const { return priority_; } |
179 const BoundNetLog& net_log() const { return net_log_; } | 179 const BoundNetLog& net_log() const { return net_log_; } |
180 | 180 |
181 void Reset(); | 181 void Reset(); |
182 | 182 |
183 base::WeakPtrFactory<SpdyStreamRequest> weak_ptr_factory_; | |
184 SpdyStreamType type_; | 183 SpdyStreamType type_; |
185 base::WeakPtr<SpdySession> session_; | 184 base::WeakPtr<SpdySession> session_; |
186 base::WeakPtr<SpdyStream> stream_; | 185 base::WeakPtr<SpdyStream> stream_; |
187 GURL url_; | 186 GURL url_; |
188 RequestPriority priority_; | 187 RequestPriority priority_; |
189 BoundNetLog net_log_; | 188 BoundNetLog net_log_; |
190 CompletionCallback callback_; | 189 CompletionCallback callback_; |
191 | 190 |
| 191 base::WeakPtrFactory<SpdyStreamRequest> weak_ptr_factory_; |
| 192 |
192 DISALLOW_COPY_AND_ASSIGN(SpdyStreamRequest); | 193 DISALLOW_COPY_AND_ASSIGN(SpdyStreamRequest); |
193 }; | 194 }; |
194 | 195 |
195 class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface, | 196 class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface, |
196 public SpdyFramerDebugVisitorInterface, | 197 public SpdyFramerDebugVisitorInterface, |
197 public HigherLayeredPool { | 198 public HigherLayeredPool { |
198 public: | 199 public: |
199 // TODO(akalin): Use base::TickClock when it becomes available. | 200 // TODO(akalin): Use base::TickClock when it becomes available. |
200 typedef base::TimeTicks (*TimeFunc)(void); | 201 typedef base::TimeTicks (*TimeFunc)(void); |
201 | 202 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 base::TimeTicks last_activity_time() const { return last_activity_time_; } | 921 base::TimeTicks last_activity_time() const { return last_activity_time_; } |
921 | 922 |
922 bool check_ping_status_pending() const { return check_ping_status_pending_; } | 923 bool check_ping_status_pending() const { return check_ping_status_pending_; } |
923 | 924 |
924 size_t max_concurrent_streams() const { return max_concurrent_streams_; } | 925 size_t max_concurrent_streams() const { return max_concurrent_streams_; } |
925 | 926 |
926 // Returns the SSLClientSocket that this SPDY session sits on top of, | 927 // Returns the SSLClientSocket that this SPDY session sits on top of, |
927 // or NULL, if the transport is not SSL. | 928 // or NULL, if the transport is not SSL. |
928 SSLClientSocket* GetSSLClientSocket() const; | 929 SSLClientSocket* GetSSLClientSocket() const; |
929 | 930 |
930 // Used for posting asynchronous IO tasks. We use this even though | |
931 // SpdySession is refcounted because we don't need to keep the SpdySession | |
932 // alive if the last reference is within a RunnableMethod. Just revoke the | |
933 // method. | |
934 base::WeakPtrFactory<SpdySession> weak_factory_; | |
935 | |
936 // Whether Do{Read,Write}Loop() is in the call stack. Useful for | 931 // Whether Do{Read,Write}Loop() is in the call stack. Useful for |
937 // making sure we don't destroy ourselves prematurely in that case. | 932 // making sure we don't destroy ourselves prematurely in that case. |
938 bool in_io_loop_; | 933 bool in_io_loop_; |
939 | 934 |
940 // The key used to identify this session. | 935 // The key used to identify this session. |
941 const SpdySessionKey spdy_session_key_; | 936 const SpdySessionKey spdy_session_key_; |
942 | 937 |
943 // Set set of SpdySessionKeys for which this session has serviced | 938 // Set set of SpdySessionKeys for which this session has serviced |
944 // requests. | 939 // requests. |
945 std::set<SpdySessionKey> pooled_aliases_; | 940 std::set<SpdySessionKey> pooled_aliases_; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 // be hung. TODO(rtenneti): When hung, instead of resetting connection, race | 1116 // be hung. TODO(rtenneti): When hung, instead of resetting connection, race |
1122 // to build a new connection, and see if that completes before we (finally) | 1117 // to build a new connection, and see if that completes before we (finally) |
1123 // get a PING response (http://crbug.com/127812). | 1118 // get a PING response (http://crbug.com/127812). |
1124 base::TimeDelta hung_interval_; | 1119 base::TimeDelta hung_interval_; |
1125 | 1120 |
1126 // This SPDY proxy is allowed to push resources from origins that are | 1121 // This SPDY proxy is allowed to push resources from origins that are |
1127 // different from those of their associated streams. | 1122 // different from those of their associated streams. |
1128 HostPortPair trusted_spdy_proxy_; | 1123 HostPortPair trusted_spdy_proxy_; |
1129 | 1124 |
1130 TimeFunc time_func_; | 1125 TimeFunc time_func_; |
| 1126 |
| 1127 // Used for posting asynchronous IO tasks. We use this even though |
| 1128 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1129 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1130 // method. |
| 1131 base::WeakPtrFactory<SpdySession> weak_factory_; |
1131 }; | 1132 }; |
1132 | 1133 |
1133 } // namespace net | 1134 } // namespace net |
1134 | 1135 |
1135 #endif // NET_SPDY_SPDY_SESSION_H_ | 1136 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |