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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Sets the action to perform when receiving a WebSocket connect request. | 54 // Sets the action to perform when receiving a WebSocket connect request. |
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 OnConnect(int connection_id) OVERRIDE; |
64 virtual void OnHttpRequest(int connection_id, | 65 virtual void OnHttpRequest(int connection_id, |
65 const net::HttpServerRequestInfo& info) OVERRIDE; | 66 const net::HttpServerRequestInfo& info) OVERRIDE {} |
66 virtual void OnWebSocketRequest( | 67 virtual void OnWebSocketRequest( |
67 int connection_id, | 68 int connection_id, |
68 const net::HttpServerRequestInfo& info) OVERRIDE; | 69 const net::HttpServerRequestInfo& info) OVERRIDE; |
69 virtual void OnWebSocketMessage(int connection_id, | 70 virtual void OnWebSocketMessage(int connection_id, |
70 const std::string& data) OVERRIDE; | 71 const std::string& data) OVERRIDE; |
71 virtual void OnClose(int connection_id) OVERRIDE; | 72 virtual void OnClose(int connection_id) OVERRIDE; |
72 | 73 |
73 private: | 74 private: |
74 void StartOnServerThread(bool* success, base::WaitableEvent* event); | 75 void StartOnServerThread(bool* success, base::WaitableEvent* event); |
75 void StopOnServerThread(base::WaitableEvent* event); | 76 void StopOnServerThread(base::WaitableEvent* event); |
(...skipping 14 matching lines...) Expand all Loading... |
90 | 91 |
91 // Protects the action flags. | 92 // Protects the action flags. |
92 base::Lock action_lock_; | 93 base::Lock action_lock_; |
93 WebSocketRequestAction request_action_; | 94 WebSocketRequestAction request_action_; |
94 WebSocketMessageAction message_action_; | 95 WebSocketMessageAction message_action_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(TestHttpServer); | 97 DISALLOW_COPY_AND_ASSIGN(TestHttpServer); |
97 }; | 98 }; |
98 | 99 |
99 #endif // CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ | 100 #endif // CHROME_TEST_CHROMEDRIVER_NET_TEST_HTTP_SERVER_H_ |
OLD | NEW |