| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // will via X-Associated-Content. Returns OK if a stream was found | 320 // will via X-Associated-Content. Returns OK if a stream was found |
| 321 // and put into |spdy_stream|, or if one was not found but it is | 321 // and put into |spdy_stream|, or if one was not found but it is |
| 322 // okay to create a new stream (in which case |spdy_stream| is | 322 // okay to create a new stream (in which case |spdy_stream| is |
| 323 // reset). Returns an error (not ERR_IO_PENDING) otherwise, and | 323 // reset). Returns an error (not ERR_IO_PENDING) otherwise, and |
| 324 // resets |spdy_stream|. | 324 // resets |spdy_stream|. |
| 325 // | 325 // |
| 326 // If a stream was found and the stream is still open, the priority | 326 // If a stream was found and the stream is still open, the priority |
| 327 // of that stream is updated to match |priority|. | 327 // of that stream is updated to match |priority|. |
| 328 int GetPushStream(const GURL& url, | 328 int GetPushStream(const GURL& url, |
| 329 RequestPriority priority, | 329 RequestPriority priority, |
| 330 base::WeakPtr<SpdyStream>* spdy_stream, | 330 SpdyStream** spdy_stream, |
| 331 const NetLogWithSource& stream_net_log); | 331 const NetLogWithSource& stream_net_log); |
| 332 | 332 |
| 333 // Called when the pushed stream should be cancelled. If the pushed stream is | 333 // Called when the pushed stream should be cancelled. If the pushed stream is |
| 334 // not claimed and active, sends RST to the server to cancel the stream. | 334 // not claimed and active, sends RST to the server to cancel the stream. |
| 335 void CancelPush(const GURL& url); | 335 void CancelPush(const GURL& url); |
| 336 | 336 |
| 337 // Initialize the session with the given connection. |is_secure| | 337 // Initialize the session with the given connection. |is_secure| |
| 338 // must indicate whether |connection| uses an SSL socket or not; it | 338 // must indicate whether |connection| uses an SSL socket or not; it |
| 339 // is usually true, but it can be false for testing or when SPDY is | 339 // is usually true, but it can be false for testing or when SPDY is |
| 340 // configured to work with non-secure sockets. | 340 // configured to work with non-secure sockets. |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 // that |stream| may hold the last reference to the session. | 811 // that |stream| may hold the last reference to the session. |
| 812 void DeleteStream(std::unique_ptr<SpdyStream> stream, int status); | 812 void DeleteStream(std::unique_ptr<SpdyStream> stream, int status); |
| 813 | 813 |
| 814 // Returns the stream id of the push stream if it is not claimed yet, or 0 | 814 // Returns the stream id of the push stream if it is not claimed yet, or 0 |
| 815 // otherwise. | 815 // otherwise. |
| 816 SpdyStreamId GetStreamIdForPush(const GURL& url); | 816 SpdyStreamId GetStreamIdForPush(const GURL& url); |
| 817 | 817 |
| 818 // Check if we have a pending pushed-stream for this url | 818 // Check if we have a pending pushed-stream for this url |
| 819 // Returns the stream if found (and returns it from the pending | 819 // Returns the stream if found (and returns it from the pending |
| 820 // list). Returns NULL otherwise. | 820 // list). Returns NULL otherwise. |
| 821 base::WeakPtr<SpdyStream> GetActivePushStream(const GURL& url); | 821 SpdyStream* GetActivePushStream(const GURL& url); |
| 822 | 822 |
| 823 void RecordPingRTTHistogram(base::TimeDelta duration); | 823 void RecordPingRTTHistogram(base::TimeDelta duration); |
| 824 void RecordHistograms(); | 824 void RecordHistograms(); |
| 825 void RecordProtocolErrorHistogram(SpdyProtocolErrorDetails details); | 825 void RecordProtocolErrorHistogram(SpdyProtocolErrorDetails details); |
| 826 | 826 |
| 827 // DCHECKs that |availability_state_| >= STATE_GOING_AWAY, that | 827 // DCHECKs that |availability_state_| >= STATE_GOING_AWAY, that |
| 828 // there are no pending stream creation requests, and that there are | 828 // there are no pending stream creation requests, and that there are |
| 829 // no created streams. | 829 // no created streams. |
| 830 void DcheckGoingAway() const; | 830 void DcheckGoingAway() const; |
| 831 | 831 |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 // Used for posting asynchronous IO tasks. We use this even though | 1210 // Used for posting asynchronous IO tasks. We use this even though |
| 1211 // SpdySession is refcounted because we don't need to keep the SpdySession | 1211 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1212 // alive if the last reference is within a RunnableMethod. Just revoke the | 1212 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1213 // method. | 1213 // method. |
| 1214 base::WeakPtrFactory<SpdySession> weak_factory_; | 1214 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1215 }; | 1215 }; |
| 1216 | 1216 |
| 1217 } // namespace net | 1217 } // namespace net |
| 1218 | 1218 |
| 1219 #endif // NET_SPDY_SPDY_SESSION_H_ | 1219 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |