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

Issue 2403713002: Add suborigin logic to url::Origin (Closed)

Created:
4 years, 2 months ago by jww
Modified:
4 years, 1 month ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, markusheintz_, msramek+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add suborigin logic to url::Origin In order for the browser to correctly reason about suborigins, this adds support to url::Origin to parse and understand suborigins. It separates requests for hosts and schemes from the embedded suborigin serialization, while keeping the same-origin policy checks intact so a suborigin is a different origin from other suborigins at the same physical origin. This updates url/origin.* so that given a suborigin encoded in a GURL, will correctly deserialize the suborigin and store it accordingly, while the scheme/host/port tuple is left with the real scheme/host/port. Additionally, removes the content/public/common/origin_util.h functions for using suborigins since url::Origin should now be used in their stead. BUG=336894, 649893 Committed: https://crrev.com/0448040f47ea1ba6a5c6ee03c82eff41854f0e0e Cr-Commit-Position: refs/heads/master@{#427254}

Patch Set 1 #

Patch Set 2 : Minor simplification #

Total comments: 12

Patch Set 3 : Address Mike's comments #

Total comments: 14

Patch Set 4 : Rebase on ToT #

Patch Set 5 : Adress nasko's comments #

Total comments: 1

Patch Set 6 : Comment nit #

Patch Set 7 : Rebase on ToT #

Total comments: 2

Patch Set 8 : Update comments and test for suborigin deleting origin local storage #

Patch Set 9 : More unit tests #

Patch Set 10 : Rebase on ToT #

Total comments: 5

Patch Set 11 : Clarify DeleteLocalStorage API #

Total comments: 8

Patch Set 12 : Adjust DeleteLocalStorage* API #

Total comments: 8

Patch Set 13 : Nits from michaeln #

Patch Set 14 : Rebase on ToT #

Patch Set 15 : Fix unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+491 lines, -272 lines) Patch
M chrome/browser/browsing_data/browsing_data_local_storage_helper.h View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_local_storage_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +34 lines, -21 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_local_storage_helper_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -3 lines 0 comments Download
M chrome/browser/browsing_data/cookies_tree_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +7 lines, -5 lines 0 comments Download
M content/browser/child_process_security_policy_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/child_process_security_policy_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -4 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +26 lines, -22 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +100 lines, -6 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/storage_partition_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/common/origin_util.cc View 2 chunks +0 lines, -64 lines 0 comments Download
M content/common/origin_util_unittest.cc View 1 chunk +0 lines, -77 lines 0 comments Download
M content/common/url_schemes.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M content/public/browser/dom_storage_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -2 lines 0 comments Download
M content/public/common/origin_util.h View 2 chunks +0 lines, -23 lines 0 comments Download
M content/public/common/url_constants.h View 1 chunk +0 lines, -5 lines 0 comments Download
M content/public/common/url_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -3 lines 0 comments Download
M url/gurl.h View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 0 comments Download
M url/gurl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +30 lines, -0 lines 0 comments Download
M url/origin.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +18 lines, -1 line 0 comments Download
M url/origin.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +70 lines, -4 lines 0 comments Download
M url/origin_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +117 lines, -0 lines 0 comments Download
M url/url_canon_stdurl.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M url/url_canon_unittest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M url/url_constants.h View 1 chunk +5 lines, -0 lines 0 comments Download
M url/url_constants.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M url/url_util.cc View 1 chunk +19 lines, -15 lines 0 comments Download

Messages

