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

Unified Diff: net/base/net_util.h

Issue 5519015: Explicitly whitelist the test server port. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add helper class for whitelisting. Created 10 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
Index: net/base/net_util.h
diff --git a/net/base/net_util.h b/net/base/net_util.h
index ad5795cdb3df8edcc9c3bd59dfd841f8ad81ddeb..9a2169a22328f89fc0c219ac3355b541c02ff033 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -71,7 +71,7 @@ extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname;
extern const FormatUrlType kFormatUrlOmitAll;
// Holds a list of ports that should be accepted despite bans.
-extern std::set<int> explicitly_allowed_ports;
+extern std::multiset<int> explicitly_allowed_ports;
// Given the full path to a file name, creates a file: URL. The returned URL
// may not be valid if the input is malformed.
@@ -338,6 +338,15 @@ GURL SimplifyUrlForRequest(const GURL& url);
void SetExplicitlyAllowedPorts(const std::string& allowed_ports);
+class ScopedPortException {
cbentzel 2010/12/09 14:25:13 DISALLOW_COPY_AND_ASSIGN
+ public:
+ ScopedPortException(int port);
+ ~ScopedPortException();
+
+ private:
+ int port_;
+};
+
// Perform a simplistic test to see if IPv6 is supported by trying to create an
// IPv6 socket.
// TODO(jar): Make test more in-depth as needed.

Powered by Google App Engine
This is Rietveld 408576698