Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Issue 1976073002: Making cookies eviction quotas match spec (Closed)

Created:
4 years, 7 months ago by maksims (do not use this acc)
Modified:
4 years, 6 months ago
Reviewers:
jww, Mike West, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Making cookies eviction quotas match spec According to the section 3 and section 5 in https://tools.ietf.org/html/draft-west-cookie-priority- 00#section-3, the old cookie monster implementation doesn't maintain priority quotas correctly. This CL makes sure there will always be at least 30 low priority cookies, 50 mid priority and 70 high priority cookies if there had been enough of them before the eviction. Please note, secure cookies are more important than non-secure per https://tools.ietf.org/html/draft-west-leave-secure-cookies-alone. A small example: if there are 70 cookies: 37 non-secure low priority and 33 secure low priority cookies, 37 non-secure cookies are deleted during the first round and other 3 secure low priority cookies are deleted during the following round preserving 30 low priority cookies according to the quota of those specific cookies. For a bigger example that fully complies with the implementation, check the unittests. Before the fix, the unittests were just adjusted to the behavior of cookies eviction. For example, if we take the following unittest: Round 1 => 10L; round 2 => 11M, 10L; round 3 => none. TestPriorityCookieCase(cm.get(), "11HN 10MN 20LN 110MN 20LN 10HN", 20U,109U, 21U, 150U, 0U); The problem here was that there were only 40 low priority cookies, but the quota was not preserved for those cookies. First, 10 low priority cookies were deleted and then more 10 low priority cookies were deleted leaving only 20 of them, which was less than the quota (30 low priority cookies). It happened because the eviction algorithm didn't know how many cookies of a specific priority were deleted and it had always started to delete all the cookies from the beginning of the container removing even those cookies that shouldn't have been deleted. After we land this CL, we can have cookies in any order and high priority cookies will be eventually deleted in order to avoid excess of high priority cookies by some applications within the same domain. Thus, after the eviction algorithm runs, we should have at least 30 low, 50 mid and 70 high priority cookies if we had sufficient amount of them in the beginning. BUG=609550 Committed: https://crrev.com/fe1fea6df040fff38a3a4567e20a3d5847e83170 Cr-Commit-Position: refs/heads/master@{#398049}

Patch Set 1 #

Patch Set 2 : strict cookie #

Total comments: 13

Patch Set 3 : rebasing + comments #

Total comments: 4

Patch Set 4 : comments #

Total comments: 1

Patch Set 5 : removing deprecated comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -154 lines) Patch
M net/cookies/cookie_monster.cc View 1 2 3 4 chunks +54 lines, -87 lines 0 comments Download
M net/cookies/cookie_monster_unittest.cc View 1 2 3 4 6 chunks +103 lines, -67 lines 0 comments Download

Messages

