diff options
-rw-r--r-- | base/file_util.cc | 10 | ||||
-rw-r--r-- | base/file_util_deprecated.h | 2 | ||||
-rw-r--r-- | chrome/installer/util/create_reg_key_work_item.cc | 20 |
3 files changed, 18 insertions, 14 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index bae6535..b611716 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -402,16 +402,6 @@ void UpOneDirectory(std::wstring* dir) { if (directory.value() != FilePath::kCurrentDirectory) *dir = directory.ToWStringHack(); } -void UpOneDirectoryOrEmpty(std::wstring* dir) { - FilePath path = FilePath::FromWStringHack(*dir); - FilePath directory = path.DirName(); - // If there is no separator, we will get back kCurrentDirectory. - // In this case, clear dir. - if (directory == path || directory.value() == FilePath::kCurrentDirectory) - dir->clear(); - else - *dir = directory.ToWStringHack(); -} int WriteFile(const std::wstring& filename, const char* data, int size) { return WriteFile(FilePath::FromWStringHack(filename), data, size); } diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h index dd2ffc8..1554486 100644 --- a/base/file_util_deprecated.h +++ b/base/file_util_deprecated.h @@ -28,8 +28,6 @@ FILE* OpenFile(const std::wstring& filename, const char* mode); // Use FilePath::DirName instead. void UpOneDirectory(std::wstring* dir); -// Use FilePath::DirName instead. -void UpOneDirectoryOrEmpty(std::wstring* dir); // Use FilePath::BaseName instead. std::wstring GetFilenameFromPath(const std::wstring& path); diff --git a/chrome/installer/util/create_reg_key_work_item.cc b/chrome/installer/util/create_reg_key_work_item.cc index 221fe7b..03f3367 100644 --- a/chrome/installer/util/create_reg_key_work_item.cc +++ b/chrome/installer/util/create_reg_key_work_item.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,6 +10,22 @@ #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/logging_installer.h" +namespace { + +// TODO: refactor this because it is only used once. +void UpOneDirectoryOrEmpty(std::wstring* dir) { + FilePath path = FilePath::FromWStringHack(*dir); + FilePath directory = path.DirName(); + // If there is no separator, we will get back kCurrentDirectory. + // In this case, clear dir. + if (directory == path || directory.value() == FilePath::kCurrentDirectory) + dir->clear(); + else + *dir = directory.ToWStringHack(); +} + +} // namespace + CreateRegKeyWorkItem::~CreateRegKeyWorkItem() { } @@ -98,7 +114,7 @@ bool CreateRegKeyWorkItem::InitKeyList() { key_list_.push_back(key_path); // This is pure string operation so it does not matter whether the // path is file path or registry path. - file_util::UpOneDirectoryOrEmpty(&key_path); + UpOneDirectoryOrEmpty(&key_path); } while (!key_path.empty()); return true; |