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

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

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Lots of fixes driven by try jobs. Created 5 years, 4 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
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 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, sends a request to the provided URL, and 6 // Connects to a host using QUIC, sends a request to the provided URL, and
7 // displays the response. 7 // displays the response.
8 // 8 //
9 // Some usage examples: 9 // Some usage examples:
10 // 10 //
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); 211 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version));
212 } 212 }
213 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id, 213 net::tools::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id,
214 versions, &epoll_server); 214 versions, &epoll_server);
215 scoped_ptr<CertVerifier> cert_verifier; 215 scoped_ptr<CertVerifier> cert_verifier;
216 scoped_ptr<TransportSecurityState> transport_security_state; 216 scoped_ptr<TransportSecurityState> transport_security_state;
217 client.set_initial_max_packet_length( 217 client.set_initial_max_packet_length(
218 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize); 218 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize);
219 if (is_https) { 219 if (is_https) {
220 // For secure QUIC we need to verify the cert chain. 220 // For secure QUIC we need to verify the cert chain.
221 cert_verifier.reset(CertVerifier::CreateDefault()); 221 cert_verifier = CertVerifier::CreateDefault();
222 transport_security_state.reset(new TransportSecurityState); 222 transport_security_state.reset(new TransportSecurityState);
223 client.SetProofVerifier(new ProofVerifierChromium( 223 client.SetProofVerifier(new ProofVerifierChromium(
224 cert_verifier.get(), nullptr, transport_security_state.get())); 224 cert_verifier.get(), nullptr, transport_security_state.get()));
225 } 225 }
226 if (!client.Initialize()) { 226 if (!client.Initialize()) {
227 cerr << "Failed to initialize client." << endl; 227 cerr << "Failed to initialize client." << endl;
228 return 1; 228 return 1;
229 } 229 }
230 if (!client.Connect()) { 230 if (!client.Connect()) {
231 net::QuicErrorCode error = client.session()->error(); 231 net::QuicErrorCode error = client.session()->error();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return 0; 298 return 0;
299 } else { 299 } else {
300 cout << "Request failed (redirect " << response_code << ")." << endl; 300 cout << "Request failed (redirect " << response_code << ")." << endl;
301 return 1; 301 return 1;
302 } 302 }
303 } else { 303 } else {
304 cerr << "Request failed (" << response_code << ")." << endl; 304 cerr << "Request failed (" << response_code << ")." << endl;
305 return 1; 305 return 1;
306 } 306 }
307 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698