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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 718273002: Use uint16 for port numbers, net/ edition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 6 years, 1 month 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
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 794030d8a531ee7148257c97c99db85baf8e6850..58876f39348e0d8b91d4ba2e40550096d5b7bc09 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -419,7 +419,7 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
int port = 0;
if (!port_alternate_protocol_dict->GetIntegerWithoutPathExpansion(
"port", &port) ||
- (port > (1 << 16))) {
+ (port > std::numeric_limits<uint16>::max())) {
DVLOG(1) << "Malformed Alternate-Protocol server: " << server_str;
detected_corrupted_prefs = true;
continue;
@@ -448,9 +448,8 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread() {
continue;
}
- net::AlternateProtocolInfo port_alternate_protocol(port,
- protocol,
- probability);
+ net::AlternateProtocolInfo port_alternate_protocol(
+ static_cast<uint16>(port), protocol, probability);
mmenke 2014/11/18 21:06:39 Should include basictypes.h
Peter Kasting 2014/11/18 23:38:42 In this file's header file.
alternate_protocol_map->Put(server, port_alternate_protocol);
++count;
} while (false);

Powered by Google App Engine
This is Rietveld 408576698