| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "net/websockets/websocket_test_util.h" | 5 #include "net/websockets/websocket_test_util.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" | 
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 157 } | 157 } | 
| 158 | 158 | 
| 159 void WebSocketTestURLRequestContextHost::AddSSLSocketDataProvider( | 159 void WebSocketTestURLRequestContextHost::AddSSLSocketDataProvider( | 
| 160     scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { | 160     scoped_ptr<SSLSocketDataProvider> ssl_socket_data) { | 
| 161   maker_.AddSSLSocketDataProvider(ssl_socket_data.Pass()); | 161   maker_.AddSSLSocketDataProvider(ssl_socket_data.Pass()); | 
| 162 } | 162 } | 
| 163 | 163 | 
| 164 void WebSocketTestURLRequestContextHost::SetProxyConfig( | 164 void WebSocketTestURLRequestContextHost::SetProxyConfig( | 
| 165     const std::string& proxy_rules) { | 165     const std::string& proxy_rules) { | 
| 166   DCHECK(!url_request_context_initialized_); | 166   DCHECK(!url_request_context_initialized_); | 
| 167   proxy_service_.reset(ProxyService::CreateFixed(proxy_rules)); | 167   proxy_service_ = ProxyService::CreateFixed(proxy_rules); | 
| 168   url_request_context_.set_proxy_service(proxy_service_.get()); | 168   url_request_context_.set_proxy_service(proxy_service_.get()); | 
| 169 } | 169 } | 
| 170 | 170 | 
| 171 TestURLRequestContext* | 171 TestURLRequestContext* | 
| 172 WebSocketTestURLRequestContextHost::GetURLRequestContext() { | 172 WebSocketTestURLRequestContextHost::GetURLRequestContext() { | 
| 173   if (!url_request_context_initialized_) { | 173   if (!url_request_context_initialized_) { | 
| 174     url_request_context_.Init(); | 174     url_request_context_.Init(); | 
| 175     // A Network Delegate is required to make the URLRequest::Delegate work. | 175     // A Network Delegate is required to make the URLRequest::Delegate work. | 
| 176     url_request_context_.set_network_delegate(&network_delegate_); | 176     url_request_context_.set_network_delegate(&network_delegate_); | 
| 177     url_request_context_initialized_ = true; | 177     url_request_context_initialized_ = true; | 
| 178   } | 178   } | 
| 179   return &url_request_context_; | 179   return &url_request_context_; | 
| 180 } | 180 } | 
| 181 | 181 | 
| 182 }  // namespace net | 182 }  // namespace net | 
| OLD | NEW | 
|---|