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

Side by Side Diff: tools/android/forwarder2/device_forwarder_main.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/daemon.cc ('k') | tools/android/forwarder2/forwarder.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 (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 #include <signal.h> 5 #include <signal.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <iostream> 8 #include <iostream>
9 #include <string> 9 #include <string>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ClientDelegate() : has_failed_(false) {} 117 ClientDelegate() : has_failed_(false) {}
118 118
119 bool has_failed() const { return has_failed_; } 119 bool has_failed() const { return has_failed_; }
120 120
121 // Daemon::ClientDelegate: 121 // Daemon::ClientDelegate:
122 virtual void OnDaemonReady(Socket* daemon_socket) override { 122 virtual void OnDaemonReady(Socket* daemon_socket) override {
123 char buf[kBufSize]; 123 char buf[kBufSize];
124 const int bytes_read = daemon_socket->Read( 124 const int bytes_read = daemon_socket->Read(
125 buf, sizeof(buf) - 1 /* leave space for null terminator */); 125 buf, sizeof(buf) - 1 /* leave space for null terminator */);
126 CHECK_GT(bytes_read, 0); 126 CHECK_GT(bytes_read, 0);
127 DCHECK(bytes_read < sizeof(buf)); 127 DCHECK(static_cast<unsigned int>(bytes_read) < sizeof(buf));
128 buf[bytes_read] = 0; 128 buf[bytes_read] = 0;
129 base::StringPiece msg(buf, bytes_read); 129 base::StringPiece msg(buf, bytes_read);
130 if (msg.starts_with("ERROR")) { 130 if (msg.starts_with("ERROR")) {
131 LOG(ERROR) << msg; 131 LOG(ERROR) << msg;
132 has_failed_ = true; 132 has_failed_ = true;
133 return; 133 return;
134 } 134 }
135 } 135 }
136 136
137 private: 137 private:
(...skipping 22 matching lines...) Expand all
160 return 1; 160 return 1;
161 return client_delegate.has_failed(); 161 return client_delegate.has_failed();
162 } 162 }
163 163
164 } // namespace 164 } // namespace
165 } // namespace forwarder2 165 } // namespace forwarder2
166 166
167 int main(int argc, char** argv) { 167 int main(int argc, char** argv) {
168 return forwarder2::RunDeviceForwarder(argc, argv); 168 return forwarder2::RunDeviceForwarder(argc, argv);
169 } 169 }
OLDNEW
« no previous file with comments | « tools/android/forwarder2/daemon.cc ('k') | tools/android/forwarder2/forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698