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

Unified Diff: net/websockets/websocket_test_util.cc

Issue 240873003: Create WebSocketTransportClientSocketPool (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 months 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/websockets/websocket_test_util.cc
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc
index bfa8980344775b3ab1c37aeaf0aa4f5a9bc6cadb..60593f61fa5e65969ddc83b3ae4abfb302d93c65 100644
--- a/net/websockets/websocket_test_util.cc
+++ b/net/websockets/websocket_test_util.cc
@@ -136,7 +136,7 @@ WebSocketDeterministicMockClientSocketFactoryMaker::AddSSLSocketDataProvider(
}
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 @@ void WebSocketTestURLRequestContextHost::AddSSLSocketDataProvider(
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_;
}

Powered by Google App Engine
This is Rietveld 408576698