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

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

Issue 296513013: Cleanup: Use base::CommandLine in net/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 6 years, 7 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/net_watcher/net_watcher.cc ('k') | net/tools/quic/quic_client_bin.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 #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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (connected()) { 206 if (connected()) {
207 session()->connection()->SendConnectionClose(QUIC_PEER_GOING_AWAY); 207 session()->connection()->SendConnectionClose(QUIC_PEER_GOING_AWAY);
208 } 208 }
209 epoll_server_.UnregisterFD(fd_); 209 epoll_server_.UnregisterFD(fd_);
210 close(fd_); 210 close(fd_);
211 fd_ = -1; 211 fd_ = -1;
212 initialized_ = false; 212 initialized_ = false;
213 } 213 }
214 214
215 void QuicClient::SendRequestsAndWaitForResponse( 215 void QuicClient::SendRequestsAndWaitForResponse(
216 const CommandLine::StringVector& args) { 216 const base::CommandLine::StringVector& args) {
217 for (size_t i = 0; i < args.size(); ++i) { 217 for (size_t i = 0; i < args.size(); ++i) {
218 BalsaHeaders headers; 218 BalsaHeaders headers;
219 headers.SetRequestFirstlineFromStringPieces("GET", args[i], "HTTP/1.1"); 219 headers.SetRequestFirstlineFromStringPieces("GET", args[i], "HTTP/1.1");
220 QuicSpdyClientStream* stream = CreateReliableClientStream(); 220 QuicSpdyClientStream* stream = CreateReliableClientStream();
221 DCHECK(stream != NULL); 221 DCHECK(stream != NULL);
222 stream->SendRequest(headers, "", true); 222 stream->SendRequest(headers, "", true);
223 stream->set_visitor(this); 223 stream->set_visitor(this);
224 } 224 }
225 225
226 while (WaitForEvents()) { } 226 while (WaitForEvents()) { }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 QuicEncryptedPacket packet(buf, bytes_read, false); 346 QuicEncryptedPacket packet(buf, bytes_read, false);
347 347
348 IPEndPoint client_address(client_ip, client_address_.port()); 348 IPEndPoint client_address(client_ip, client_address_.port());
349 session_->connection()->ProcessUdpPacket( 349 session_->connection()->ProcessUdpPacket(
350 client_address, server_address, packet); 350 client_address, server_address, packet);
351 return true; 351 return true;
352 } 352 }
353 353
354 } // namespace tools 354 } // namespace tools
355 } // namespace net 355 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/net_watcher/net_watcher.cc ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698