| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_STREAM_H_ |
| 6 #define NET_SPDY_SPDY_STREAM_H_ | 6 #define NET_SPDY_SPDY_STREAM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 #include "net/base/bandwidth_metrics.h" | 17 #include "net/base/bandwidth_metrics.h" |
| 18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| 19 #include "net/base/net_api.h" | 19 #include "net/base/net_export.h" |
| 20 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
| 21 #include "net/base/upload_data.h" | 21 #include "net/base/upload_data.h" |
| 22 #include "net/spdy/spdy_framer.h" | 22 #include "net/spdy/spdy_framer.h" |
| 23 #include "net/spdy/spdy_protocol.h" | 23 #include "net/spdy/spdy_protocol.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 class AddressList; | 27 class AddressList; |
| 28 class IPEndPoint; | 28 class IPEndPoint; |
| 29 class SpdySession; | 29 class SpdySession; |
| 30 class SSLCertRequestInfo; | 30 class SSLCertRequestInfo; |
| 31 class SSLInfo; | 31 class SSLInfo; |
| 32 | 32 |
| 33 // The SpdyStream is used by the SpdySession to represent each stream known | 33 // The SpdyStream is used by the SpdySession to represent each stream known |
| 34 // on the SpdySession. This class provides interfaces for SpdySession to use. | 34 // on the SpdySession. This class provides interfaces for SpdySession to use. |
| 35 // Streams can be created either by the client or by the server. When they | 35 // Streams can be created either by the client or by the server. When they |
| 36 // are initiated by the client, both the SpdySession and client object (such as | 36 // are initiated by the client, both the SpdySession and client object (such as |
| 37 // a SpdyNetworkTransaction) will maintain a reference to the stream. When | 37 // a SpdyNetworkTransaction) will maintain a reference to the stream. When |
| 38 // initiated by the server, only the SpdySession will maintain any reference, | 38 // initiated by the server, only the SpdySession will maintain any reference, |
| 39 // until such a time as a client object requests a stream for the path. | 39 // until such a time as a client object requests a stream for the path. |
| 40 class NET_TEST SpdyStream | 40 class NET_EXPORT_PRIVATE SpdyStream |
| 41 : public base::RefCounted<SpdyStream>, | 41 : public base::RefCounted<SpdyStream>, |
| 42 public ChunkCallback { | 42 public ChunkCallback { |
| 43 public: | 43 public: |
| 44 // Delegate handles protocol specific behavior of spdy stream. | 44 // Delegate handles protocol specific behavior of spdy stream. |
| 45 class NET_TEST Delegate { | 45 class NET_EXPORT_PRIVATE Delegate { |
| 46 public: | 46 public: |
| 47 Delegate() {} | 47 Delegate() {} |
| 48 | 48 |
| 49 // Called when SYN frame has been sent. | 49 // Called when SYN frame has been sent. |
| 50 // Returns true if no more data to be sent after SYN frame. | 50 // Returns true if no more data to be sent after SYN frame. |
| 51 virtual bool OnSendHeadersComplete(int status) = 0; | 51 virtual bool OnSendHeadersComplete(int status) = 0; |
| 52 | 52 |
| 53 // Called when stream is ready to send data. | 53 // Called when stream is ready to send data. |
| 54 // Returns network error code. OK when it successfully sent data. | 54 // Returns network error code. OK when it successfully sent data. |
| 55 virtual int OnSendBody() = 0; | 55 virtual int OnSendBody() = 0; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 int recv_bytes_; | 322 int recv_bytes_; |
| 323 // Data received before delegate is attached. | 323 // Data received before delegate is attached. |
| 324 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; | 324 std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_; |
| 325 | 325 |
| 326 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 326 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 } // namespace net | 329 } // namespace net |
| 330 | 330 |
| 331 #endif // NET_SPDY_SPDY_STREAM_H_ | 331 #endif // NET_SPDY_SPDY_STREAM_H_ |
| OLD | NEW |