| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ | 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ |
| 6 #define NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ | 6 #define NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // Sets a connection listener, that would be notified when various connection | 127 // Sets a connection listener, that would be notified when various connection |
| 128 // events happen. May only be called before the server is started. Caller | 128 // events happen. May only be called before the server is started. Caller |
| 129 // maintains ownership of the listener. | 129 // maintains ownership of the listener. |
| 130 void SetConnectionListener(EmbeddedTestServerConnectionListener* listener); | 130 void SetConnectionListener(EmbeddedTestServerConnectionListener* listener); |
| 131 | 131 |
| 132 // Initializes and waits until the server is ready to accept requests. | 132 // Initializes and waits until the server is ready to accept requests. |
| 133 // This is the equivalent of calling InitializeAndListen() followed by | 133 // This is the equivalent of calling InitializeAndListen() followed by |
| 134 // StartAcceptingConnections(). | 134 // StartAcceptingConnections(). |
| 135 // Returns whether a listening socket has been successfully created. | 135 // Returns whether a listening socket has been successfully created. |
| 136 bool Start(); | 136 bool Start() WARN_UNUSED_RESULT; |
| 137 | 137 |
| 138 // Starts listening for incoming connections but will not yet accept them. | 138 // Starts listening for incoming connections but will not yet accept them. |
| 139 // Returns whether a listening socket has been succesfully created. | 139 // Returns whether a listening socket has been succesfully created. |
| 140 bool InitializeAndListen() WARN_UNUSED_RESULT; | 140 bool InitializeAndListen() WARN_UNUSED_RESULT; |
| 141 | 141 |
| 142 // Starts the Accept IO Thread and begins accepting connections. | 142 // Starts the Accept IO Thread and begins accepting connections. |
| 143 void StartAcceptingConnections(); | 143 void StartAcceptingConnections(); |
| 144 | 144 |
| 145 // Shuts down the http server and waits until the shutdown is complete. | 145 // Shuts down the http server and waits until the shutdown is complete. |
| 146 bool ShutdownAndWaitUntilComplete() WARN_UNUSED_RESULT; | 146 bool ShutdownAndWaitUntilComplete() WARN_UNUSED_RESULT; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 } // namespace test_server | 292 } // namespace test_server |
| 293 | 293 |
| 294 // TODO(svaldez): Refactor EmbeddedTestServer to be in the net namespace. | 294 // TODO(svaldez): Refactor EmbeddedTestServer to be in the net namespace. |
| 295 using test_server::EmbeddedTestServer; | 295 using test_server::EmbeddedTestServer; |
| 296 | 296 |
| 297 } // namespace net | 297 } // namespace net |
| 298 | 298 |
| 299 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ | 299 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ |
| OLD | NEW |