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

Issue 859663003: GetEffectiveDomain should handle ws scheme as same as http scheme. (Closed)

Created:
5 years, 11 months ago by yhirano
Modified:
5 years, 10 months ago
Reviewers:
Adam Rice, Ryan Sleevi
CC:
erikwright (departed), cbentzel+watch_chromium.org, Randy Smith (Not in Mondays)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

GetEffectiveDomain should handle ws scheme as same as http scheme. CookieMonster::AnyEquivalentCookie asserts that there are no multiple cookies that are identical to each other. That is achieved by inserting / deleting cookies carefully, but it goes wrong with WebSocket schemes. CookieMonster::DoCookieTaskForURL for given URL loads cookies when cookies for key = cookie_util::GeteEffectiveDomain(scheme, host) is not yet loaded. When the task ends, it stores loaded cookies and marks the key as loaded. cookie_util::GetEffectiveDomain consults egistry_controlled_domains::GetDomainAndRegistry when http or https schemes are given, whereas it doesn't when ws or wss schemes are given. Imagine we are about to load stored cookies for ws://www.example.com/ and http://www.example.com/. As written above, they have different keys: www.example.com and example.com. So each of them is loaded and it breaks the assertion. BUG=370021 R=ricea@chromium.org Committed: https://crrev.com/5ca0f699ed11b59167acb32f3fa7c7480630bdcc Cr-Commit-Position: refs/heads/master@{#313706}

Patch Set 1 #

Total comments: 7

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 12

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 12

Patch Set 10 : #

Total comments: 8

Patch Set 11 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -5 lines) Patch
M net/cookies/cookie_monster_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +61 lines, -0 lines 0 comments Download
M net/cookies/cookie_store_unittest.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M net/cookies/cookie_util.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M net/cookies/cookie_util_unittest.cc View 1 2 3 4 5 2 chunks +17 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (3 generated)
yhirano
5 years, 11 months ago (2015-01-19 04:27:03 UTC) #1
Adam Rice
https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc File net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc (right): https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc#newcode34 net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc:34: void SetFindDomainTestGraph() { I don't think you can put ...
5 years, 11 months ago (2015-01-19 05:18:56 UTC) #2
yhirano
https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc File net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc (right): https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc#newcode34 net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc:34: void SetFindDomainTestGraph() { On 2015/01/19 05:18:56, Adam Rice wrote: ...
5 years, 11 months ago (2015-01-19 05:56:21 UTC) #3
Adam Rice
lgtm https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc File net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc (right): https://codereview.chromium.org/859663003/diff/1/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc#newcode34 net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc:34: void SetFindDomainTestGraph() { On 2015/01/19 05:56:21, yhirano wrote: ...
5 years, 11 months ago (2015-01-19 06:05:57 UTC) #4
yhirano
https://codereview.chromium.org/859663003/diff/20001/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc File net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc (right): https://codereview.chromium.org/859663003/diff/20001/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc#newcode6 net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc:6: #include "net/base/registry_controlled_domains/test_util.h" On 2015/01/19 06:05:57, Adam Rice wrote: > ...
5 years, 11 months ago (2015-01-19 06:11:53 UTC) #5
yhirano
+rdsmith for OWNER review.
5 years, 11 months ago (2015-01-19 06:13:09 UTC) #7
Randy Smith (Not in Mondays)
I don't think I'm a good owner for this; I know nothing about WebSockets, and ...
5 years, 11 months ago (2015-01-20 18:17:31 UTC) #9
Ryan Sleevi
1) I'm not keen on speculative fixes. Please explain why this fix is correct. 2) ...
5 years, 11 months ago (2015-01-21 01:21:10 UTC) #10
Adam Rice
Two small notes. On 2015/01/21 01:21:10, Ryan Sleevi wrote: > 1) I'm not keen on ...
5 years, 11 months ago (2015-01-21 01:35:17 UTC) #11
Ryan Sleevi
On 2015/01/21 01:35:17, Adam Rice wrote: > This is at least an actual fix for ...
5 years, 11 months ago (2015-01-21 01:48:12 UTC) #12
yhirano
Wrote how the current impl causes https://crbug.com/370021.
5 years, 11 months ago (2015-01-21 04:03:57 UTC) #13
Ryan Sleevi
On 2015/01/21 04:03:57, yhirano wrote: > Wrote how the current impl causes https://crbug.com/370021. Unit tests ...
5 years, 11 months ago (2015-01-21 04:24:04 UTC) #14
yhirano
Added a CookieMonster level unit test. WebSocket started to use the http stack half a ...
5 years, 11 months ago (2015-01-21 12:03:35 UTC) #15
Ryan Sleevi
the //net/base/registry_controlled_domain changes do NOT look good. You should not be coupling your test at ...
5 years, 11 months ago (2015-01-22 01:43:41 UTC) #16
yhirano
> the //net/base/registry_controlled_domain changes do NOT look good. I found using custom PSL data is ...
5 years, 11 months ago (2015-01-23 03:34:36 UTC) #17
yhirano
As I plan to merge this fix to branches, I want it be as small ...
5 years, 11 months ago (2015-01-23 04:51:49 UTC) #18
yhirano
Thanks to Adam, I added failing WebSocket tests on https://codereview.chromium.org/869073002/. The tests pass with this ...
5 years, 11 months ago (2015-01-23 10:19:26 UTC) #19
Ryan Sleevi
Thanks for continuing to bear with me. It was not clear from your comments that ...
5 years, 11 months ago (2015-01-24 03:46:59 UTC) #20
yhirano
https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc File net/cookies/cookie_monster_unittest.cc (right): https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc#newcode2614 net/cookies/cookie_monster_unittest.cc:2614: TEST_F(MultiThreadedCookieMonsterTest, GetAllCookiesForURLEffectiveDomain) { On 2015/01/24 03:46:59, Ryan Sleevi wrote: ...
5 years, 11 months ago (2015-01-26 04:45:26 UTC) #21
Ryan Sleevi
LGTM functionally, although still nits on structure. https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc File net/cookies/cookie_monster_unittest.cc (right): https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc#newcode2644 net/cookies/cookie_monster_unittest.cc:2644: checkpoint.Call(1); On ...
5 years, 11 months ago (2015-01-26 19:49:54 UTC) #22
yhirano
https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc File net/cookies/cookie_monster_unittest.cc (right): https://codereview.chromium.org/859663003/diff/160001/net/cookies/cookie_monster_unittest.cc#newcode2644 net/cookies/cookie_monster_unittest.cc:2644: checkpoint.Call(1); > As best I can tell, the only ...
5 years, 11 months ago (2015-01-27 02:07:10 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/859663003/200001
5 years, 10 months ago (2015-01-29 14:03:26 UTC) #25
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 10 months ago (2015-01-29 14:58:34 UTC) #26
commit-bot: I haz the power
5 years, 10 months ago (2015-01-29 14:59:43 UTC) #27
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/5ca0f699ed11b59167acb32f3fa7c7480630bdcc
Cr-Commit-Position: refs/heads/master@{#313706}

Powered by Google App Engine
This is Rietveld 408576698