| 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 bool VerifyDomainAuthentication(const std::string& domain); | 359 bool VerifyDomainAuthentication(const std::string& domain); |
| 360 | 360 |
| 361 // Pushes the given producer into the write queue for | 361 // Pushes the given producer into the write queue for |
| 362 // |stream|. |stream| is guaranteed to be activated before the | 362 // |stream|. |stream| is guaranteed to be activated before the |
| 363 // producer is used to produce its frame. | 363 // producer is used to produce its frame. |
| 364 void EnqueueStreamWrite(const base::WeakPtr<SpdyStream>& stream, | 364 void EnqueueStreamWrite(const base::WeakPtr<SpdyStream>& stream, |
| 365 SpdyFrameType frame_type, | 365 SpdyFrameType frame_type, |
| 366 scoped_ptr<SpdyBufferProducer> producer); | 366 scoped_ptr<SpdyBufferProducer> producer); |
| 367 | 367 |
| 368 // Creates and returns a SYN frame for |stream_id|. | 368 // Creates and returns a SYN frame for |stream_id|. |
| 369 scoped_ptr<SpdyFrame> CreateSynStream( | 369 scoped_ptr<SpdySerializedFrame> CreateSynStream( |
| 370 SpdyStreamId stream_id, | 370 SpdyStreamId stream_id, |
| 371 RequestPriority priority, | 371 RequestPriority priority, |
| 372 SpdyControlFlags flags, | 372 SpdyControlFlags flags, |
| 373 const SpdyHeaderBlock& headers); | 373 const SpdyHeaderBlock& headers); |
| 374 | 374 |
| 375 // Creates and returns a SpdyBuffer holding a data frame with the | 375 // Creates and returns a SpdyBuffer holding a data frame with the |
| 376 // given data. May return NULL if stalled by flow control. | 376 // given data. May return NULL if stalled by flow control. |
| 377 scoped_ptr<SpdyBuffer> CreateDataBuffer(SpdyStreamId stream_id, | 377 scoped_ptr<SpdyBuffer> CreateDataBuffer(SpdyStreamId stream_id, |
| 378 IOBuffer* data, | 378 IOBuffer* data, |
| 379 int len, | 379 int len, |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 // haven't received any data in |kHungInterval| time period. | 782 // haven't received any data in |kHungInterval| time period. |
| 783 void CheckPingStatus(base::TimeTicks last_check_time); | 783 void CheckPingStatus(base::TimeTicks last_check_time); |
| 784 | 784 |
| 785 // Get a new stream id. | 785 // Get a new stream id. |
| 786 SpdyStreamId GetNewStreamId(); | 786 SpdyStreamId GetNewStreamId(); |
| 787 | 787 |
| 788 // Pushes the given frame with the given priority into the write | 788 // Pushes the given frame with the given priority into the write |
| 789 // queue for the session. | 789 // queue for the session. |
| 790 void EnqueueSessionWrite(RequestPriority priority, | 790 void EnqueueSessionWrite(RequestPriority priority, |
| 791 SpdyFrameType frame_type, | 791 SpdyFrameType frame_type, |
| 792 scoped_ptr<SpdyFrame> frame); | 792 scoped_ptr<SpdySerializedFrame> frame); |
| 793 | 793 |
| 794 // Puts |producer| associated with |stream| onto the write queue | 794 // Puts |producer| associated with |stream| onto the write queue |
| 795 // with the given priority. | 795 // with the given priority. |
| 796 void EnqueueWrite(RequestPriority priority, | 796 void EnqueueWrite(RequestPriority priority, |
| 797 SpdyFrameType frame_type, | 797 SpdyFrameType frame_type, |
| 798 scoped_ptr<SpdyBufferProducer> producer, | 798 scoped_ptr<SpdyBufferProducer> producer, |
| 799 const base::WeakPtr<SpdyStream>& stream); | 799 const base::WeakPtr<SpdyStream>& stream); |
| 800 | 800 |
| 801 // Inserts a newly-created stream into |created_streams_|. | 801 // Inserts a newly-created stream into |created_streams_|. |
| 802 void InsertCreatedStream(scoped_ptr<SpdyStream> stream); | 802 void InsertCreatedStream(scoped_ptr<SpdyStream> stream); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 // Used for posting asynchronous IO tasks. We use this even though | 1226 // Used for posting asynchronous IO tasks. We use this even though |
| 1227 // SpdySession is refcounted because we don't need to keep the SpdySession | 1227 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1228 // alive if the last reference is within a RunnableMethod. Just revoke the | 1228 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1229 // method. | 1229 // method. |
| 1230 base::WeakPtrFactory<SpdySession> weak_factory_; | 1230 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1231 }; | 1231 }; |
| 1232 | 1232 |
| 1233 } // namespace net | 1233 } // namespace net |
| 1234 | 1234 |
| 1235 #endif // NET_SPDY_SPDY_SESSION_H_ | 1235 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |