| OLD | NEW |
| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (!base::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 = base::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()); |
| 490 if (write_result != static_cast<int>(dummy_file_content.size())) { | 490 if (write_result != static_cast<int>(dummy_file_content.size())) { |
| 491 DLOG(ERROR) << "Failed to put a dummy file at " | 491 DLOG(ERROR) << "Failed to put a dummy file at " |
| 492 << dummy_file_path.value(); | 492 << dummy_file_path.value(); |
| 493 return MOUNT_ERROR_MOUNT_PROGRAM_FAILED; | 493 return MOUNT_ERROR_MOUNT_PROGRAM_FAILED; |
| 494 } | 494 } |
| 495 | 495 |
| 496 return MOUNT_ERROR_NONE; | 496 return MOUNT_ERROR_NONE; |
| 497 } | 497 } |
| 498 | 498 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |