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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « net/url_request/url_fetcher_impl_unittest.cc ('k') | third_party/leveldatabase/env_chromium.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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 args, base::TimeDelta::FromSeconds(kSudoTimeoutSeconds), 248 args, base::TimeDelta::FromSeconds(kSudoTimeoutSeconds),
249 &exit_code) || 249 &exit_code) ||
250 exit_code != 0) { 250 exit_code != 0) {
251 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group."; 251 LOG(ERROR) << "Failed to add user to chrome-remote-desktop group.";
252 done_callback.Run(RESULT_FAILED); 252 done_callback.Run(RESULT_FAILED);
253 return; 253 return;
254 } 254 }
255 255
256 // Ensure the configuration directory exists. 256 // Ensure the configuration directory exists.
257 base::FilePath config_dir = GetConfigPath().DirName(); 257 base::FilePath config_dir = GetConfigPath().DirName();
258 if (!file_util::DirectoryExists(config_dir) && 258 if (!base::DirectoryExists(config_dir) &&
259 !file_util::CreateDirectory(config_dir)) { 259 !file_util::CreateDirectory(config_dir)) {
260 LOG(ERROR) << "Failed to create config directory " << config_dir.value(); 260 LOG(ERROR) << "Failed to create config directory " << config_dir.value();
261 done_callback.Run(RESULT_FAILED); 261 done_callback.Run(RESULT_FAILED);
262 return; 262 return;
263 } 263 }
264 264
265 // Write config. 265 // Write config.
266 JsonHostConfig config_file(GetConfigPath()); 266 JsonHostConfig config_file(GetConfigPath());
267 if (!config_file.CopyFrom(config.get()) || 267 if (!config_file.CopyFrom(config.get()) ||
268 !config_file.Save()) { 268 !config_file.Save()) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 done_callback.Run(version); 352 done_callback.Run(version);
353 } 353 }
354 354
355 } // namespace 355 } // namespace
356 356
357 scoped_ptr<DaemonController> remoting::DaemonController::Create() { 357 scoped_ptr<DaemonController> remoting::DaemonController::Create() {
358 return scoped_ptr<DaemonController>(new DaemonControllerLinux()); 358 return scoped_ptr<DaemonController>(new DaemonControllerLinux());
359 } 359 }
360 360
361 } // namespace remoting 361 } // namespace remoting
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher_impl_unittest.cc ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698