| 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_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ | 5 #ifndef NET_TEST_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ |
| 6 #define NET_TEST_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ | 6 #define NET_TEST_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // on the remote machine. On Android, this port will be redirected to the | 123 // on the remote machine. On Android, this port will be redirected to the |
| 124 // same port on the host machine. | 124 // same port on the host machine. |
| 125 const uint16 port_; | 125 const uint16 port_; |
| 126 | 126 |
| 127 // Helper to add |port_| to the list of the globally explicitly allowed ports. | 127 // Helper to add |port_| to the list of the globally explicitly allowed ports. |
| 128 scoped_ptr<ScopedPortException> allowed_port_; | 128 scoped_ptr<ScopedPortException> allowed_port_; |
| 129 | 129 |
| 130 // The next ID to use for |cur_request_| (monotonically increasing). | 130 // The next ID to use for |cur_request_| (monotonically increasing). |
| 131 int next_id_; | 131 int next_id_; |
| 132 | 132 |
| 133 // Factory for creating the time-out task. This takes care of revoking | |
| 134 // outstanding tasks when |this| is deleted. | |
| 135 base::WeakPtrFactory<SpawnerCommunicator> weak_factory_; | |
| 136 | |
| 137 // Request context used by |cur_request_|. | 133 // Request context used by |cur_request_|. |
| 138 scoped_ptr<URLRequestContext> context_; | 134 scoped_ptr<URLRequestContext> context_; |
| 139 | 135 |
| 140 // The current (in progress) request, or NULL. | 136 // The current (in progress) request, or NULL. |
| 141 scoped_ptr<URLRequest> cur_request_; | 137 scoped_ptr<URLRequest> cur_request_; |
| 142 | 138 |
| 143 // Only gets/sets |is_running_| on user's thread to avoid race-condition. | 139 // Only gets/sets |is_running_| on user's thread to avoid race-condition. |
| 144 bool is_running_; | 140 bool is_running_; |
| 145 | 141 |
| 142 // Factory for creating the time-out task. This takes care of revoking |
| 143 // outstanding tasks when |this| is deleted. |
| 144 base::WeakPtrFactory<SpawnerCommunicator> weak_factory_; |
| 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(SpawnerCommunicator); | 146 DISALLOW_COPY_AND_ASSIGN(SpawnerCommunicator); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace net | 149 } // namespace net |
| 150 | 150 |
| 151 #endif // NET_TEST_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ | 151 #endif // NET_TEST_SPAWNED_TEST_SERVER_SPAWNER_COMMUNICATOR_H_ |
| OLD | NEW |