OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <windows.h> | 5 #include <windows.h> |
6 #include <objbase.h> | 6 #include <objbase.h> |
7 #include <urlmon.h> | 7 #include <urlmon.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 HTTPTestServer::HTTPTestServer(int port, const std::wstring& address, | 232 HTTPTestServer::HTTPTestServer(int port, const std::wstring& address, |
233 FilePath root_dir) | 233 FilePath root_dir) |
234 : port_(port), address_(address), root_dir_(root_dir) { | 234 : port_(port), address_(address), root_dir_(root_dir) { |
235 net::EnsureWinsockInit(); | 235 net::EnsureWinsockInit(); |
236 server_ = ListenSocket::Listen(WideToUTF8(address), port, this); | 236 server_ = ListenSocket::Listen(WideToUTF8(address), port, this); |
237 } | 237 } |
238 | 238 |
239 HTTPTestServer::~HTTPTestServer() { | 239 HTTPTestServer::~HTTPTestServer() { |
| 240 LOG(INFO) << __FUNCTION__; |
| 241 server_ = NULL; |
240 } | 242 } |
241 | 243 |
242 std::list<scoped_refptr<ConfigurableConnection>>::iterator | 244 std::list<scoped_refptr<ConfigurableConnection>>::iterator |
243 HTTPTestServer::FindConnection(const ListenSocket* socket) { | 245 HTTPTestServer::FindConnection(const ListenSocket* socket) { |
244 ConnectionList::iterator it; | 246 ConnectionList::iterator it; |
245 for (it = connection_list_.begin(); it != connection_list_.end(); ++it) { | 247 for (it = connection_list_.begin(); it != connection_list_.end(); ++it) { |
246 if ((*it)->socket_ == socket) { | 248 if ((*it)->socket_ == socket) { |
247 break; | 249 break; |
248 } | 250 } |
249 } | 251 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 data_.append(content_length_header); | 369 data_.append(content_length_header); |
368 data_.append("\r\n"); | 370 data_.append("\r\n"); |
369 } | 371 } |
370 | 372 |
371 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 373 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
372 NewRunnableMethod(this, &ConfigurableConnection::SendChunk), | 374 NewRunnableMethod(this, &ConfigurableConnection::SendChunk), |
373 options.timeout_); | 375 options.timeout_); |
374 } | 376 } |
375 | 377 |
376 } // namespace test_server | 378 } // namespace test_server |
OLD | NEW |