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

Unified Diff: net/test/embedded_test_server/embedded_test_server.h

Issue 2562893002: Adds ScopedPortExceptions to EmbeddedTestServer. (Closed)
Patch Set: Created 4 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/test/embedded_test_server/embedded_test_server.h
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index f2a930727200068e3272cb5dec0a85448e50c215..80bc62d36e040b604624db3244ef6265b5f3d058 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -32,6 +32,7 @@
namespace net {
+class ScopedPortException;
class StreamSocket;
class TCPServerSocket;
@@ -177,6 +178,11 @@ class EmbeddedTestServer {
// Returns the port number used by the server.
uint16_t port() const { return port_; }
+ // If set to true, the port used by the server is added to the allowed ports
+ // exception list, which will let network requests succeed even if the port
+ // happens to be on the unsafe port list.
+ void SetPortExceptionEnabled(bool enabled);
+
void SetSSLConfig(ServerCertificate cert, const SSLServerConfig& ssl_config);
void SetSSLConfig(ServerCertificate cert);
@@ -281,6 +287,7 @@ class EmbeddedTestServer {
uint16_t port_;
GURL base_url_;
IPEndPoint local_endpoint_;
+ std::unique_ptr<ScopedPortException> port_exception_;
std::map<StreamSocket*, std::unique_ptr<HttpConnection>> connections_;
@@ -297,6 +304,7 @@ class EmbeddedTestServer {
base::WeakPtrFactory<EmbeddedTestServer> weak_factory_;
+
svaldez 2016/12/09 15:26:53 Stray?
rohitrao (ping after 24h) 2016/12/09 16:08:53 Done.
DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServer);
};

Powered by Google App Engine
This is Rietveld 408576698