Create WebSocketTransportClientSocketPool
It is a variant of TransportClientSocketPool that performs RFC6455-style
connection throttling.
Design doc: https://docs.google.com/a/chromium.org/document/d/1a8sUFQsbN5uve7ziW61ATkrFr3o9A-Tiyw8ig6T3puA/edit
BUG=343107
Review URL: https://codereview.chromium.org/240873003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279524 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc
index bfa8980..60593f6 100644
--- a/net/websockets/websocket_test_util.cc
+++ b/net/websockets/websocket_test_util.cc
@@ -136,7 +136,7 @@
}
WebSocketTestURLRequestContextHost::WebSocketTestURLRequestContextHost()
- : url_request_context_(true) {
+ : url_request_context_(true), url_request_context_initialized_(false) {
url_request_context_.set_client_socket_factory(maker_.factory());
}
@@ -154,9 +154,12 @@
TestURLRequestContext*
WebSocketTestURLRequestContextHost::GetURLRequestContext() {
- url_request_context_.Init();
- // A Network Delegate is required to make the URLRequest::Delegate work.
- url_request_context_.set_network_delegate(&network_delegate_);
+ if (!url_request_context_initialized_) {
+ url_request_context_.Init();
+ // A Network Delegate is required to make the URLRequest::Delegate work.
+ url_request_context_.set_network_delegate(&network_delegate_);
+ url_request_context_initialized_ = true;
+ }
return &url_request_context_;
}