Total messages: 46 (13 generated)
jww
Mike, can you review this CL, focusing on url/, which is the core? I'll ask ...
4 years, 2 months ago (2016-10-09 19:21:13 UTC) #2
jww
On 2016/10/09 19:21:13, jww wrote: > Mike, can you review this CL, focusing on url/, ...
4 years, 2 months ago (2016-10-09 19:21:34 UTC) #3
Mike West
This looks like a reasonable approach, thanks for putting it together. I guess the core ...
4 years, 2 months ago (2016-10-11 07:40:41 UTC) #8
jww
Thanks, Mike! I think I've addressed your comments. On 2016/10/11 07:40:41, Mike West wrote: > ...
4 years, 2 months ago (2016-10-11 18:16:10 UTC) #9
jww
Oops, here are my actual response to your comments. https://codereview.chromium.org/2403713002/diff/20001/content/public/common/url_constants.h File content/public/common/url_constants.h (left): https://codereview.chromium.org/2403713002/diff/20001/content/public/common/url_constants.h#oldcode78 content/public/common/url_constants.h:78: ...
4 years, 2 months ago (2016-10-11 18:16:27 UTC) #10
jww
nasko@, can you take a look at the content/ bits? msramek@, can you look at ...
4 years, 2 months ago (2016-10-11 21:45:17 UTC) #12
msramek
browsing_data/ LGTM
4 years, 2 months ago (2016-10-12 13:38:12 UTC) #13
nasko
I won't be able to get to this CL likely today.
4 years, 2 months ago (2016-10-12 17:36:28 UTC) #14
Mike West
//url LGTM. Thanks for taking another pass.
4 years, 2 months ago (2016-10-13 09:50:36 UTC) #15
nasko
The CL looks good and I've left some comments. Adding michaeln@ to review the content/browser/dom_storage/ ...
4 years, 2 months ago (2016-10-13 22:16:45 UTC) #17
jww
Thanks, nasko! https://codereview.chromium.org/2403713002/diff/40001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/2403713002/diff/40001/url/gurl.h#newcode252 url/gurl.h:252: // Returns true if the scheme indicates ...
4 years, 2 months ago (2016-10-14 01:08:58 UTC) #18
nasko
Thanks! https://codereview.chromium.org/2403713002/diff/40001/url/gurl.h File url/gurl.h (right): https://codereview.chromium.org/2403713002/diff/40001/url/gurl.h#newcode252 url/gurl.h:252: // Returns true if the scheme indicates a ...
4 years, 2 months ago (2016-10-14 14:12:41 UTC) #19
jww
Ah, got it. I just uploaded https://codereview.chromium.org/2419083002/ to add the DefaultSchemeHostPort unit test separately and ...
4 years, 2 months ago (2016-10-14 14:28:19 UTC) #20
michaeln
i'm not so familiar with this, pardon the stupid questions, i'd like understand wassup https://codereview.chromium.org/2403713002/diff/120001/content/browser/dom_storage/dom_storage_context_impl.cc ...
4 years, 2 months ago (2016-10-17 20:06:59 UTC) #21
jww
https://codereview.chromium.org/2403713002/diff/120001/content/browser/dom_storage/dom_storage_context_impl.cc File content/browser/dom_storage/dom_storage_context_impl.cc (right): https://codereview.chromium.org/2403713002/diff/120001/content/browser/dom_storage/dom_storage_context_impl.cc#newcode218 content/browser/dom_storage/dom_storage_context_impl.cc:218: if (origin.IsSameOriginWith(origin) || Great point, Michael! In short, yes, ...
4 years, 2 months ago (2016-10-18 06:44:19 UTC) #22
michaeln
I'm not sure about the semantic squishiness of sub vs phys origin? > https://codereview.chromium.org/2403713002/diff/120001/content/browser/dom_storage/dom_storage_context_impl.cc#newcode218 > ...
4 years, 2 months ago (2016-10-19 00:17:30 UTC) #23
jww
On 2016/10/19 00:17:30, michaeln wrote: > I'm not sure about the semantic squishiness of sub ...
4 years, 2 months ago (2016-10-19 00:27:24 UTC) #24
michaeln
> > I'm not sure about the semantic squishiness of sub vs phys origin? > ...
4 years, 2 months ago (2016-10-19 20:36:02 UTC) #25
michaeln
ultimately... with layering in mind, the context api should *let* callers delete just a suborigin ...
4 years, 2 months ago (2016-10-19 20:52:50 UTC) #26
michaeln
https://codereview.chromium.org/2403713002/diff/180001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc File chrome/browser/browsing_data/browsing_data_local_storage_helper.cc (right): https://codereview.chromium.org/2403713002/diff/180001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc#newcode139 chrome/browser/browsing_data/browsing_data_local_storage_helper.cc:139: BrowsingDataLocalStorageHelper::DeleteOrigin(origin_url); not directly related to your cl, but maybe ...
4 years, 2 months ago (2016-10-19 21:11:39 UTC) #27
jww
OK, that makes sense. I'll update the CL accordingly in a bit to hopefully make ...
4 years, 2 months ago (2016-10-19 22:11:23 UTC) #28
michaeln
sgtm, thnx!
4 years, 2 months ago (2016-10-19 22:32:37 UTC) #29
jww
Hey Michael, let me know if this clarifies the API a bit. https://codereview.chromium.org/2403713002/diff/180001/url/origin.h File url/origin.h ...
4 years, 2 months ago (2016-10-20 06:03:47 UTC) #30
michaeln
Sorry for moving the target on you :( https://codereview.chromium.org/2403713002/diff/200001/content/browser/dom_storage/dom_storage_context_impl.cc File content/browser/dom_storage/dom_storage_context_impl.cc (right): https://codereview.chromium.org/2403713002/diff/200001/content/browser/dom_storage/dom_storage_context_impl.cc#newcode209 content/browser/dom_storage/dom_storage_context_impl.cc:209: DCHECK(origin.suborigin().empty()); ...
4 years, 2 months ago (2016-10-21 23:07:12 UTC) #31
jww
Thanks, Michael. Those changes definitely make sense, especially once I reviewed the call sites more ...
4 years, 2 months ago (2016-10-22 00:43:13 UTC) #32
michaeln
lgtm, thnx! https://codereview.chromium.org/2403713002/diff/220001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc File chrome/browser/browsing_data/browsing_data_local_storage_helper.cc (right): https://codereview.chromium.org/2403713002/diff/220001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc#newcode81 chrome/browser/browsing_data/browsing_data_local_storage_helper.cc:81: origin.GetPhysicalOrigin().GetURL()); no need to call GetPhysOrigin anymore ...
4 years, 1 month ago (2016-10-24 21:10:03 UTC) #33
jww
Thanks, Michael. nasko@, should be ready for your review now. https://codereview.chromium.org/2403713002/diff/220001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc File chrome/browser/browsing_data/browsing_data_local_storage_helper.cc (right): https://codereview.chromium.org/2403713002/diff/220001/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc#newcode81 ...
4 years, 1 month ago (2016-10-24 21:22:54 UTC) #34
nasko
content/ LGTM
4 years, 1 month ago (2016-10-24 23:33:56 UTC) #35
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/2403713002/260001
4 years, 1 month ago (2016-10-25 00:06:48 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/301818)
4 years, 1 month ago (2016-10-25 00:12:05 UTC) #40
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/2403713002/280001
4 years, 1 month ago (2016-10-25 00:54:32 UTC) #43
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 1 month ago (2016-10-25 02:50:58 UTC) #44
commit-bot: I haz the power
4 years, 1 month ago (2016-10-25 02:54:00 UTC) #46
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/0448040f47ea1ba6a5c6ee03c82eff41854f0e0e
Cr-Commit-Position: refs/heads/master@{#427254}

Powered by Google App Engine
This is Rietveld 408576698