| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 struct HttpRequest; | 31 struct HttpRequest; |
| 32 | 32 |
| 33 // This class is required to be able to have composition instead of inheritance, | 33 // This class is required to be able to have composition instead of inheritance, |
| 34 class HttpListenSocket : public TCPListenSocket { | 34 class HttpListenSocket : public TCPListenSocket { |
| 35 public: | 35 public: |
| 36 HttpListenSocket(const SocketDescriptor socket_descriptor, | 36 HttpListenSocket(const SocketDescriptor socket_descriptor, |
| 37 StreamListenSocket::Delegate* delegate); | 37 StreamListenSocket::Delegate* delegate); |
| 38 virtual ~HttpListenSocket(); | 38 virtual ~HttpListenSocket(); |
| 39 virtual void Listen(); | 39 virtual void Listen(); |
| 40 | 40 |
| 41 // Listen on the current IO thread. |
| 42 void ListenOnIOThread(); |
| 43 |
| 41 private: | 44 private: |
| 42 friend class EmbeddedTestServer; | 45 friend class EmbeddedTestServer; |
| 43 | 46 |
| 44 // Detaches the current from |thread_checker_|. | 47 // Detaches the current from |thread_checker_|. |
| 45 void DetachFromThread(); | 48 void DetachFromThread(); |
| 46 | 49 |
| 47 base::ThreadChecker thread_checker_; | 50 base::ThreadChecker thread_checker_; |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 // Class providing an HTTP server for testing purpose. This is a basic server | 53 // Class providing an HTTP server for testing purpose. This is a basic server |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 195 |
| 193 base::ThreadChecker thread_checker_; | 196 base::ThreadChecker thread_checker_; |
| 194 | 197 |
| 195 DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServer); | 198 DISALLOW_COPY_AND_ASSIGN(EmbeddedTestServer); |
| 196 }; | 199 }; |
| 197 | 200 |
| 198 } // namespace test_servers | 201 } // namespace test_servers |
| 199 } // namespace net | 202 } // namespace net |
| 200 | 203 |
| 201 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ | 204 #endif // NET_TEST_EMBEDDED_TEST_SERVER_EMBEDDED_TEST_SERVER_H_ |
| OLD | NEW |