OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/test/chromedriver/net/test_http_server.h" | 5 #include "chrome/test/chromedriver/net/test_http_server.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 net::IPEndPoint address; | 134 net::IPEndPoint address; |
135 int error = server_->GetLocalAddress(&address); | 135 int error = server_->GetLocalAddress(&address); |
136 EXPECT_EQ(net::OK, error); | 136 EXPECT_EQ(net::OK, error); |
137 if (error == net::OK) { | 137 if (error == net::OK) { |
138 base::AutoLock lock(url_lock_); | 138 base::AutoLock lock(url_lock_); |
139 web_socket_url_ = GURL(base::StringPrintf("ws://127.0.0.1:%d", | 139 web_socket_url_ = GURL(base::StringPrintf("ws://127.0.0.1:%d", |
140 address.port())); | 140 address.port())); |
141 } else { | 141 } else { |
142 server_ = NULL; | 142 server_ = NULL; |
143 } | 143 } |
144 *success = server_; | 144 *success = server_.get(); |
145 event->Signal(); | 145 event->Signal(); |
146 } | 146 } |
147 | 147 |
148 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { | 148 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { |
149 if (server_) | 149 if (server_.get()) |
150 server_ = NULL; | 150 server_ = NULL; |
151 event->Signal(); | 151 event->Signal(); |
152 } | 152 } |
OLD | NEW |