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

Side by Side Diff: net/test/spawned_test_server/base_test_server.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/spawned_test_server/base_test_server.h" 5 #include "net/test/spawned_test_server/base_test_server.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (VLOG_IS_ON(1) || log_to_console_) 333 if (VLOG_IS_ON(1) || log_to_console_)
334 arguments->Set("log-to-console", base::Value::CreateNullValue()); 334 arguments->Set("log-to-console", base::Value::CreateNullValue());
335 335
336 if (UsingSSL(type_)) { 336 if (UsingSSL(type_)) {
337 // Check the certificate arguments of the HTTPS server. 337 // Check the certificate arguments of the HTTPS server.
338 base::FilePath certificate_path(certificates_dir_); 338 base::FilePath certificate_path(certificates_dir_);
339 base::FilePath certificate_file(ssl_options_.GetCertificateFile()); 339 base::FilePath certificate_file(ssl_options_.GetCertificateFile());
340 if (!certificate_file.value().empty()) { 340 if (!certificate_file.value().empty()) {
341 certificate_path = certificate_path.Append(certificate_file); 341 certificate_path = certificate_path.Append(certificate_file);
342 if (certificate_path.IsAbsolute() && 342 if (certificate_path.IsAbsolute() &&
343 !file_util::PathExists(certificate_path)) { 343 !base::PathExists(certificate_path)) {
344 LOG(ERROR) << "Certificate path " << certificate_path.value() 344 LOG(ERROR) << "Certificate path " << certificate_path.value()
345 << " doesn't exist. Can't launch https server."; 345 << " doesn't exist. Can't launch https server.";
346 return false; 346 return false;
347 } 347 }
348 arguments->SetString("cert-and-key-file", certificate_path.value()); 348 arguments->SetString("cert-and-key-file", certificate_path.value());
349 } 349 }
350 350
351 // Check the client certificate related arguments. 351 // Check the client certificate related arguments.
352 if (ssl_options_.request_client_certificate) 352 if (ssl_options_.request_client_certificate)
353 arguments->Set("ssl-client-auth", base::Value::CreateNullValue()); 353 arguments->Set("ssl-client-auth", base::Value::CreateNullValue());
354 scoped_ptr<base::ListValue> ssl_client_certs(new base::ListValue()); 354 scoped_ptr<base::ListValue> ssl_client_certs(new base::ListValue());
355 355
356 std::vector<base::FilePath>::const_iterator it; 356 std::vector<base::FilePath>::const_iterator it;
357 for (it = ssl_options_.client_authorities.begin(); 357 for (it = ssl_options_.client_authorities.begin();
358 it != ssl_options_.client_authorities.end(); ++it) { 358 it != ssl_options_.client_authorities.end(); ++it) {
359 if (it->IsAbsolute() && !file_util::PathExists(*it)) { 359 if (it->IsAbsolute() && !base::PathExists(*it)) {
360 LOG(ERROR) << "Client authority path " << it->value() 360 LOG(ERROR) << "Client authority path " << it->value()
361 << " doesn't exist. Can't launch https server."; 361 << " doesn't exist. Can't launch https server.";
362 return false; 362 return false;
363 } 363 }
364 ssl_client_certs->Append(new base::StringValue(it->value())); 364 ssl_client_certs->Append(new base::StringValue(it->value()));
365 } 365 }
366 366
367 if (ssl_client_certs->GetSize()) 367 if (ssl_client_certs->GetSize())
368 arguments->Set("ssl-client-ca", ssl_client_certs.release()); 368 arguments->Set("ssl-client-ca", ssl_client_certs.release());
369 } 369 }
(...skipping 20 matching lines...) Expand all
390 390
391 return GenerateAdditionalArguments(arguments); 391 return GenerateAdditionalArguments(arguments);
392 } 392 }
393 393
394 bool BaseTestServer::GenerateAdditionalArguments( 394 bool BaseTestServer::GenerateAdditionalArguments(
395 base::DictionaryValue* arguments) const { 395 base::DictionaryValue* arguments) const {
396 return true; 396 return true;
397 } 397 }
398 398
399 } // namespace net 399 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.cc ('k') | net/tools/crash_cache/crash_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698