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

Side by Side Diff: remoting/host/setup/daemon_controller_delegate_linux.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « printing/backend/cups_helper.cc ('k') | rlz/lib/rlz_lib.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 "remoting/host/setup/daemon_controller_delegate_linux.h" 5 #include "remoting/host/setup/daemon_controller_delegate_linux.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // the relevant UI in the web-app). 145 // the relevant UI in the web-app).
146 return DaemonController::STATE_NOT_IMPLEMENTED; 146 return DaemonController::STATE_NOT_IMPLEMENTED;
147 } 147 }
148 148
149 if (exit_code != 0) { 149 if (exit_code != 0) {
150 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString() 150 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString()
151 << "\". Exit code: " << exit_code; 151 << "\". Exit code: " << exit_code;
152 return DaemonController::STATE_UNKNOWN; 152 return DaemonController::STATE_UNKNOWN;
153 } 153 }
154 154
155 TrimWhitespaceASCII(status, TRIM_ALL, &status); 155 base::TrimWhitespaceASCII(status, base::TRIM_ALL, &status);
156 156
157 if (status == "STARTED") { 157 if (status == "STARTED") {
158 return DaemonController::STATE_STARTED; 158 return DaemonController::STATE_STARTED;
159 } else if (status == "STOPPED") { 159 } else if (status == "STOPPED") {
160 return DaemonController::STATE_STOPPED; 160 return DaemonController::STATE_STOPPED;
161 } else if (status == "NOT_IMPLEMENTED") { 161 } else if (status == "NOT_IMPLEMENTED") {
162 return DaemonController::STATE_NOT_IMPLEMENTED; 162 return DaemonController::STATE_NOT_IMPLEMENTED;
163 } else { 163 } else {
164 LOG(ERROR) << "Unknown status string returned from \"" 164 LOG(ERROR) << "Unknown status string returned from \""
165 << command_line.GetCommandLineString() 165 << command_line.GetCommandLineString()
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 std::string version; 283 std::string version;
284 int exit_code = 0; 284 int exit_code = 0;
285 int result = 285 int result =
286 base::GetAppOutputWithExitCode(command_line, &version, &exit_code); 286 base::GetAppOutputWithExitCode(command_line, &version, &exit_code);
287 if (!result || exit_code != 0) { 287 if (!result || exit_code != 0) {
288 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString() 288 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString()
289 << "\". Exit code: " << exit_code; 289 << "\". Exit code: " << exit_code;
290 return std::string(); 290 return std::string();
291 } 291 }
292 292
293 TrimWhitespaceASCII(version, TRIM_ALL, &version); 293 base::TrimWhitespaceASCII(version, base::TRIM_ALL, &version);
294 if (!ContainsOnlyChars(version, "0123456789.")) { 294 if (!ContainsOnlyChars(version, "0123456789.")) {
295 LOG(ERROR) << "Received invalid host version number: " << version; 295 LOG(ERROR) << "Received invalid host version number: " << version;
296 return std::string(); 296 return std::string();
297 } 297 }
298 298
299 return version; 299 return version;
300 } 300 }
301 301
302 DaemonController::UsageStatsConsent 302 DaemonController::UsageStatsConsent
303 DaemonControllerDelegateLinux::GetUsageStatsConsent() { 303 DaemonControllerDelegateLinux::GetUsageStatsConsent() {
304 // Crash dump collection is not implemented on Linux yet. 304 // Crash dump collection is not implemented on Linux yet.
305 // http://crbug.com/130678. 305 // http://crbug.com/130678.
306 DaemonController::UsageStatsConsent consent; 306 DaemonController::UsageStatsConsent consent;
307 consent.supported = false; 307 consent.supported = false;
308 consent.allowed = false; 308 consent.allowed = false;
309 consent.set_by_policy = false; 309 consent.set_by_policy = false;
310 return consent; 310 return consent;
311 } 311 }
312 312
313 scoped_refptr<DaemonController> DaemonController::Create() { 313 scoped_refptr<DaemonController> DaemonController::Create() {
314 scoped_ptr<DaemonController::Delegate> delegate( 314 scoped_ptr<DaemonController::Delegate> delegate(
315 new DaemonControllerDelegateLinux()); 315 new DaemonControllerDelegateLinux());
316 return new DaemonController(delegate.Pass()); 316 return new DaemonController(delegate.Pass());
317 } 317 }
318 318
319 } // namespace remoting 319 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/backend/cups_helper.cc ('k') | rlz/lib/rlz_lib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698