| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/embedded_test_server/embedded_test_server.h" | 5 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 HttpListenSocket::~HttpListenSocket() { | 109 HttpListenSocket::~HttpListenSocket() { |
| 110 DCHECK(thread_checker_.CalledOnValidThread()); | 110 DCHECK(thread_checker_.CalledOnValidThread()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void HttpListenSocket::DetachFromThread() { | 113 void HttpListenSocket::DetachFromThread() { |
| 114 thread_checker_.DetachFromThread(); | 114 thread_checker_.DetachFromThread(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 EmbeddedTestServer::EmbeddedTestServer() | 117 EmbeddedTestServer::EmbeddedTestServer() |
| 118 : port_(-1), | 118 : port_(0), |
| 119 weak_factory_(this) { | 119 weak_factory_(this) { |
| 120 DCHECK(thread_checker_.CalledOnValidThread()); | 120 DCHECK(thread_checker_.CalledOnValidThread()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 EmbeddedTestServer::~EmbeddedTestServer() { | 123 EmbeddedTestServer::~EmbeddedTestServer() { |
| 124 DCHECK(thread_checker_.CalledOnValidThread()); | 124 DCHECK(thread_checker_.CalledOnValidThread()); |
| 125 | 125 |
| 126 if (Started() && !ShutdownAndWaitUntilComplete()) { | 126 if (Started() && !ShutdownAndWaitUntilComplete()) { |
| 127 LOG(ERROR) << "EmbeddedTestServer failed to shut down."; | 127 LOG(ERROR) << "EmbeddedTestServer failed to shut down."; |
| 128 } | 128 } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 FROM_HERE, closure, run_loop.QuitClosure())) { | 346 FROM_HERE, closure, run_loop.QuitClosure())) { |
| 347 return false; | 347 return false; |
| 348 } | 348 } |
| 349 run_loop.Run(); | 349 run_loop.Run(); |
| 350 | 350 |
| 351 return true; | 351 return true; |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace test_server | 354 } // namespace test_server |
| 355 } // namespace net | 355 } // namespace net |
| OLD | NEW |