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_SPAWNER_COMMUNICATOR_H_ | 5 #ifndef NET_TEST_SPAWNER_COMMUNICATOR_H_ |
6 #define NET_TEST_SPAWNER_COMMUNICATOR_H_ | 6 #define NET_TEST_SPAWNER_COMMUNICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Method: "GET". | 55 // Method: "GET". |
56 // Data to server: None. | 56 // Data to server: None. |
57 // Data from server: String "ready" returned if success. | 57 // Data from server: String "ready" returned if success. |
58 // | 58 // |
59 // The internal I/O thread is required by net stack to perform net I/O. | 59 // The internal I/O thread is required by net stack to perform net I/O. |
60 // The Start/StopServer methods block the caller thread until result is | 60 // The Start/StopServer methods block the caller thread until result is |
61 // fetched from spawner server or timed-out. | 61 // fetched from spawner server or timed-out. |
62 class SpawnerCommunicator : public net::URLRequest::Delegate { | 62 class SpawnerCommunicator : public net::URLRequest::Delegate { |
63 public: | 63 public: |
64 explicit SpawnerCommunicator(uint16 port); | 64 explicit SpawnerCommunicator(uint16 port); |
65 ~SpawnerCommunicator(); | 65 virtual ~SpawnerCommunicator(); |
66 | 66 |
67 // Starts an instance of the Python test server on the host/ machine. | 67 // Starts an instance of the Python test server on the host/ machine. |
68 // If successfully started, returns true, setting |*port| to the port | 68 // If successfully started, returns true, setting |*port| to the port |
69 // on the local machine that can be used to communicate with the remote | 69 // on the local machine that can be used to communicate with the remote |
70 // test server. | 70 // test server. |
71 bool StartServer(const std::string& arguments, | 71 bool StartServer(const std::string& arguments, |
72 uint16* port) WARN_UNUSED_RESULT; | 72 uint16* port) WARN_UNUSED_RESULT; |
73 | 73 |
74 bool StopServer() WARN_UNUSED_RESULT; | 74 bool StopServer() WARN_UNUSED_RESULT; |
75 | 75 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Only gets/sets |is_running_| on user's thread to avoid race-condition. | 141 // Only gets/sets |is_running_| on user's thread to avoid race-condition. |
142 bool is_running_; | 142 bool is_running_; |
143 | 143 |
144 DISALLOW_COPY_AND_ASSIGN(SpawnerCommunicator); | 144 DISALLOW_COPY_AND_ASSIGN(SpawnerCommunicator); |
145 }; | 145 }; |
146 | 146 |
147 } // namespace net | 147 } // namespace net |
148 | 148 |
149 #endif // NET_TEST_SPAWNER_COMMUNICATOR_H_ | 149 #endif // NET_TEST_SPAWNER_COMMUNICATOR_H_ |
150 | 150 |
OLD | NEW |