| 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/load_timing_info.h" | 15 #include "net/base/load_timing_info.h" |
| 16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
| 17 #include "net/socket/next_proto.h" | 17 #include "net/socket/next_proto.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class Timer; | 20 class Timer; |
| 21 } // namespace base | 21 } // namespace base |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 | 24 |
| 25 class BoundNetLog; | 25 class NetLogWithSource; |
| 26 class IOBuffer; | 26 class IOBuffer; |
| 27 class SpdyHeaderBlock; | 27 class SpdyHeaderBlock; |
| 28 struct BidirectionalStreamRequestInfo; | 28 struct BidirectionalStreamRequestInfo; |
| 29 | 29 |
| 30 // Exposes an interface to do HTTP/2 bidirectional streaming. | 30 // Exposes an interface to do HTTP/2 bidirectional streaming. |
| 31 // Note that only one ReadData or SendData should be in flight until the | 31 // Note that only one ReadData or SendData should be in flight until the |
| 32 // operation completes synchronously or asynchronously. | 32 // operation completes synchronously or asynchronously. |
| 33 // BidirectionalStreamImpl once created by HttpStreamFactoryImpl should be owned | 33 // BidirectionalStreamImpl once created by HttpStreamFactoryImpl should be owned |
| 34 // by BidirectionalStream. | 34 // by BidirectionalStream. |
| 35 class NET_EXPORT_PRIVATE BidirectionalStreamImpl { | 35 class NET_EXPORT_PRIVATE BidirectionalStreamImpl { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // |this| should not be destroyed during Delegate::OnHeadersSent or | 92 // |this| should not be destroyed during Delegate::OnHeadersSent or |
| 93 // Delegate::OnDataSent. | 93 // Delegate::OnDataSent. |
| 94 virtual ~BidirectionalStreamImpl(); | 94 virtual ~BidirectionalStreamImpl(); |
| 95 | 95 |
| 96 // Starts the BidirectionalStreamImpl and sends request headers. | 96 // Starts the BidirectionalStreamImpl and sends request headers. |
| 97 // |send_request_headers_automatically| if true, request headers will be sent | 97 // |send_request_headers_automatically| if true, request headers will be sent |
| 98 // automatically when stream is negotiated. If false, request headers will be | 98 // automatically when stream is negotiated. If false, request headers will be |
| 99 // sent only when SendRequestHeaders() is invoked or with next | 99 // sent only when SendRequestHeaders() is invoked or with next |
| 100 // SendData/SendvData. | 100 // SendData/SendvData. |
| 101 virtual void Start(const BidirectionalStreamRequestInfo* request_info, | 101 virtual void Start(const BidirectionalStreamRequestInfo* request_info, |
| 102 const BoundNetLog& net_log, | 102 const NetLogWithSource& net_log, |
| 103 bool send_request_headers_automatically, | 103 bool send_request_headers_automatically, |
| 104 BidirectionalStreamImpl::Delegate* delegate, | 104 BidirectionalStreamImpl::Delegate* delegate, |
| 105 std::unique_ptr<base::Timer> timer) = 0; | 105 std::unique_ptr<base::Timer> timer) = 0; |
| 106 | 106 |
| 107 // Sends request headers to server. | 107 // Sends request headers to server. |
| 108 // When |send_request_headers_automatically_| is | 108 // When |send_request_headers_automatically_| is |
| 109 // false and OnStreamReady() is invoked with request_headers_sent = false, | 109 // false and OnStreamReady() is invoked with request_headers_sent = false, |
| 110 // headers will be combined with next SendData/SendvData unless this | 110 // headers will be combined with next SendData/SendvData unless this |
| 111 // method is called first, in which case headers will be sent separately | 111 // method is called first, in which case headers will be sent separately |
| 112 // without delay. | 112 // without delay. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // and false otherwise. | 156 // and false otherwise. |
| 157 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 157 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); | 160 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace net | 163 } // namespace net |
| 164 | 164 |
| 165 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 165 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| OLD | NEW |