Chromium Code Reviews| Index: chrome/test/chromedriver/net/test_http_server.cc |
| diff --git a/chrome/test/chromedriver/net/test_http_server.cc b/chrome/test/chromedriver/net/test_http_server.cc |
| index b2780871d9dc4e456a9926f66c2a6d0fd5be4e66..1920e98c27d0fea9809c74d6cae2c1d8ef1edb64 100644 |
| --- a/chrome/test/chromedriver/net/test_http_server.cc |
| +++ b/chrome/test/chromedriver/net/test_http_server.cc |
| @@ -43,12 +43,15 @@ bool TestHttpServer::Start() { |
| } |
| void TestHttpServer::Stop() { |
| + if (!server_) |
|
kkania
2013/02/22 01:35:24
although net::HttpServer is ThreadSafeRefCounted,
chrisgao (Use stgao instead)
2013/02/27 19:29:44
Good catch.
The check is to avoid calling thread_
|
| + return; |
| base::WaitableEvent event(false, false); |
| thread_.message_loop_proxy()->PostTask( |
| FROM_HERE, |
| base::Bind(&TestHttpServer::StopOnServerThread, |
| base::Unretained(this), &event)); |
| event.Wait(); |
| + thread_.Stop(); |
| } |
| bool TestHttpServer::WaitForConnectionsToClose() { |