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

Unified Diff: net/base/net_util.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index b9cf59f1789a910bed6242794417f5592f0694f1..9dcf9dfccac8c82d4856c357ffc9b9c374c330f5 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <iterator>
+#include <limits>
#include <set>
#include "build/build_config.h"
@@ -294,6 +295,10 @@ base::string16 StripWWWFromHost(const GURL& url) {
return StripWWW(base::ASCIIToUTF16(url.host()));
}
+bool IsPortValid(int port) {
+ return port >= 0 && port <= std::numeric_limits<uint16>::max();
+}
+
bool IsPortAllowedByDefault(int port) {
int array_size = arraysize(kRestrictedPorts);
for (int i = 0; i < array_size; i++) {
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698