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

Side by Side Diff: net/websockets/websocket_test_util.cc

Issue 240873003: Create WebSocketTransportClientSocketPool (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fixes and comment tidying. Created 6 years, 7 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 unified diff | Download patch
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 SetRawExpectations(socket_data.Pass()); 120 SetRawExpectations(socket_data.Pass());
121 } 121 }
122 122
123 void WebSocketDeterministicMockClientSocketFactoryMaker::SetRawExpectations( 123 void WebSocketDeterministicMockClientSocketFactoryMaker::SetRawExpectations(
124 scoped_ptr<DeterministicSocketData> socket_data) { 124 scoped_ptr<DeterministicSocketData> socket_data) {
125 detail_->data = socket_data.Pass(); 125 detail_->data = socket_data.Pass();
126 detail_->factory.AddSocketDataProvider(detail_->data.get()); 126 detail_->factory.AddSocketDataProvider(detail_->data.get());
127 } 127 }
128 128
129 WebSocketTestURLRequestContextHost::WebSocketTestURLRequestContextHost() 129 WebSocketTestURLRequestContextHost::WebSocketTestURLRequestContextHost()
130 : url_request_context_(true) { 130 : url_request_context_(true), url_request_context_initialized_(false) {
131 url_request_context_.set_client_socket_factory(maker_.factory()); 131 url_request_context_.set_client_socket_factory(maker_.factory());
132 } 132 }
133 133
134 WebSocketTestURLRequestContextHost::~WebSocketTestURLRequestContextHost() {} 134 WebSocketTestURLRequestContextHost::~WebSocketTestURLRequestContextHost() {}
135 135
136 void WebSocketTestURLRequestContextHost::SetRawExpectations( 136 void WebSocketTestURLRequestContextHost::SetRawExpectations(
137 scoped_ptr<DeterministicSocketData> socket_data) { 137 scoped_ptr<DeterministicSocketData> socket_data) {
138 maker_.SetRawExpectations(socket_data.Pass()); 138 maker_.SetRawExpectations(socket_data.Pass());
139 } 139 }
140 140
141 TestURLRequestContext* 141 TestURLRequestContext*
142 WebSocketTestURLRequestContextHost::GetURLRequestContext() { 142 WebSocketTestURLRequestContextHost::GetURLRequestContext() {
143 url_request_context_.Init(); 143 if (!url_request_context_initialized_) {
144 // A Network Delegate is required to make the URLRequest::Delegate work. 144 url_request_context_.Init();
145 url_request_context_.set_network_delegate(&network_delegate_); 145 // A Network Delegate is required to make the URLRequest::Delegate work.
146 url_request_context_.set_network_delegate(&network_delegate_);
147 url_request_context_initialized_ = true;
148 }
146 return &url_request_context_; 149 return &url_request_context_;
147 } 150 }
148 151
149 } // namespace net 152 } // namespace net
OLDNEW
« net/socket/websocket_transport_client_socket_pool.cc ('K') | « net/websockets/websocket_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698