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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | « remoting/host/service_client.cc ('k') | remoting/host/setup/oauth_helper.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 "remoting/host/setup/daemon_controller.h" 5 #include "remoting/host/setup/daemon_controller.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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } else { 311 } else {
312 result = RESULT_FAILED; 312 result = RESULT_FAILED;
313 } 313 }
314 done_callback.Run(result); 314 done_callback.Run(result);
315 } 315 }
316 316
317 void DaemonControllerLinux::DoGetVersion( 317 void DaemonControllerLinux::DoGetVersion(
318 const GetVersionCallback& done_callback) { 318 const GetVersionCallback& done_callback) {
319 base::FilePath script_path; 319 base::FilePath script_path;
320 if (!GetScriptPath(&script_path)) { 320 if (!GetScriptPath(&script_path)) {
321 done_callback.Run(""); 321 done_callback.Run(std::string());
322 return; 322 return;
323 } 323 }
324 CommandLine command_line(script_path); 324 CommandLine command_line(script_path);
325 command_line.AppendArg("--host-version"); 325 command_line.AppendArg("--host-version");
326 326
327 std::string version; 327 std::string version;
328 int exit_code = 0; 328 int exit_code = 0;
329 int result = 329 int result =
330 base::GetAppOutputWithExitCode(command_line, &version, &exit_code); 330 base::GetAppOutputWithExitCode(command_line, &version, &exit_code);
331 if (!result || exit_code != 0) { 331 if (!result || exit_code != 0) {
332 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString() 332 LOG(ERROR) << "Failed to run \"" << command_line.GetCommandLineString()
333 << "\". Exit code: " << exit_code; 333 << "\". Exit code: " << exit_code;
334 done_callback.Run(""); 334 done_callback.Run(std::string());
335 return; 335 return;
336 } 336 }
337 337
338 TrimWhitespaceASCII(version, TRIM_ALL, &version); 338 TrimWhitespaceASCII(version, TRIM_ALL, &version);
339 if (!ContainsOnlyChars(version, "0123456789.")) { 339 if (!ContainsOnlyChars(version, "0123456789.")) {
340 LOG(ERROR) << "Received invalid host version number: " << version; 340 LOG(ERROR) << "Received invalid host version number: " << version;
341 done_callback.Run(""); 341 done_callback.Run(std::string());
342 return; 342 return;
343 } 343 }
344 344
345 done_callback.Run(version); 345 done_callback.Run(version);
346 } 346 }
347 347
348 } // namespace 348 } // namespace
349 349
350 scoped_ptr<DaemonController> remoting::DaemonController::Create() { 350 scoped_ptr<DaemonController> remoting::DaemonController::Create() {
351 return scoped_ptr<DaemonController>(new DaemonControllerLinux()); 351 return scoped_ptr<DaemonController>(new DaemonControllerLinux());
352 } 352 }
353 353
354 } // namespace remoting 354 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/service_client.cc ('k') | remoting/host/setup/oauth_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698