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

Unified Diff: net/test/spawned_test_server/spawner_communicator.cc

Issue 1475803002: Remove kuint16max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint2
Patch Set: cloud print Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/spawned_test_server/spawner_communicator.h ('k') | net/tools/dns_fuzz_stub/dns_fuzz_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/spawner_communicator.cc
diff --git a/net/test/spawned_test_server/spawner_communicator.cc b/net/test/spawned_test_server/spawner_communicator.cc
index 9a96d3c78abc06d3286eaa98bbea194d426289be..0962143bfe136d2e4d7103a1263a9e03c9cde7f5 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;
}
« no previous file with comments | « net/test/spawned_test_server/spawner_communicator.h ('k') | net/tools/dns_fuzz_stub/dns_fuzz_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698