summaryrefslogtreecommitdiffstats
path: root/cloud_print
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-12 05:17:15 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-12 05:17:15 +0000
commit154769362a046967efd14bb0a0da5d6f3a301e32 (patch)
tree33e4550cd4f8895b639fabc55b45f5bb6e8d67bc /cloud_print
parente7a810943e48e9649db8063058fb77ddefaf9f96 (diff)
downloadchromium_src-154769362a046967efd14bb0a0da5d6f3a301e32.zip
chromium_src-154769362a046967efd14bb0a0da5d6f3a301e32.tar.gz
chromium_src-154769362a046967efd14bb0a0da5d6f3a301e32.tar.bz2
Move path functions from file_util to FilePath object.
EnsureEndsWithSeparator used to check whether the file existed. This seems bad and unnecessary so I removed it. I removed file_util::ContainsPath and used the existing file_util::IsParent instead. The functions descriptions are the same but the implementations do slightly different things, which is worrying. The only non-test use of this function to worry about is content/browser/storage_partition_impl_map.cc. As far as I see, the requirements for this seem OK, but I'm not very familiar with this. After some discussion with akalin, I changed sync/internal_api/sync_manager_impl.cc to be a DCHECK that the path is absolute rather than make it absolute. The old code relied on the behavior of the old function that the argument would be unchanged if the file didn't exist, and this (possibly relative) path would be used later. This behavior doesn't make a lot of sense, and it looks like now that the path is always absolute, so I replaced this call with a DCHECK. BUG= Review URL: https://codereview.chromium.org/13196006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r--cloud_print/service/win/chrome_launcher.cc8
-rw-r--r--cloud_print/service/win/cloud_print_service.cc2
2 files changed, 4 insertions, 6 deletions
diff --git a/cloud_print/service/win/chrome_launcher.cc b/cloud_print/service/win/chrome_launcher.cc
index 1d5395a..831af6f 100644
--- a/cloud_print/service/win/chrome_launcher.cc
+++ b/cloud_print/service/win/chrome_launcher.cc
@@ -121,8 +121,7 @@ void DeleteAutorunKeys(const base::FilePath& user_data_dir) {
return;
std::vector<string16> to_delete;
- base::FilePath abs_user_data_dir = user_data_dir;
- file_util::AbsolutePath(&abs_user_data_dir);
+ base::FilePath abs_user_data_dir = base::MakeAbsoluteFilePath(user_data_dir);
{
base::win::RegistryValueIterator value(HKEY_CURRENT_USER, kAutoRunKeyPath);
@@ -132,9 +131,8 @@ void DeleteAutorunKeys(const base::FilePath& user_data_dir) {
if (cmd.GetSwitchValueASCII(switches::kProcessType) ==
switches::kServiceProcess &&
cmd.HasSwitch(switches::kUserDataDir)) {
- base::FilePath path_from_reg =
- cmd.GetSwitchValuePath(switches::kUserDataDir);
- file_util::AbsolutePath(&path_from_reg);
+ base::FilePath path_from_reg = base::MakeAbsoluteFilePath(
+ cmd.GetSwitchValuePath(switches::kUserDataDir));
if (path_from_reg == abs_user_data_dir) {
to_delete.push_back(value.Name());
}
diff --git a/cloud_print/service/win/cloud_print_service.cc b/cloud_print/service/win/cloud_print_service.cc
index 3327d60..dd20668 100644
--- a/cloud_print/service/win/cloud_print_service.cc
+++ b/cloud_print/service/win/cloud_print_service.cc
@@ -184,7 +184,7 @@ class CloudPrintServiceModule
user_data_dir_switch_ =
command_line.GetSwitchValuePath(switches::kUserDataDir);
if (!user_data_dir_switch_.empty())
- file_util::AbsolutePath(&user_data_dir_switch_);
+ user_data_dir_switch_ = base::MakeAbsoluteFilePath(user_data_dir_switch_);
if (command_line.HasSwitch(kStopSwitch))
return controller_->StopService();