| 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 std::unique_ptr<SpdyStream> ActivateCreatedStream(SpdyStream* stream); | 805 std::unique_ptr<SpdyStream> ActivateCreatedStream(SpdyStream* stream); |
| 806 | 806 |
| 807 // Inserts a newly-activated stream into |active_streams_|. | 807 // Inserts a newly-activated stream into |active_streams_|. |
| 808 void InsertActivatedStream(std::unique_ptr<SpdyStream> stream); | 808 void InsertActivatedStream(std::unique_ptr<SpdyStream> stream); |
| 809 | 809 |
| 810 // Remove all internal references to |stream|, call OnClose() on it, | 810 // Remove all internal references to |stream|, call OnClose() on it, |
| 811 // and process any pending stream requests before deleting it. Note | 811 // and process any pending stream requests before deleting it. Note |
| 812 // that |stream| may hold the last reference to the session. | 812 // that |stream| may hold the last reference to the session. |
| 813 void DeleteStream(std::unique_ptr<SpdyStream> stream, int status); | 813 void DeleteStream(std::unique_ptr<SpdyStream> stream, int status); |
| 814 | 814 |
| 815 // Returns the stream id of the push stream if it is not claimed yet, or 0 |
| 816 // otherwise. |
| 817 SpdyStreamId GetStreamIdForPush(const GURL& url); |
| 818 |
| 815 // Check if we have a pending pushed-stream for this url | 819 // Check if we have a pending pushed-stream for this url |
| 816 // Returns the stream if found (and returns it from the pending | 820 // Returns the stream if found (and returns it from the pending |
| 817 // list). Returns NULL otherwise. | 821 // list). Returns NULL otherwise. |
| 818 base::WeakPtr<SpdyStream> GetActivePushStream(const GURL& url); | 822 base::WeakPtr<SpdyStream> GetActivePushStream(const GURL& url); |
| 819 | 823 |
| 820 // Delegates to |stream->OnInitialResponseHeadersReceived()|. If an | 824 // Delegates to |stream->OnInitialResponseHeadersReceived()|. If an |
| 821 // error is returned, the last reference to |this| may have been | 825 // error is returned, the last reference to |this| may have been |
| 822 // released. | 826 // released. |
| 823 int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, | 827 int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, |
| 824 base::Time response_time, | 828 base::Time response_time, |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 // Used for posting asynchronous IO tasks. We use this even though | 1213 // Used for posting asynchronous IO tasks. We use this even though |
| 1210 // SpdySession is refcounted because we don't need to keep the SpdySession | 1214 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1211 // alive if the last reference is within a RunnableMethod. Just revoke the | 1215 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1212 // method. | 1216 // method. |
| 1213 base::WeakPtrFactory<SpdySession> weak_factory_; | 1217 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1214 }; | 1218 }; |
| 1215 | 1219 |
| 1216 } // namespace net | 1220 } // namespace net |
| 1217 | 1221 |
| 1218 #endif // NET_SPDY_SPDY_SESSION_H_ | 1222 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |