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

Side by Side Diff: chromeos/dbus/cros_disks_client.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 "chromeos/dbus/cros_disks_client.h" 5 #include "chromeos/dbus/cros_disks_client.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 // Performs file actions for Mount(). 469 // Performs file actions for Mount().
470 static MountError PerformFakeMount(const std::string& source_path, 470 static MountError PerformFakeMount(const std::string& source_path,
471 const base::FilePath& mounted_path) { 471 const base::FilePath& mounted_path) {
472 // Check the source path exists. 472 // Check the source path exists.
473 if (!base::PathExists(base::FilePath::FromUTF8Unsafe(source_path))) { 473 if (!base::PathExists(base::FilePath::FromUTF8Unsafe(source_path))) {
474 DLOG(ERROR) << "Source does not exist at " << source_path; 474 DLOG(ERROR) << "Source does not exist at " << source_path;
475 return MOUNT_ERROR_INVALID_PATH; 475 return MOUNT_ERROR_INVALID_PATH;
476 } 476 }
477 477
478 // Just create an empty directory and shows it as the mounted directory. 478 // Just create an empty directory and shows it as the mounted directory.
479 if (!file_util::CreateDirectory(mounted_path)) { 479 if (!base::CreateDirectory(mounted_path)) {
480 DLOG(ERROR) << "Failed to create directory at " << mounted_path.value(); 480 DLOG(ERROR) << "Failed to create directory at " << mounted_path.value();
481 return MOUNT_ERROR_DIRECTORY_CREATION_FAILED; 481 return MOUNT_ERROR_DIRECTORY_CREATION_FAILED;
482 } 482 }
483 483
484 // Put a dummy file. 484 // Put a dummy file.
485 const base::FilePath dummy_file_path = 485 const base::FilePath dummy_file_path =
486 mounted_path.Append("SUCCESSFULLY_PERFORMED_FAKE_MOUNT.txt"); 486 mounted_path.Append("SUCCESSFULLY_PERFORMED_FAKE_MOUNT.txt");
487 const std::string dummy_file_content = "This is a dummy file."; 487 const std::string dummy_file_content = "This is a dummy file.";
488 const int write_result = file_util::WriteFile( 488 const int write_result = file_util::WriteFile(
489 dummy_file_path, dummy_file_content.data(), dummy_file_content.size()); 489 dummy_file_path, dummy_file_content.data(), dummy_file_content.size());
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 } 728 }
729 729
730 // static 730 // static
731 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { 731 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() {
732 return base::FilePath(base::SysInfo::IsRunningOnChromeOS() ? 732 return base::FilePath(base::SysInfo::IsRunningOnChromeOS() ?
733 FILE_PATH_LITERAL("/media/removable") : 733 FILE_PATH_LITERAL("/media/removable") :
734 FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); 734 FILE_PATH_LITERAL("/tmp/chromeos/media/removable"));
735 } 735 }
736 736
737 } // namespace chromeos 737 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome_frame/test/dll_redirector_loading_test.cc ('k') | chromeos/dbus/session_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698