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

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

Issue 149263002: Refactor QuicConnection to use explicit notification for getting onto (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/quic/test_tools/quic_test_utils.cc ('k') | net/tools/quic/quic_dispatcher.h » ('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 #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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 void QuicClient::OnEvent(int fd, EpollEvent* event) { 234 void QuicClient::OnEvent(int fd, EpollEvent* event) {
235 DCHECK_EQ(fd, fd_); 235 DCHECK_EQ(fd, fd_);
236 236
237 if (event->in_events & EPOLLIN) { 237 if (event->in_events & EPOLLIN) {
238 while (connected() && ReadAndProcessPacket()) { 238 while (connected() && ReadAndProcessPacket()) {
239 } 239 }
240 } 240 }
241 if (connected() && (event->in_events & EPOLLOUT)) { 241 if (connected() && (event->in_events & EPOLLOUT)) {
242 writer_->SetWritable();
242 session_->connection()->OnCanWrite(); 243 session_->connection()->OnCanWrite();
243 } 244 }
244 if (event->in_events & EPOLLERR) { 245 if (event->in_events & EPOLLERR) {
245 DVLOG(1) << "Epollerr"; 246 DVLOG(1) << "Epollerr";
246 } 247 }
247 } 248 }
248 249
249 void QuicClient::OnClose(QuicDataStream* stream) { 250 void QuicClient::OnClose(QuicDataStream* stream) {
250 QuicSpdyClientStream* client_stream = 251 QuicSpdyClientStream* client_stream =
251 static_cast<QuicSpdyClientStream*>(stream); 252 static_cast<QuicSpdyClientStream*>(stream);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 QuicEncryptedPacket packet(buf, bytes_read, false); 313 QuicEncryptedPacket packet(buf, bytes_read, false);
313 314
314 IPEndPoint client_address(client_ip, client_address_.port()); 315 IPEndPoint client_address(client_ip, client_address_.port());
315 session_->connection()->ProcessUdpPacket( 316 session_->connection()->ProcessUdpPacket(
316 client_address, server_address, packet); 317 client_address, server_address, packet);
317 return true; 318 return true;
318 } 319 }
319 320
320 } // namespace tools 321 } // namespace tools
321 } // namespace net 322 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/tools/quic/quic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698