| 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_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 5 #ifndef NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| 6 #define NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 6 #define NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; | 67 void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override; |
| 68 void OnDataSent() override; | 68 void OnDataSent() override; |
| 69 void OnTrailers(const SpdyHeaderBlock& trailers) override; | 69 void OnTrailers(const SpdyHeaderBlock& trailers) override; |
| 70 void OnClose(int status) override; | 70 void OnClose(int status) override; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 int SendRequestHeadersHelper(); | 73 int SendRequestHeadersHelper(); |
| 74 void OnStreamInitialized(int rv); | 74 void OnStreamInitialized(int rv); |
| 75 // Notifies delegate of an error. | 75 // Notifies delegate of an error. |
| 76 void NotifyError(int rv); | 76 void NotifyError(int rv); |
| 77 void NotifyDataSent(); |
| 77 void ResetStream(); | 78 void ResetStream(); |
| 78 void ScheduleBufferedRead(); | 79 void ScheduleBufferedRead(); |
| 79 void DoBufferedRead(); | 80 void DoBufferedRead(); |
| 80 bool ShouldWaitForMoreBufferedData() const; | 81 bool ShouldWaitForMoreBufferedData() const; |
| 82 // Handles the case where stream is closed when SendData()/SendvData() is |
| 83 // called. Return true if stream is closed. |
| 84 bool MaybeHandleStreamClosedInSendData(); |
| 81 | 85 |
| 82 const base::WeakPtr<SpdySession> spdy_session_; | 86 const base::WeakPtr<SpdySession> spdy_session_; |
| 83 const BidirectionalStreamRequestInfo* request_info_; | 87 const BidirectionalStreamRequestInfo* request_info_; |
| 84 BidirectionalStreamImpl::Delegate* delegate_; | 88 BidirectionalStreamImpl::Delegate* delegate_; |
| 85 std::unique_ptr<base::Timer> timer_; | 89 std::unique_ptr<base::Timer> timer_; |
| 86 SpdyStreamRequest stream_request_; | 90 SpdyStreamRequest stream_request_; |
| 87 base::WeakPtr<SpdyStream> stream_; | 91 base::WeakPtr<SpdyStream> stream_; |
| 88 | 92 |
| 89 NextProto negotiated_protocol_; | 93 NextProto negotiated_protocol_; |
| 90 | 94 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 scoped_refptr<IOBuffer> pending_combined_buffer_; | 120 scoped_refptr<IOBuffer> pending_combined_buffer_; |
| 117 | 121 |
| 118 base::WeakPtrFactory<BidirectionalStreamSpdyImpl> weak_factory_; | 122 base::WeakPtrFactory<BidirectionalStreamSpdyImpl> weak_factory_; |
| 119 | 123 |
| 120 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamSpdyImpl); | 124 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamSpdyImpl); |
| 121 }; | 125 }; |
| 122 | 126 |
| 123 } // namespace net | 127 } // namespace net |
| 124 | 128 |
| 125 #endif // NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ | 129 #endif // NET_SPDY_BIDIRECTIONAL_STREAM_SPDY_IMPL_H_ |
| OLD | NEW |