summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_util.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 10:35:27 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 10:35:27 +0000
commitb7394ff0fd9dc89187d40860e7e86386c373c9ab (patch)
tree3a3b37db268e304d9f867952486a07ce673c778a /net/ftp/ftp_util.h
parent8ba4973cfcfe2a6b8c0cacca76fabe8b66d41646 (diff)
downloadchromium_src-b7394ff0fd9dc89187d40860e7e86386c373c9ab.zip
chromium_src-b7394ff0fd9dc89187d40860e7e86386c373c9ab.tar.gz
chromium_src-b7394ff0fd9dc89187d40860e7e86386c373c9ab.tar.bz2
Fix the "ls -l" style date parser to correctly guess the year if it is not provided.
Also provide an infrastructure to mock the current time in the tests. BUG=36293 TEST=net_unittests Review URL: http://codereview.chromium.org/1120012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_util.h')
-rw-r--r--net/ftp/ftp_util.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ftp/ftp_util.h b/net/ftp/ftp_util.h
index 5643606..37a51c2 100644
--- a/net/ftp/ftp_util.h
+++ b/net/ftp/ftp_util.h
@@ -32,12 +32,13 @@ class FtpUtil {
// Convert a "ls -l" date listing to time. The listing comes in three columns.
// The first one contains month, the second one contains day of month.
- // The first one is either a time (and then the current year is assumed),
- // or is a year (and then we don't know the time).
+ // The first one is either a time (and then we guess the year based
+ // on |current_time|), or is a year (and then we don't know the time).
static bool LsDateListingToTime(const string16& month,
const string16& day,
const string16& rest,
- base::Time* time);
+ const base::Time& current_time,
+ base::Time* result);
// Skip |columns| columns from |text| (whitespace-delimited), and return the
// remaining part, without leading/trailing whitespace.