Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: tools/android/forwarder2/forwarders_manager.cc

Issue 684133002: [Android] Fix gn build for instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Follow review Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/android/forwarder2/forwarder.gyp ('k') | tools/android/forwarder2/host_forwarder_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 it != forwarders_.end(); ++it) { 74 it != forwarders_.end(); ++it) {
75 Forwarder* const forwarder = *it; 75 Forwarder* const forwarder = *it;
76 forwarder->RegisterFDs(&read_fds, &write_fds, &max_fd); 76 forwarder->RegisterFDs(&read_fds, &write_fds, &max_fd);
77 } 77 }
78 78
79 const int notifier_fds[] = { 79 const int notifier_fds[] = {
80 wakeup_notifier_.receiver_fd(), 80 wakeup_notifier_.receiver_fd(),
81 deletion_notifier_.receiver_fd(), 81 deletion_notifier_.receiver_fd(),
82 }; 82 };
83 83
84 for (int i = 0; i < arraysize(notifier_fds); ++i) { 84 for (size_t i = 0; i < arraysize(notifier_fds); ++i) {
85 const int notifier_fd = notifier_fds[i]; 85 const int notifier_fd = notifier_fds[i];
86 DCHECK_GT(notifier_fd, -1); 86 DCHECK_GT(notifier_fd, -1);
87 FD_SET(notifier_fd, &read_fds); 87 FD_SET(notifier_fd, &read_fds);
88 max_fd = std::max(max_fd, notifier_fd); 88 max_fd = std::max(max_fd, notifier_fd);
89 } 89 }
90 90
91 const int ret = HANDLE_EINTR( 91 const int ret = HANDLE_EINTR(
92 select(max_fd + 1, &read_fds, &write_fds, NULL, NULL)); 92 select(max_fd + 1, &read_fds, &write_fds, NULL, NULL));
93 if (ret < 0) { 93 if (ret < 0) {
94 PLOG(ERROR) << "select"; 94 PLOG(ERROR) << "select";
(...skipping 28 matching lines...) Expand all
123 ++i; 123 ++i;
124 continue; 124 continue;
125 } 125 }
126 126
127 std::swap(forwarders_[i], forwarders_.back()); 127 std::swap(forwarders_[i], forwarders_.back());
128 forwarders_.pop_back(); 128 forwarders_.pop_back();
129 } 129 }
130 } 130 }
131 131
132 } // namespace forwarder2 132 } // namespace forwarder2
OLDNEW
« no previous file with comments | « tools/android/forwarder2/forwarder.gyp ('k') | tools/android/forwarder2/host_forwarder_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698