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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
76 | 76 |
77 base::Thread thread_; | 77 base::Thread thread_; |
78 | 78 |
79 // Access only on the server thread. | 79 // Access only on the server thread. |
80 scoped_refptr<net::HttpServer> server_; | 80 scoped_ptr<net::HttpServer> server_; |
81 | 81 |
82 // Access only on the server thread. | 82 // Access only on the server thread. |
83 std::set<int> connections_; | 83 std::set<int> connections_; |
84 | 84 |
85 base::WaitableEvent all_closed_event_; | 85 base::WaitableEvent all_closed_event_; |
86 | 86 |
87 // Protects |web_socket_url_|. | 87 // Protects |web_socket_url_|. |
88 mutable base::Lock url_lock_; | 88 mutable base::Lock url_lock_; |
89 GURL web_socket_url_; | 89 GURL web_socket_url_; |
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 |