diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 20:30:45 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 20:30:45 +0000 |
commit | fc8edf5c2a5af722cbfe4c1605b5c0de4c17ae9b (patch) | |
tree | c89f45ac847d97edae1ca0fafd391c31e86f2d65 /chrome/installer/setup/setup_util.cc | |
parent | 8a340e008c9ddf072d1deea25af7c142db7f8b50 (diff) | |
download | chromium_src-fc8edf5c2a5af722cbfe4c1605b5c0de4c17ae9b.zip chromium_src-fc8edf5c2a5af722cbfe4c1605b5c0de4c17ae9b.tar.gz chromium_src-fc8edf5c2a5af722cbfe4c1605b5c0de4c17ae9b.tar.bz2 |
CommandLine: remove wstring-based program() accessor
This was already removed on non-Windows, so this change modifies
the remaining Windows-specific usage. In a few places I converted
use of wstring paths into FilePath, but in general for Windows-specific
code I don't think it's too important to use FilePath everywhere,
because it is equivalent on Windows and the current code already works.
BUG=23581
Review URL: http://codereview.chromium.org/3817001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup/setup_util.cc')
-rw-r--r-- | chrome/installer/setup/setup_util.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index 2136616..84f6c2b 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -13,34 +13,38 @@ #include "courgette/courgette.h" #include "third_party/bspatch/mbspatch.h" -int setup_util::ApplyDiffPatch(const std::wstring& src, - const std::wstring& patch, - const std::wstring& dest) { - LOG(INFO) << "Applying patch " << patch - << " to file " << src - << " and generating file " << dest; +int setup_util::ApplyDiffPatch(const FilePath& src, + const FilePath& patch, + const FilePath& dest) { + LOG(INFO) << "Applying patch " << patch.value() + << " to file " << src.value() + << " and generating file " << dest.value(); // Try Courgette first. Courgette checks the patch file first and fails // quickly if the patch file does not have a valid Courgette header. courgette::Status patch_status = - courgette::ApplyEnsemblePatch(src.c_str(), patch.c_str(), dest.c_str()); + courgette::ApplyEnsemblePatch(src.value().c_str(), + patch.value().c_str(), + dest.value().c_str()); if (patch_status == courgette::C_OK) { return 0; } else { - LOG(INFO) << "Failed to apply patch " << patch << " using courgette."; + LOG(INFO) << "Failed to apply patch " << patch.value() + << " using courgette."; } - return ApplyBinaryPatch(src.c_str(), patch.c_str(), dest.c_str()); + return ApplyBinaryPatch(src.value().c_str(), patch.value().c_str(), + dest.value().c_str()); } installer::Version* setup_util::GetVersionFromDir( - const std::wstring& chrome_path) { - LOG(INFO) << "Looking for Chrome version folder under " << chrome_path; - std::wstring root_path(chrome_path); - file_util::AppendToPath(&root_path, L"*"); + const FilePath& chrome_path) { + LOG(INFO) << "Looking for Chrome version folder under " + << chrome_path.value(); + FilePath root_path = chrome_path.Append(L"*"); WIN32_FIND_DATA find_data; - HANDLE file_handle = FindFirstFile(root_path.c_str(), &find_data); + HANDLE file_handle = FindFirstFile(root_path.value().c_str(), &find_data); BOOL ret = TRUE; installer::Version *version = NULL; // Here we are assuming that the installer we have is really valid so there |