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

Side by Side Diff: net/tools/quic/quic_simple_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: Sync'd to revision p349162. Created 5 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 | « net/tools/quic/quic_client_bin.cc ('k') | net/url_request/url_fetcher_impl_unittest.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 // 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.clear(); 211 versions.clear();
212 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); 212 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version));
213 } 213 }
214 net::tools::QuicSimpleClient client(net::IPEndPoint(ip_addr, FLAGS_port), 214 net::tools::QuicSimpleClient client(net::IPEndPoint(ip_addr, FLAGS_port),
215 server_id, versions); 215 server_id, versions);
216 scoped_ptr<CertVerifier> cert_verifier; 216 scoped_ptr<CertVerifier> cert_verifier;
217 scoped_ptr<TransportSecurityState> transport_security_state; 217 scoped_ptr<TransportSecurityState> transport_security_state;
218 client.set_initial_max_packet_length( 218 client.set_initial_max_packet_length(
219 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize); 219 FLAGS_initial_mtu != 0 ? FLAGS_initial_mtu : net::kDefaultMaxPacketSize);
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 if (!client.Initialize()) { 225 if (!client.Initialize()) {
226 cerr << "Failed to initialize client." << endl; 226 cerr << "Failed to initialize client." << endl;
227 return 1; 227 return 1;
228 } 228 }
229 if (!client.Connect()) { 229 if (!client.Connect()) {
230 net::QuicErrorCode error = client.session()->error(); 230 net::QuicErrorCode error = client.session()->error();
231 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) { 231 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) {
(...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
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/url_request/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698