Total messages: 56 (23 generated)
maksims (do not use this acc)
please take a look at this example
4 years, 7 months ago (2016-05-13 04:57:07 UTC) #4
jww
On 2016/05/13 04:57:07, maksims wrote: > please take a look at this example Unfortunately, I ...
4 years, 7 months ago (2016-05-14 00:50:38 UTC) #7
maksims (do not use this acc)
On 2016/05/14 00:50:38, jww wrote: > On 2016/05/13 04:57:07, maksims wrote: > > please take ...
4 years, 7 months ago (2016-05-16 04:41:34 UTC) #8
maksims (do not use this acc)
ptal. This is how I thing it should work. It preserves the quota for cookies ...
4 years, 7 months ago (2016-05-16 12:58:25 UTC) #11
maksims (do not use this acc)
On 2016/05/16 12:58:25, maksims wrote: > ptal. > > This is how I thing it ...
4 years, 7 months ago (2016-05-16 12:58:42 UTC) #12
mmenke
On 2016/05/16 12:58:42, maksims wrote: > On 2016/05/16 12:58:25, maksims wrote: > > ptal. > ...
4 years, 7 months ago (2016-05-17 17:21:13 UTC) #13
jww
On 2016/05/17 17:21:13, mmenke wrote: > On 2016/05/16 12:58:42, maksims wrote: > > On 2016/05/16 ...
4 years, 7 months ago (2016-05-17 17:51:06 UTC) #14
maksims (do not use this acc)
gentle reminder
4 years, 7 months ago (2016-05-20 05:29:27 UTC) #16
jww
Thanks for this CL. I've added in a bunch of clarifications and questions. I haven't ...
4 years, 7 months ago (2016-05-23 23:19:03 UTC) #19
maksims (do not use this acc)
https://codereview.chromium.org/1976073002/diff/60001/net/cookies/cookie_monster.cc File net/cookies/cookie_monster.cc (right): https://codereview.chromium.org/1976073002/diff/60001/net/cookies/cookie_monster.cc#newcode316 net/cookies/cookie_monster.cc:316: for (const auto& cookie : *cookies) { On 2016/05/23 ...
4 years, 7 months ago (2016-05-24 06:24:57 UTC) #21
jww
On 2016/05/24 06:24:57, maksims wrote: > https://codereview.chromium.org/1976073002/diff/60001/net/cookies/cookie_monster.cc > File net/cookies/cookie_monster.cc (right): > > https://codereview.chromium.org/1976073002/diff/60001/net/cookies/cookie_monster.cc#newcode316 > ...
4 years, 7 months ago (2016-05-25 00:29:20 UTC) #22
jww
This is looking like it's on the right track, but I still have some questions. ...
4 years, 7 months ago (2016-05-26 03:46:39 UTC) #23
maksims (do not use this acc)
On 2016/05/26 03:46:39, jww wrote: > This is looking like it's on the right track, ...
4 years, 7 months ago (2016-05-26 07:53:10 UTC) #24
maksims (do not use this acc)
https://codereview.chromium.org/1976073002/diff/120001/net/cookies/cookie_monster.cc File net/cookies/cookie_monster.cc (right): https://codereview.chromium.org/1976073002/diff/120001/net/cookies/cookie_monster.cc#newcode324 net/cookies/cookie_monster.cc:324: bool protect_secure_cookies = false) { On 2016/05/26 03:46:39, jww ...
4 years, 7 months ago (2016-05-26 11:30:20 UTC) #26
maksims (do not use this acc)
gentle reminder
4 years, 6 months ago (2016-06-01 05:05:03 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1976073002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1976073002/160001
4 years, 6 months ago (2016-06-01 05:37:37 UTC) #29
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-01 06:49:10 UTC) #31
jww
On 2016/06/01 06:49:10, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
4 years, 6 months ago (2016-06-02 00:54:52 UTC) #32
jww
On 2016/05/26 07:53:10, maksims wrote: > On 2016/05/26 03:46:39, jww wrote: > > This is ...
4 years, 6 months ago (2016-06-03 00:10:34 UTC) #33
jww
On 2016/06/03 00:10:34, jww wrote: > On 2016/05/26 07:53:10, maksims wrote: > > On 2016/05/26 ...
4 years, 6 months ago (2016-06-03 00:11:08 UTC) #34
jww
Okay, the code is looking pretty good to me, and I've started going over the ...
4 years, 6 months ago (2016-06-03 00:15:47 UTC) #35
maksims (do not use this acc)
On 2016/06/03 00:15:47, jww wrote: > Okay, the code is looking pretty good to me, ...
4 years, 6 months ago (2016-06-03 05:10:30 UTC) #38
jww
lgtm with one nit in the unit tests about deleting a comment. Thanks again for ...
4 years, 6 months ago (2016-06-03 22:26:25 UTC) #40
maksims (do not use this acc)
On 2016/06/03 22:26:25, jww wrote: > lgtm with one nit in the unit tests about ...
4 years, 6 months ago (2016-06-04 10:49:56 UTC) #41
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1976073002/180001
4 years, 6 months ago (2016-06-06 09:14:46 UTC) #43
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-06 10:35:21 UTC) #45
mmenke
On 2016/06/04 10:49:56, maksims wrote: > On 2016/06/03 22:26:25, jww wrote: > > lgtm with ...
4 years, 6 months ago (2016-06-06 14:48:24 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1976073002/180001
4 years, 6 months ago (2016-06-06 16:43:45 UTC) #49
maksims (do not use this acc)
On 2016/06/06 14:48:24, mmenke wrote: > On 2016/06/04 10:49:56, maksims wrote: > > On 2016/06/03 ...
4 years, 6 months ago (2016-06-06 16:44:27 UTC) #50
commit-bot: I haz the power
Committed patchset #5 (id:180001)
4 years, 6 months ago (2016-06-06 16:50:32 UTC) #52
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/fe1fea6df040fff38a3a4567e20a3d5847e83170 Cr-Commit-Position: refs/heads/master@{#398049}
4 years, 6 months ago (2016-06-06 16:53:24 UTC) #54
mmenke
This seems to have caused a perf regression on some of the bots. It's unclear ...
4 years, 6 months ago (2016-06-15 17:41:05 UTC) #55
mmenke
4 years, 6 months ago (2016-06-15 17:42:04 UTC) #56
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:180001) has been created in
https://codereview.chromium.org/2071593002/ by mmenke@chromium.org.

The reason for reverting is: Experimentally reverting, seems to have possibly
caused a perf regression.  See https://crbug.com/618679.

Powered by Google App Engine
This is Rietveld 408576698