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

Side by Side Diff: net/test/test_server.cc

Issue 7056031: Collect stats to investigate the viability of UDP (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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/test/test_server.h ('k') | net/tools/testserver/testserver.py » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 std::string TestServer::GetScheme() const { 176 std::string TestServer::GetScheme() const {
177 switch (type_) { 177 switch (type_) {
178 case TYPE_FTP: 178 case TYPE_FTP:
179 return "ftp"; 179 return "ftp";
180 case TYPE_HTTP: 180 case TYPE_HTTP:
181 case TYPE_SYNC: 181 case TYPE_SYNC:
182 return "http"; 182 return "http";
183 case TYPE_HTTPS: 183 case TYPE_HTTPS:
184 return "https"; 184 return "https";
185 case TYPE_TCP_ECHO:
186 NOTREACHED();
187 case TYPE_UDP_ECHO:
188 NOTREACHED();
185 default: 189 default:
186 NOTREACHED(); 190 NOTREACHED();
187 } 191 }
188 return std::string(); 192 return std::string();
189 } 193 }
190 194
191 bool TestServer::GetAddressList(AddressList* address_list) const { 195 bool TestServer::GetAddressList(AddressList* address_list) const {
192 DCHECK(address_list); 196 DCHECK(address_list);
193 197
194 scoped_ptr<HostResolver> resolver( 198 scoped_ptr<HostResolver> resolver(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 document_root_.value()); 354 document_root_.value());
351 355
352 if (logging::GetMinLogLevel() == logging::LOG_VERBOSE) { 356 if (logging::GetMinLogLevel() == logging::LOG_VERBOSE) {
353 command_line->AppendArg("--log-to-console"); 357 command_line->AppendArg("--log-to-console");
354 } 358 }
355 359
356 if (type_ == TYPE_FTP) { 360 if (type_ == TYPE_FTP) {
357 command_line->AppendArg("-f"); 361 command_line->AppendArg("-f");
358 } else if (type_ == TYPE_SYNC) { 362 } else if (type_ == TYPE_SYNC) {
359 command_line->AppendArg("--sync"); 363 command_line->AppendArg("--sync");
364 } else if (type_ == TYPE_TCP_ECHO) {
365 command_line->AppendArg("--tcp-echo");
366 } else if (type_ == TYPE_UDP_ECHO) {
367 command_line->AppendArg("--udp-echo");
360 } else if (type_ == TYPE_HTTPS) { 368 } else if (type_ == TYPE_HTTPS) {
361 FilePath certificate_path(certificates_dir_); 369 FilePath certificate_path(certificates_dir_);
362 certificate_path = certificate_path.Append( 370 certificate_path = certificate_path.Append(
363 https_options_.GetCertificateFile()); 371 https_options_.GetCertificateFile());
364 if (!file_util::PathExists(certificate_path)) { 372 if (!file_util::PathExists(certificate_path)) {
365 LOG(ERROR) << "Certificate path " << certificate_path.value() 373 LOG(ERROR) << "Certificate path " << certificate_path.value()
366 << " doesn't exist. Can't launch https server."; 374 << " doesn't exist. Can't launch https server.";
367 return false; 375 return false;
368 } 376 }
369 command_line->AppendArgNative(FILE_PATH_LITERAL("--https=") + 377 command_line->AppendArgNative(FILE_PATH_LITERAL("--https=") +
(...skipping 23 matching lines...) Expand all
393 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) 401 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256)
394 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); 402 command_line->AppendArg(kBulkCipherSwitch + "=aes256");
395 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) 403 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES)
396 command_line->AppendArg(kBulkCipherSwitch + "=3des"); 404 command_line->AppendArg(kBulkCipherSwitch + "=3des");
397 } 405 }
398 406
399 return true; 407 return true;
400 } 408 }
401 409
402 } // namespace net 410 } // namespace net
OLDNEW
« no previous file with comments | « net/test/test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698