OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 DCHECK(certificates_dir_.empty()); | 475 DCHECK(certificates_dir_.empty()); |
476 document_root_ = document_root; | 476 document_root_ = document_root; |
477 certificates_dir_ = certificates_dir; | 477 certificates_dir_ = certificates_dir; |
478 DCHECK(!certificates_dir_.empty()); | 478 DCHECK(!certificates_dir_.empty()); |
479 } | 479 } |
480 | 480 |
481 bool BaseTestServer::ParseServerData(const std::string& server_data) { | 481 bool BaseTestServer::ParseServerData(const std::string& server_data) { |
482 VLOG(1) << "Server data: " << server_data; | 482 VLOG(1) << "Server data: " << server_data; |
483 base::JSONReader json_reader; | 483 base::JSONReader json_reader; |
484 std::unique_ptr<base::Value> value(json_reader.ReadToValue(server_data)); | 484 std::unique_ptr<base::Value> value(json_reader.ReadToValue(server_data)); |
485 if (!value.get() || !value->IsType(base::Value::TYPE_DICTIONARY)) { | 485 if (!value.get() || !value->IsType(base::Value::Type::DICTIONARY)) { |
486 LOG(ERROR) << "Could not parse server data: " | 486 LOG(ERROR) << "Could not parse server data: " |
487 << json_reader.GetErrorMessage(); | 487 << json_reader.GetErrorMessage(); |
488 return false; | 488 return false; |
489 } | 489 } |
490 | 490 |
491 server_data_.reset(static_cast<base::DictionaryValue*>(value.release())); | 491 server_data_.reset(static_cast<base::DictionaryValue*>(value.release())); |
492 int port = 0; | 492 int port = 0; |
493 if (!server_data_->GetInteger("port", &port)) { | 493 if (!server_data_->GetInteger("port", &port)) { |
494 LOG(ERROR) << "Could not find port value"; | 494 LOG(ERROR) << "Could not find port value"; |
495 return false; | 495 return false; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 | 678 |
679 return GenerateAdditionalArguments(arguments); | 679 return GenerateAdditionalArguments(arguments); |
680 } | 680 } |
681 | 681 |
682 bool BaseTestServer::GenerateAdditionalArguments( | 682 bool BaseTestServer::GenerateAdditionalArguments( |
683 base::DictionaryValue* arguments) const { | 683 base::DictionaryValue* arguments) const { |
684 return true; | 684 return true; |
685 } | 685 } |
686 | 686 |
687 } // namespace net | 687 } // namespace net |
OLD | NEW |