| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 5 #ifndef NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 16 #include "net/socket/next_proto.h" | 16 #include "net/socket/next_proto.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class Timer; | 19 class Timer; |
| 20 } // namespace base | 20 } // namespace base |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class BoundNetLog; | 24 class NetLogWithSource; |
| 25 class IOBuffer; | 25 class IOBuffer; |
| 26 class SpdyHeaderBlock; | 26 class SpdyHeaderBlock; |
| 27 struct BidirectionalStreamRequestInfo; | 27 struct BidirectionalStreamRequestInfo; |
| 28 | 28 |
| 29 // Exposes an interface to do HTTP/2 bidirectional streaming. | 29 // Exposes an interface to do HTTP/2 bidirectional streaming. |
| 30 // Note that only one ReadData or SendData should be in flight until the | 30 // Note that only one ReadData or SendData should be in flight until the |
| 31 // operation completes synchronously or asynchronously. | 31 // operation completes synchronously or asynchronously. |
| 32 // BidirectionalStreamImpl once created by HttpStreamFactoryImpl should be owned | 32 // BidirectionalStreamImpl once created by HttpStreamFactoryImpl should be owned |
| 33 // by BidirectionalStream. | 33 // by BidirectionalStream. |
| 34 class NET_EXPORT_PRIVATE BidirectionalStreamImpl { | 34 class NET_EXPORT_PRIVATE BidirectionalStreamImpl { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // |this| should not be destroyed during Delegate::OnHeadersSent or | 91 // |this| should not be destroyed during Delegate::OnHeadersSent or |
| 92 // Delegate::OnDataSent. | 92 // Delegate::OnDataSent. |
| 93 virtual ~BidirectionalStreamImpl(); | 93 virtual ~BidirectionalStreamImpl(); |
| 94 | 94 |
| 95 // Starts the BidirectionalStreamImpl and sends request headers. | 95 // Starts the BidirectionalStreamImpl and sends request headers. |
| 96 // |send_request_headers_automatically| if true, request headers will be sent | 96 // |send_request_headers_automatically| if true, request headers will be sent |
| 97 // automatically when stream is negotiated. If false, request headers will be | 97 // automatically when stream is negotiated. If false, request headers will be |
| 98 // sent only when SendRequestHeaders() is invoked or with next | 98 // sent only when SendRequestHeaders() is invoked or with next |
| 99 // SendData/SendvData. | 99 // SendData/SendvData. |
| 100 virtual void Start(const BidirectionalStreamRequestInfo* request_info, | 100 virtual void Start(const BidirectionalStreamRequestInfo* request_info, |
| 101 const BoundNetLog& net_log, | 101 const NetLogWithSource& net_log, |
| 102 bool send_request_headers_automatically, | 102 bool send_request_headers_automatically, |
| 103 BidirectionalStreamImpl::Delegate* delegate, | 103 BidirectionalStreamImpl::Delegate* delegate, |
| 104 std::unique_ptr<base::Timer> timer) = 0; | 104 std::unique_ptr<base::Timer> timer) = 0; |
| 105 | 105 |
| 106 // Sends request headers to server. | 106 // Sends request headers to server. |
| 107 // When |send_request_headers_automatically_| is | 107 // When |send_request_headers_automatically_| is |
| 108 // false and OnStreamReady() is invoked with request_headers_sent = false, | 108 // false and OnStreamReady() is invoked with request_headers_sent = false, |
| 109 // headers will be combined with next SendData/SendvData unless this | 109 // headers will be combined with next SendData/SendvData unless this |
| 110 // method is called first, in which case headers will be sent separately | 110 // method is called first, in which case headers will be sent separately |
| 111 // without delay. | 111 // without delay. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // not associated with any stream, and are not included in this value. | 150 // not associated with any stream, and are not included in this value. |
| 151 virtual int64_t GetTotalSentBytes() const = 0; | 151 virtual int64_t GetTotalSentBytes() const = 0; |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); | 154 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 } // namespace net | 157 } // namespace net |
| 158 | 158 |
| 159 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 159 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| OLD | NEW |