| 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 #ifndef CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void SetRequestAction(WebSocketRequestAction action); | 55 void SetRequestAction(WebSocketRequestAction action); |
| 56 | 56 |
| 57 // Sets the action to perform when receiving a WebSocket message. | 57 // Sets the action to perform when receiving a WebSocket message. |
| 58 void SetMessageAction(WebSocketMessageAction action); | 58 void SetMessageAction(WebSocketMessageAction action); |
| 59 | 59 |
| 60 // Returns the web socket URL that points to the server. | 60 // Returns the web socket URL that points to the server. |
| 61 GURL web_socket_url() const; | 61 GURL web_socket_url() const; |
| 62 | 62 |
| 63 // Overridden from net::HttpServer::Delegate: | 63 // Overridden from net::HttpServer::Delegate: |
| 64 virtual void OnHttpRequest(int connection_id, | 64 virtual void OnHttpRequest(int connection_id, |
| 65 const net::HttpServerRequestInfo& info) OVERRIDE {} | 65 const net::HttpServerRequestInfo& info) OVERRIDE; |
| 66 virtual void OnWebSocketRequest( | 66 virtual void OnWebSocketRequest( |
| 67 int connection_id, | 67 int connection_id, |
| 68 const net::HttpServerRequestInfo& info) OVERRIDE; | 68 const net::HttpServerRequestInfo& info) OVERRIDE; |
| 69 virtual void OnWebSocketMessage(int connection_id, | 69 virtual void OnWebSocketMessage(int connection_id, |
| 70 const std::string& data) OVERRIDE; | 70 const std::string& data) OVERRIDE; |
| 71 virtual void OnClose(int connection_id) OVERRIDE; | 71 virtual void OnClose(int connection_id) OVERRIDE; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 void StartOnServerThread(bool* success, base::WaitableEvent* event); | 74 void StartOnServerThread(bool* success, base::WaitableEvent* event); |
| 75 void StopOnServerThread(base::WaitableEvent* event); | 75 void StopOnServerThread(base::WaitableEvent* event); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 // Protects the action flags. | 91 // Protects the action flags. |
| 92 base::Lock action_lock_; | 92 base::Lock action_lock_; |
| 93 WebSocketRequestAction request_action_; | 93 WebSocketRequestAction request_action_; |
| 94 WebSocketMessageAction message_action_; | 94 WebSocketMessageAction message_action_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(TestHttpServer); | 96 DISALLOW_COPY_AND_ASSIGN(TestHttpServer); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 #endif // CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ | 99 #endif // CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ |
| OLD | NEW |