summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 05:46:20 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 05:46:20 +0000
commit9e66a9b94a40eeeeb52c47c83990b0766e1b7ceb (patch)
tree0818f910c522fb5bda00cab55412201251db32f7 /chrome/installer/setup
parentad5b14e00b36aab6e2b2d6aba8477a5dd9a11998 (diff)
downloadchromium_src-9e66a9b94a40eeeeb52c47c83990b0766e1b7ceb.zip
chromium_src-9e66a9b94a40eeeeb52c47c83990b0766e1b7ceb.tar.gz
chromium_src-9e66a9b94a40eeeeb52c47c83990b0766e1b7ceb.tar.bz2
Revert 198820 "Move FileEnumerator to its own file, do some refa..."
Broke both windows clobber and official builders' compile with this error: 771>Link: 771> Creating library ..\..\..\build\Release\lib\gcp_portmon64.lib and object ..\..\..\build\Release\lib\gcp_portmon64.exp 771>base.lib(path_service.obj) : fatalerror LNK1112: module machine type 'X86' conflicts with target machine type 'x64' 771> 771>Build FAILED. > Move FileEnumerator to its own file, do some refactoring. > > It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked. > > BUG=175002 > R=rvargas@chromium.org > > Review URL: https://codereview.chromium.org/13165005 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/14824006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/setup_util.cc12
-rw-r--r--chrome/installer/setup/uninstall.cc16
2 files changed, 15 insertions, 13 deletions
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index 8b94c01..9f112c0 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -10,7 +10,6 @@
#include "base/command_line.h"
#include "base/file_util.h"
-#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/process_util.h"
@@ -125,8 +124,8 @@ int ApplyDiffPatch(const base::FilePath& src,
Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) {
VLOG(1) << "Looking for Chrome version folder under " << chrome_path.value();
Version* version = NULL;
- base::FileEnumerator version_enum(chrome_path, false,
- base::FileEnumerator::DIRECTORIES);
+ file_util::FileEnumerator version_enum(chrome_path, false,
+ file_util::FileEnumerator::DIRECTORIES);
// TODO(tommi): The version directory really should match the version of
// setup.exe. To begin with, we should at least DCHECK that that's true.
@@ -134,11 +133,12 @@ Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) {
bool version_found = false;
while (!version_enum.Next().empty()) {
- base::FileEnumerator::FileInfo find_data = version_enum.GetInfo();
- VLOG(1) << "directory found: " << find_data.GetName().value();
+ file_util::FileEnumerator::FindInfo find_data = {0};
+ version_enum.GetFindInfo(&find_data);
+ VLOG(1) << "directory found: " << find_data.cFileName;
scoped_ptr<Version> found_version(
- new Version(WideToASCII(find_data.GetName().value())));
+ new Version(WideToASCII(find_data.cFileName)));
if (found_version->IsValid() &&
found_version->CompareTo(*max_version.get()) > 0) {
max_version.reset(found_version.release());
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 27bb823..295028c 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -11,7 +11,6 @@
#include <vector>
#include "base/file_util.h"
-#include "base/files/file_enumerator.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string16.h"
@@ -253,10 +252,11 @@ void CheckShouldRemoveSetupAndArchive(
// Returns false in case of an error.
bool RemoveInstallerFiles(const base::FilePath& installer_directory,
bool remove_setup) {
- base::FileEnumerator file_enumerator(
+ using file_util::FileEnumerator;
+ FileEnumerator file_enumerator(
installer_directory,
false,
- base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
+ FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
bool success = true;
base::FilePath setup_exe_base_name(installer::kSetupExe);
@@ -572,8 +572,9 @@ DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
// directory. For parents of the installer directory, we will later recurse
// and delete all the children (that are not also parents/children of the
// installer directory).
- base::FileEnumerator file_enumerator(target_path, true,
- base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
+ using file_util::FileEnumerator;
+ FileEnumerator file_enumerator(
+ target_path, true, FileEnumerator::FILES | FileEnumerator::DIRECTORIES);
while (true) {
base::FilePath to_delete(file_enumerator.Next());
if (to_delete.empty())
@@ -594,8 +595,9 @@ DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
// We don't try killing Chrome processes for Chrome Frame builds since
// that is unlikely to help. Instead, schedule files for deletion and
// return a value that will trigger a reboot prompt.
- base::FileEnumerator::FileInfo find_info = file_enumerator.GetInfo();
- if (find_info.IsDirectory())
+ FileEnumerator::FindInfo find_info;
+ file_enumerator.GetFindInfo(&find_info);
+ if (FileEnumerator::IsDirectory(find_info))
ScheduleDirectoryForDeletion(to_delete.value().c_str());
else
ScheduleFileSystemEntityForDeletion(to_delete.value().c_str());