Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: net/quic/chromium/bidirectional_stream_quic_impl.h

Issue 2908243002: Remove QuicChromiumClientStream::Delegate in favor of async methods. (Closed)
Patch Set: No expect_trailers_ Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ 5 #ifndef NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_
6 #define NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ 6 #define NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 11 matching lines...) Expand all
22 namespace base { 22 namespace base {
23 class Timer; 23 class Timer;
24 } // namespace base 24 } // namespace base
25 25
26 namespace net { 26 namespace net {
27 27
28 struct BidirectionalStreamRequestInfo; 28 struct BidirectionalStreamRequestInfo;
29 class IOBuffer; 29 class IOBuffer;
30 30
31 class NET_EXPORT_PRIVATE BidirectionalStreamQuicImpl 31 class NET_EXPORT_PRIVATE BidirectionalStreamQuicImpl
32 : public BidirectionalStreamImpl, 32 : public BidirectionalStreamImpl {
33 public QuicChromiumClientStream::Delegate {
34 public: 33 public:
35 explicit BidirectionalStreamQuicImpl( 34 explicit BidirectionalStreamQuicImpl(
36 std::unique_ptr<QuicChromiumClientSession::Handle> session); 35 std::unique_ptr<QuicChromiumClientSession::Handle> session);
37 36
38 ~BidirectionalStreamQuicImpl() override; 37 ~BidirectionalStreamQuicImpl() override;
39 38
40 // BidirectionalStreamImpl implementation: 39 // BidirectionalStreamImpl implementation:
41 void Start(const BidirectionalStreamRequestInfo* request_info, 40 void Start(const BidirectionalStreamRequestInfo* request_info,
42 const NetLogWithSource& net_log, 41 const NetLogWithSource& net_log,
43 bool send_request_headers_automatically, 42 bool send_request_headers_automatically,
44 BidirectionalStreamImpl::Delegate* delegate, 43 BidirectionalStreamImpl::Delegate* delegate,
45 std::unique_ptr<base::Timer> timer) override; 44 std::unique_ptr<base::Timer> timer) override;
46 void SendRequestHeaders() override; 45 void SendRequestHeaders() override;
47 int ReadData(IOBuffer* buffer, int buffer_len) override; 46 int ReadData(IOBuffer* buffer, int buffer_len) override;
48 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, 47 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers,
49 const std::vector<int>& lengths, 48 const std::vector<int>& lengths,
50 bool end_stream) override; 49 bool end_stream) override;
51 NextProto GetProtocol() const override; 50 NextProto GetProtocol() const override;
52 int64_t GetTotalReceivedBytes() const override; 51 int64_t GetTotalReceivedBytes() const override;
53 int64_t GetTotalSentBytes() const override; 52 int64_t GetTotalSentBytes() const override;
54 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; 53 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override;
55 54
56 private: 55 private:
57 // QuicChromiumClientStream::Delegate implementation: 56 int WriteHeaders();
58 void OnClose() override;
59 void OnError(int error) override;
60
61 // Write headers to the stream and returns true on success. Posts a task to
62 // notify the delegate asynchronously and returns false on failure
63 bool WriteHeaders();
64
65 void OnStreamReady(int rv); 57 void OnStreamReady(int rv);
66 void OnSendDataComplete(int rv); 58 void OnSendDataComplete(int rv);
67 void ReadInitialHeaders(); 59 void ReadInitialHeaders();
68 void OnReadInitialHeadersComplete(int rv); 60 void OnReadInitialHeadersComplete(int rv);
69 void ReadTrailingHeaders(); 61 void ReadTrailingHeaders();
70 void OnReadTrailingHeadersComplete(int rv); 62 void OnReadTrailingHeadersComplete(int rv);
71 void OnReadDataComplete(int rv); 63 void OnReadDataComplete(int rv);
72 64
73 // Notifies the delegate of an error, clears |stream_| and |delegate_|, 65 // Notifies the delegate of an error, clears |stream_| and |delegate_|,
74 // and cancels any pending callbacks. 66 // and cancels any pending callbacks.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 bool may_invoke_callbacks_; 127 bool may_invoke_callbacks_;
136 128
137 base::WeakPtrFactory<BidirectionalStreamQuicImpl> weak_factory_; 129 base::WeakPtrFactory<BidirectionalStreamQuicImpl> weak_factory_;
138 130
139 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamQuicImpl); 131 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamQuicImpl);
140 }; 132 };
141 133
142 } // namespace net 134 } // namespace net
143 135
144 #endif // NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_ 136 #endif // NET_QUIC_CHROMIUM_BIDIRECTIONAL_STREAM_QUIC_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698