| 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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void TestHttpServer::SetMessageAction(WebSocketMessageAction action) { | 68 void TestHttpServer::SetMessageAction(WebSocketMessageAction action) { |
| 69 base::AutoLock lock(action_lock_); | 69 base::AutoLock lock(action_lock_); |
| 70 message_action_ = action; | 70 message_action_ = action; |
| 71 } | 71 } |
| 72 | 72 |
| 73 GURL TestHttpServer::web_socket_url() const { | 73 GURL TestHttpServer::web_socket_url() const { |
| 74 base::AutoLock lock(url_lock_); | 74 base::AutoLock lock(url_lock_); |
| 75 return web_socket_url_; | 75 return web_socket_url_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void TestHttpServer::OnHttpRequest( | 78 void TestHttpServer::OnConnect(int connection_id) { |
| 79 int connection_id, | |
| 80 const net::HttpServerRequestInfo& info) { | |
| 81 server_->SetSendBufferSize(connection_id, kBufferSize); | 79 server_->SetSendBufferSize(connection_id, kBufferSize); |
| 82 server_->SetReceiveBufferSize(connection_id, kBufferSize); | 80 server_->SetReceiveBufferSize(connection_id, kBufferSize); |
| 83 } | 81 } |
| 84 | 82 |
| 85 void TestHttpServer::OnWebSocketRequest( | 83 void TestHttpServer::OnWebSocketRequest( |
| 86 int connection_id, | 84 int connection_id, |
| 87 const net::HttpServerRequestInfo& info) { | 85 const net::HttpServerRequestInfo& info) { |
| 88 server_->SetSendBufferSize(connection_id, kBufferSize); | 86 server_->SetSendBufferSize(connection_id, kBufferSize); |
| 89 server_->SetReceiveBufferSize(connection_id, kBufferSize); | 87 server_->SetReceiveBufferSize(connection_id, kBufferSize); |
| 90 | 88 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 server_.reset(NULL); | 150 server_.reset(NULL); |
| 153 } | 151 } |
| 154 *success = server_.get(); | 152 *success = server_.get(); |
| 155 event->Signal(); | 153 event->Signal(); |
| 156 } | 154 } |
| 157 | 155 |
| 158 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { | 156 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { |
| 159 server_.reset(NULL); | 157 server_.reset(NULL); |
| 160 event->Signal(); | 158 event->Signal(); |
| 161 } | 159 } |
| OLD | NEW |