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

Side by Side Diff: net/tools/quic/quic_client.cc

Issue 17302002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | no next file » | 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 #include "net/tools/quic/quic_client.h" 5 #include "net/tools/quic/quic_client.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <netinet/in.h> 8 #include <netinet/in.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/epoll.h> 10 #include <sys/epoll.h>
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 193
194 void QuicClient::WaitForStreamToClose(QuicStreamId id) { 194 void QuicClient::WaitForStreamToClose(QuicStreamId id) {
195 DCHECK(connected()); 195 DCHECK(connected());
196 196
197 while (!session_->IsClosedStream(id)) { 197 while (!session_->IsClosedStream(id)) {
198 epoll_server_.WaitForEventsAndExecuteCallbacks(); 198 epoll_server_.WaitForEventsAndExecuteCallbacks();
199 } 199 }
200 } 200 }
201 201
202 void QuicClient::WaitForCryptoHandshakeConfirmed() {
203 DCHECK(connected());
204
205 while (!session_->IsCryptoHandshakeConfirmed()) {
206 epoll_server_.WaitForEventsAndExecuteCallbacks();
207 }
208 }
209
202 bool QuicClient::WaitForEvents() { 210 bool QuicClient::WaitForEvents() {
203 DCHECK(connected()); 211 DCHECK(connected());
204 212
205 epoll_server_.WaitForEventsAndExecuteCallbacks(); 213 epoll_server_.WaitForEventsAndExecuteCallbacks();
206 return session_->num_active_requests() != 0; 214 return session_->num_active_requests() != 0;
207 } 215 }
208 216
209 void QuicClient::OnEvent(int fd, EpollEvent* event) { 217 void QuicClient::OnEvent(int fd, EpollEvent* event) {
210 DCHECK_EQ(fd, fd_); 218 DCHECK_EQ(fd, fd_);
211 219
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 272 }
265 273
266 IPEndPoint client_address(client_ip, client_address_.port()); 274 IPEndPoint client_address(client_ip, client_address_.port());
267 session_->connection()->ProcessUdpPacket( 275 session_->connection()->ProcessUdpPacket(
268 client_address, server_address, packet); 276 client_address, server_address, packet);
269 return true; 277 return true;
270 } 278 }
271 279
272 } // namespace tools 280 } // namespace tools
273 } // namespace net 281 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698