| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 // The most general purpose method. Any request processing can be added using | 205 // The most general purpose method. Any request processing can be added using |
| 206 // this method. Takes ownership of the object. The |callback| is called | 206 // this method. Takes ownership of the object. The |callback| is called |
| 207 // on UI thread. | 207 // on UI thread. |
| 208 void RegisterRequestHandler(const HandleRequestCallback& callback); | 208 void RegisterRequestHandler(const HandleRequestCallback& callback); |
| 209 | 209 |
| 210 // Adds default handlers, including those added by AddDefaultHandlers, to be | 210 // Adds default handlers, including those added by AddDefaultHandlers, to be |
| 211 // tried after all other user-specified handlers have been tried. | 211 // tried after all other user-specified handlers have been tried. |
| 212 void RegisterDefaultHandler(const HandleRequestCallback& callback); | 212 void RegisterDefaultHandler(const HandleRequestCallback& callback); |
| 213 | 213 |
| 214 bool FlushAllSocketsAndConnectionsOnUIThread(); |
| 215 void FlushAllSocketsAndConnections(); |
| 216 |
| 214 private: | 217 private: |
| 215 // Shuts down the server. | 218 // Shuts down the server. |
| 216 void ShutdownOnIOThread(); | 219 void ShutdownOnIOThread(); |
| 217 | 220 |
| 218 // Upgrade the TCP connection to one over SSL. | 221 // Upgrade the TCP connection to one over SSL. |
| 219 std::unique_ptr<StreamSocket> DoSSLUpgrade( | 222 std::unique_ptr<StreamSocket> DoSSLUpgrade( |
| 220 std::unique_ptr<StreamSocket> connection); | 223 std::unique_ptr<StreamSocket> connection); |
| 221 // Handles async callback when the SSL handshake has been completed. | 224 // Handles async callback when the SSL handshake has been completed. |
| 222 void OnHandshakeDone(HttpConnection* connection, int rv); | 225 void OnHandshakeDone(HttpConnection* connection, int rv); |
| 223 | 226 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 }; | 290 }; |
| 288 | 291 |
| 289 } // namespace test_server | 292 } // namespace test_server |
| 290 | 293 |
| 291 // TODO(svaldez): Refactor EmbeddedTestServer to be in the net namespace. | 294 // TODO(svaldez): Refactor EmbeddedTestServer to be in the net namespace. |
| 292 using test_server::EmbeddedTestServer; | 295 using test_server::EmbeddedTestServer; |
| 293 | 296 |
| 294 } // namespace net | 297 } // namespace net |
| 295 | 298 |
| 296 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ | 299 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ |
| OLD | NEW |