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

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

Issue 2347433003: Cleanup QuicHttpStream to be a bit more consistent with net coding conventions. (Closed)
Patch Set: More Created 4 years, 3 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/quic_http_stream.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_QUIC_HTTP_STREAM_H_ 5 #ifndef NET_QUIC_QUIC_HTTP_STREAM_H_
6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 bool CheckVary(const SpdyHeaderBlock& client_request, 88 bool CheckVary(const SpdyHeaderBlock& client_request,
89 const SpdyHeaderBlock& promise_request, 89 const SpdyHeaderBlock& promise_request,
90 const SpdyHeaderBlock& promise_response) override; 90 const SpdyHeaderBlock& promise_response) override;
91 void OnRendezvousResult(QuicSpdyStream* stream) override; 91 void OnRendezvousResult(QuicSpdyStream* stream) override;
92 92
93 private: 93 private:
94 friend class test::QuicHttpStreamPeer; 94 friend class test::QuicHttpStreamPeer;
95 95
96 enum State { 96 enum State {
97 STATE_NONE, 97 STATE_NONE,
98 STATE_HANDLE_PROMISE,
99 STATE_HANDLE_PROMISE_COMPLETE,
98 STATE_REQUEST_STREAM, 100 STATE_REQUEST_STREAM,
101 STATE_REQUEST_STREAM_COMPLETE,
99 STATE_SET_REQUEST_PRIORITY, 102 STATE_SET_REQUEST_PRIORITY,
100 STATE_WAIT_FOR_CONFIRMATION, 103 STATE_WAIT_FOR_CONFIRMATION,
101 STATE_WAIT_FOR_CONFIRMATION_COMPLETE, 104 STATE_WAIT_FOR_CONFIRMATION_COMPLETE,
102 STATE_SEND_HEADERS, 105 STATE_SEND_HEADERS,
103 STATE_SEND_HEADERS_COMPLETE, 106 STATE_SEND_HEADERS_COMPLETE,
104 STATE_READ_REQUEST_BODY, 107 STATE_READ_REQUEST_BODY,
105 STATE_READ_REQUEST_BODY_COMPLETE, 108 STATE_READ_REQUEST_BODY_COMPLETE,
106 STATE_SEND_BODY, 109 STATE_SEND_BODY,
107 STATE_SEND_BODY_COMPLETE, 110 STATE_SEND_BODY_COMPLETE,
108 STATE_OPEN, 111 STATE_OPEN,
109 }; 112 };
110 113
111 void OnStreamReady(int rv);
112 void OnIOComplete(int rv); 114 void OnIOComplete(int rv);
113 void DoCallback(int rv); 115 void DoCallback(int rv);
114 116
115 int DoLoop(int rv); 117 int DoLoop(int rv);
116 int DoStreamRequest(); 118 int DoHandlePromise();
119 int DoHandlePromiseComplete(int rv);
120 int DoRequestStream();
121 int DoRequestStreamComplete(int rv);
117 int DoSetRequestPriority(); 122 int DoSetRequestPriority();
118 int DoWaitForConfirmation(); 123 int DoWaitForConfirmation();
119 int DoWaitForConfirmationComplete(int rv); 124 int DoWaitForConfirmationComplete(int rv);
120 int DoSendHeaders(); 125 int DoSendHeaders();
121 int DoSendHeadersComplete(int rv); 126 int DoSendHeadersComplete(int rv);
122 int DoReadRequestBody(); 127 int DoReadRequestBody();
123 int DoReadRequestBodyComplete(int rv); 128 int DoReadRequestBodyComplete(int rv);
124 int DoSendBody(); 129 int DoSendBody();
125 int DoSendBodyComplete(int rv); 130 int DoSendBodyComplete(int rv);
126 131
127 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); 132 int ProcessResponseHeaders(const SpdyHeaderBlock& headers);
128 133
129 int ReadAvailableData(IOBuffer* buf, int buf_len); 134 int ReadAvailableData(IOBuffer* buf, int buf_len);
130 void EnterStateSendHeaders(); 135 void EnterStateSendHeaders();
131 int HandlePromise();
132 136
133 void ResetStream(); 137 void ResetStream();
134 bool CancelPromiseIfHasBody(); 138 bool CancelPromiseIfHasBody();
135 139
136 State next_state_; 140 State next_state_;
137 141
138 base::WeakPtr<QuicChromiumClientSession> session_; 142 base::WeakPtr<QuicChromiumClientSession> session_;
139 int session_error_; // Error code from the connection shutdown. 143 int session_error_; // Error code from the connection shutdown.
140 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. 144 bool was_handshake_confirmed_; // True if the crypto handshake succeeded.
141 QuicChromiumClientSession::StreamRequest stream_request_; 145 QuicChromiumClientSession::StreamRequest stream_request_;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 LoadTimingInfo::ConnectTiming connect_timing_; 223 LoadTimingInfo::ConnectTiming connect_timing_;
220 224
221 base::WeakPtrFactory<QuicHttpStream> weak_factory_; 225 base::WeakPtrFactory<QuicHttpStream> weak_factory_;
222 226
223 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); 227 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream);
224 }; 228 };
225 229
226 } // namespace net 230 } // namespace net
227 231
228 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ 232 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/chromium/quic_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698