Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Issue 2438513003: When parsing cookie expiration times, saturate out of range dates (Closed)

Created:
4 years, 2 months ago by mmenke
Modified:
4 years, 2 months ago
Reviewers:
Devlin, eroman
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, cbentzel+watch_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

When parsing cookie expiration times, saturate out of range dates rather than reject them. Roughly this means cookie expiration times prior to 1970 on (non-OSX) POSIX, or after 2038 on 32-bit (non-OSX) POSIX, will now be interpreted as either very small or very large base::Time values. This is a reland of https://codereview.chromium.org/2424443002/, which ran into issues due to base::Time::FromTimeT() returning Time::Max() when passed the maximum time_t value. As a workaround, ParseCookieExpirationTime now returns the min/max base::Time() values for times outside the supported range, instad of the min/max base::Time() values supported by Time::FromUTCExploded() on the current platform. BUG=649416 Committed: https://crrev.com/b6e737731c0b73340e969939ab1bfa2ffc7cf648 Cr-Commit-Position: refs/heads/master@{#426539}

Patch Set 1 #

Patch Set 2 : Switch to returning min/max values. #

Patch Set 3 : Clean up comments #

Total comments: 1

Patch Set 4 : Response to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -85 lines) Patch
M extensions/browser/api/web_request/web_request_api_helpers.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M net/cookies/canonical_cookie.h View 1 chunk +2 lines, -0 lines 0 comments Download
M net/cookies/canonical_cookie.cc View 1 chunk +2 lines, -1 line 0 comments Download
M net/cookies/cookie_monster_store_test.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M net/cookies/cookie_util.h View 1 2 3 1 chunk +7 lines, -2 lines 0 comments Download
M net/cookies/cookie_util.cc View 1 3 chunks +77 lines, -8 lines 0 comments Download
M net/cookies/cookie_util_unittest.cc View 1 2 2 chunks +117 lines, -69 lines 0 comments Download

Messages

Total messages: 23 (15 generated)
mmenke
Eric: PTAL. Turns out base::Time::FromeTimeT() return Time::Max when passed the max time_t. Working around that ...
4 years, 2 months ago (2016-10-20 15:26:12 UTC) #9
mmenke
On 2016/10/20 15:26:12, mmenke wrote: > Eric: PTAL. Turns out base::Time::FromeTimeT() return Time::Max when passed ...
4 years, 2 months ago (2016-10-20 15:27:35 UTC) #10
eroman
lgtm https://chromiumcodereview.appspot.com/2438513003/diff/40001/net/cookies/cookie_util.h File net/cookies/cookie_util.h (right): https://chromiumcodereview.appspot.com/2438513003/diff/40001/net/cookies/cookie_util.h#newcode44 net/cookies/cookie_util.h:44: // Time::FromUTCExplodeded(), then this will return the min/max ...
4 years, 2 months ago (2016-10-20 16:00:22 UTC) #11
mmenke
[+rdevlin.cronin]: This is just a reland of the CL I sent you yesterday, with a ...
4 years, 2 months ago (2016-10-20 16:18:31 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2438513003/60001
4 years, 2 months ago (2016-10-20 16:19:37 UTC) #17
Devlin
extensions lgtm
4 years, 2 months ago (2016-10-20 16:23:37 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 2 months ago (2016-10-20 18:40:57 UTC) #21
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:20:31 UTC) #23
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/b6e737731c0b73340e969939ab1bfa2ffc7cf648
Cr-Commit-Position: refs/heads/master@{#426539}

Powered by Google App Engine
This is Rietveld 408576698