OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "tools/android/forwarder2/forwarders_manager.h" | 5 #include "tools/android/forwarder2/forwarders_manager.h" |
6 | 6 |
7 #include <sys/select.h> | 7 #include <sys/select.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/message_loop/message_loop_proxy.h" | |
18 #include "base/posix/eintr_wrapper.h" | 17 #include "base/posix/eintr_wrapper.h" |
19 #include "tools/android/forwarder2/forwarder.h" | 18 #include "tools/android/forwarder2/forwarder.h" |
20 #include "tools/android/forwarder2/socket.h" | 19 #include "tools/android/forwarder2/socket.h" |
21 | 20 |
22 namespace forwarder2 { | 21 namespace forwarder2 { |
23 | 22 |
24 ForwardersManager::ForwardersManager() : thread_("ForwardersManagerThread") { | 23 ForwardersManager::ForwardersManager() : thread_("ForwardersManagerThread") { |
25 thread_.Start(); | 24 thread_.Start(); |
26 WaitForEventsOnInternalThreadSoon(); | 25 WaitForEventsOnInternalThreadSoon(); |
27 } | 26 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ++i; | 122 ++i; |
124 continue; | 123 continue; |
125 } | 124 } |
126 | 125 |
127 std::swap(forwarders_[i], forwarders_.back()); | 126 std::swap(forwarders_[i], forwarders_.back()); |
128 forwarders_.pop_back(); | 127 forwarders_.pop_back(); |
129 } | 128 } |
130 } | 129 } |
131 | 130 |
132 } // namespace forwarder2 | 131 } // namespace forwarder2 |
OLD | NEW |