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