summaryrefslogtreecommitdiffstats
path: root/cloud_print/virtual_driver/win
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 22:51:31 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 22:51:31 +0000
commitfcb524ead399b591b4e6587c2fbe712e45126320 (patch)
tree77da32bc4e3ab916de166e0f9e52e0ad61629efa /cloud_print/virtual_driver/win
parent3afef01773fcfe63523ebede8ad5a4dfed10088b (diff)
downloadchromium_src-fcb524ead399b591b4e6587c2fbe712e45126320.zip
chromium_src-fcb524ead399b591b4e6587c2fbe712e45126320.tar.gz
chromium_src-fcb524ead399b591b4e6587c2fbe712e45126320.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/virtual_driver/win')
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor.cc8
-rw-r--r--cloud_print/virtual_driver/win/virtual_driver.gypi1
2 files changed, 4 insertions, 5 deletions
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
index c13228a..9008285 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
@@ -15,6 +15,7 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process.h"
@@ -119,14 +120,11 @@ base::FilePath GetAppDataDir() {
// Delete files which where not deleted by chrome.
void DeleteLeakedFiles(const base::FilePath& dir) {
- using file_util::FileEnumerator;
base::Time delete_before = base::Time::Now() - base::TimeDelta::FromDays(1);
- FileEnumerator enumerator(dir, false, FileEnumerator::FILES);
+ base::FileEnumerator enumerator(dir, false, base::FileEnumerator::FILES);
for (base::FilePath file_path = enumerator.Next(); !file_path.empty();
file_path = enumerator.Next()) {
- FileEnumerator::FindInfo info;
- enumerator.GetFindInfo(&info);
- if (FileEnumerator::GetLastModifiedTime(info) < delete_before)
+ if (enumerator.GetInfo().GetLastModifiedTime() < delete_before)
file_util::Delete(file_path, false);
}
}
diff --git a/cloud_print/virtual_driver/win/virtual_driver.gypi b/cloud_print/virtual_driver/win/virtual_driver.gypi
index 80c0ffb..26dc308 100644
--- a/cloud_print/virtual_driver/win/virtual_driver.gypi
+++ b/cloud_print/virtual_driver/win/virtual_driver.gypi
@@ -35,6 +35,7 @@
'port_monitor/port_monitor.h',
],
'dependencies': [
+ '<(DEPTH)/base/base.gyp:base',
'virtual_driver_lib<(virtual_driver_suffix)',
],
},