diff options
Diffstat (limited to 'net/test/spawned_test_server/spawner_communicator.cc')
-rw-r--r-- | net/test/spawned_test_server/spawner_communicator.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/test/spawned_test_server/spawner_communicator.cc b/net/test/spawned_test_server/spawner_communicator.cc index 9a96d3c..0962143 100644 --- a/net/test/spawned_test_server/spawner_communicator.cc +++ b/net/test/spawned_test_server/spawner_communicator.cc @@ -4,6 +4,8 @@ #include "net/test/spawned_test_server/spawner_communicator.h" +#include <limits> + #include "base/json/json_reader.h" #include "base/logging.h" #include "base/strings/stringprintf.h" @@ -24,7 +26,7 @@ namespace net { namespace { -GURL GenerateSpawnerCommandURL(const std::string& command, uint16 port) { +GURL GenerateSpawnerCommandURL(const std::string& command, uint16_t port) { // Always performs HTTP request for sending command to the spawner server. return GURL(base::StringPrintf("%s:%u/%s", "http://127.0.0.1", port, command.c_str())); @@ -98,7 +100,7 @@ class SpawnerRequestData : public base::SupportsUserData::Data { } // namespace -SpawnerCommunicator::SpawnerCommunicator(uint16 port) +SpawnerCommunicator::SpawnerCommunicator(uint16_t port) : io_thread_("spawner_communicator"), event_(false, false), port_(port), @@ -324,7 +326,7 @@ void SpawnerCommunicator::OnReadCompleted(URLRequest* request, int num_bytes) { } bool SpawnerCommunicator::StartServer(const std::string& arguments, - uint16* port) { + uint16_t* port) { *port = 0; // Send the start command to spawner server to start the Python test server // on remote machine. @@ -352,11 +354,11 @@ bool SpawnerCommunicator::StartServer(const std::string& arguments, } int int_port; if (!server_data->GetInteger("port", &int_port) || int_port <= 0 || - int_port > kuint16max) { + int_port > std::numeric_limits<uint16_t>::max()) { LOG(ERROR) << "Invalid port value: " << int_port; return false; } - *port = static_cast<uint16>(int_port); + *port = static_cast<uint16_t>(int_port); return true; } |