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

Issue 2368923003: Support the Clear-Site-Data header on resource requests (Closed)

Created:
4 years, 2 months ago by msramek
Modified:
3 years, 6 months ago
Reviewers:
falken, mmoroz, jam, mmenke, Mike West
CC:
blink-worker-reviews_chromium.org, cbentzel+watch_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, kinuko+watch, loading-reviews_chromium.org, nasko+codewatch_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Support the Clear-Site-Data header on resource requests Until now, it was only supported for navigations. Changes in this CL: 1. Convert the NavigationThrottle to a ResourceThrottle. The two classes are sufficiently similar that these are mostly syntactical changes, except that the ResourceThrottle lives on the IO thread and needs to occasionally jump to the UI thread. 2. Instantiate it in ResourceDispatcherHostImpl instead of NavigationHandleImpl. This requires adding an explicit DEPS rule. 3. Add some restrictions - for example, we will not support service worker requests or LOAD_DO_NOT_SET_COOKIES. These are then tested in the unittest. 4. Add browsertests for resource requests, and some integration tests that check not only calls to BrowsingDataRemover, but also the actual removal of data. BUG=607897 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2368923003 Cr-Commit-Position: refs/heads/master@{#477612} Committed: https://chromium.googlesource.com/chromium/src/+/9bc8902cf5825d5cbcdbf2b7766241f2f9c96bbb

Patch Set 1 #

Total comments: 17

Patch Set 2 : Addressed comments. #

Total comments: 12

Patch Set 3 : Addressed comments, improved the SW test #

Total comments: 6

Patch Set 4 : Wait for SW activation. #

Total comments: 12

Patch Set 5 : Some improvements. #

Total comments: 34

Patch Set 6 : Made the class more mockable, added unittests #

Patch Set 7 : Rebase (base::Value refactoring, ResourceController not exposed anymore, etc.) #

Patch Set 8 : Fixed tests. #

Patch Set 9 : Add integration tests. #

Patch Set 10 : Fix the compilation error #

Total comments: 10

Patch Set 11 : Addressed comments, added some debug outputs. #

Total comments: 71

Patch Set 12 : Addressed comments. #

Total comments: 1

Patch Set 13 : Rebase. #

Total comments: 41

Patch Set 14 : Addressed comments. #

Total comments: 15

Patch Set 15 : Addressed comments. #

Total comments: 32

Patch Set 16 : Addressed comments #

Total comments: 4

Patch Set 17 : Addressed comments, formatted. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1924 lines, -870 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -2 lines 0 comments Download
D chrome/browser/browsing_data/mock_browsing_data_remover_delegate.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -77 lines 0 comments Download
D chrome/browser/browsing_data/mock_browsing_data_remover_delegate.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -98 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +0 lines, -100 lines 0 comments Download
M chrome/browser/chrome_content_browser_client_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -239 lines 0 comments Download
M content/browser/browsing_data/clear_site_data_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +108 lines, -40 lines 0 comments Download
M content/browser/browsing_data/clear_site_data_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +422 lines, -146 lines 0 comments Download
M content/browser/browsing_data/clear_site_data_throttle_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +687 lines, -61 lines 0 comments Download
M content/browser/browsing_data/clear_site_data_throttle_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +523 lines, -28 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -6 lines 0 comments Download
M content/browser/loader/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +13 lines, -1 line 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -12 lines 0 comments Download
A + content/public/test/mock_browsing_data_remover_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +21 lines, -20 lines 0 comments Download
A + content/public/test/mock_browsing_data_remover_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +24 lines, -9 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
A content/test/data/browsing_data/worker.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +74 lines, -0 lines 0 comments Download
A content/test/data/browsing_data/worker_setup.html View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
M content/test/fuzzer/clear_site_data_fuzzer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +10 lines, -20 lines 0 comments Download
M net/http/http_response_headers.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M net/http/http_response_headers_unittest.cc View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 160 (103 generated)
msramek
Hi Matt and Mike! Can you please take a first pass on this CL? Before ...
4 years, 2 months ago (2016-09-26 12:17:38 UTC) #5
mmenke
Just looked at the ServiceWorker stuff, which I don't think this CL is handling correctly. ...
4 years, 2 months ago (2016-09-26 12:59:17 UTC) #8
mmenke
https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc#newcode161 content/browser/browsing_data/clear_site_data_throttle.cc:161: return; Do we get here for WebSockets? I don't ...
4 years, 2 months ago (2016-09-27 18:24:02 UTC) #9
mmenke
Oh, and I do think this is the best place to hook this stuff up. ...
4 years, 2 months ago (2016-09-27 18:28:32 UTC) #10
msramek
Hello again Matt! Thanks for all the comments and for your attempt to speed up ...
4 years, 2 months ago (2016-10-13 14:24:37 UTC) #14
msramek
https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc#newcode91 content/browser/browsing_data/clear_site_data_throttle.cc:91: if (load_flags & net::LOAD_DO_NOT_SAVE_COOKIES) On 2016/09/26 12:59:16, mmenke wrote: ...
4 years, 2 months ago (2016-10-13 14:26:03 UTC) #15
mmenke
https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc#newcode91 content/browser/browsing_data/clear_site_data_throttle.cc:91: if (load_flags & net::LOAD_DO_NOT_SAVE_COOKIES) On 2016/10/13 14:26:03, msramek wrote: ...
4 years, 2 months ago (2016-10-13 17:16:31 UTC) #18
msramek
In this patchset, I think I finally got the service workers right. Matt, PTAL! Mike ...
4 years, 2 months ago (2016-10-17 14:28:31 UTC) #22
mmenke
[+falken]: Mind reviewing this, from a ServiceWorker standpoint? Basically, when we get this magic header ...
4 years, 2 months ago (2016-10-17 16:47:59 UTC) #26
falken
service worker interaction lgtm % comments https://codereview.chromium.org/2368923003/diff/80001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc File content/browser/browsing_data/clear_site_data_throttle_browsertest.cc (right): https://codereview.chromium.org/2368923003/diff/80001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc#newcode403 content/browser/browsing_data/clear_site_data_throttle_browsertest.cc:403: // i.e. that ...
4 years, 2 months ago (2016-10-19 07:14:38 UTC) #27
msramek
Thanks for the review, and mainly for the pointers you gave me in my email ...
4 years, 2 months ago (2016-10-19 12:20:12 UTC) #30
Mike West
On 2016/10/13 at 17:16:31, mmenke wrote: > https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc > File content/browser/browsing_data/clear_site_data_throttle.cc (right): > > https://codereview.chromium.org/2368923003/diff/1/content/browser/browsing_data/clear_site_data_throttle.cc#newcode91 ...
4 years, 2 months ago (2016-10-20 11:52:48 UTC) #33
Mike West
The tests look very thorough. Thank you! LGTM.
4 years, 2 months ago (2016-10-20 11:55:52 UTC) #34
Mike West
On 2016/10/20 at 11:55:52, Mike West wrote: > The tests look very thorough. Thank you! ...
4 years, 2 months ago (2016-10-20 11:56:31 UTC) #35
mmenke
Sorry for slowness, didn't get back to tests, and doesn't look like I'll get to ...
4 years, 2 months ago (2016-10-20 19:03:11 UTC) #36
msramek
No worries Matt, I don't perceive your reviews as slow :) (and in any case, ...
4 years, 2 months ago (2016-10-21 13:36:00 UTC) #39
mmenke
I like the tests, which seem admirably complete, though they do miss two things (The ...
4 years, 2 months ago (2016-10-21 15:16:21 UTC) #40
msramek
Hi Matt! It took me a while again to update this. I've been mostly playing ...
4 years, 1 month ago (2016-10-31 19:23:36 UTC) #53
mmenke
Sorry, forgot about this CL. Want to get the "where are we going to support ...
4 years, 1 month ago (2016-11-08 18:23:59 UTC) #56
mmenke
On 2016/11/08 18:23:59, mmenke wrote: > Sorry, forgot about this CL. Want to get the ...
4 years, 1 month ago (2016-11-08 18:24:36 UTC) #57
msramek
On 2016/11/08 18:24:36, mmenke wrote: > On 2016/11/08 18:23:59, mmenke wrote: > > Sorry, forgot ...
4 years, 1 month ago (2016-11-09 10:31:30 UTC) #58
mmenke
On 2016/11/09 10:31:30, msramek wrote: > On 2016/11/08 18:24:36, mmenke wrote: > > On 2016/11/08 ...
4 years, 1 month ago (2016-11-09 15:24:37 UTC) #59
msramek
On 2016/11/09 15:24:37, mmenke wrote: > On 2016/11/09 10:31:30, msramek wrote: > > On 2016/11/08 ...
4 years, 1 month ago (2016-11-09 18:43:36 UTC) #60
mmenke
On 2016/11/09 18:43:36, msramek wrote: > Fair enough :) Let's do it! > > I ...
4 years, 1 month ago (2016-11-09 21:14:46 UTC) #61
msramek
Hello folks! I'm reviving this months old CL. - Patchset #7: Rebase - Patcshet #8: ...
3 years, 7 months ago (2017-05-16 20:51:13 UTC) #77
falken
service worker integration still lgtm (didn't scrutinize too closely since you said not much changed ...
3 years, 7 months ago (2017-05-17 07:37:01 UTC) #84
Mike West
Still digging through, but: https://codereview.chromium.org/2368923003/diff/280001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc File content/browser/browsing_data/clear_site_data_throttle_browsertest.cc (right): https://codereview.chromium.org/2368923003/diff/280001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc#newcode541 content/browser/browsing_data/clear_site_data_throttle_browsertest.cc:541: IN_PROC_BROWSER_TEST_F(ClearSiteDataThrottleBrowserTest, ServiceWorker) { This is ...
3 years, 7 months ago (2017-05-17 08:38:32 UTC) #85
msramek
On 2017/05/17 07:37:01, falken wrote: > service worker integration still lgtm (didn't scrutinize too closely ...
3 years, 7 months ago (2017-05-17 13:45:52 UTC) #88
msramek
https://codereview.chromium.org/2368923003/diff/280001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/280001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode330 content/browser/browsing_data/clear_site_data_throttle.cc:330: // any website. On 2017/05/17 07:37:00, falken wrote: > ...
3 years, 7 months ago (2017-05-17 13:46:37 UTC) #89
mmenke
I'll plan to get to this tomorrow. Worth noting that the plan is that ResourceThrottles ...
3 years, 7 months ago (2017-05-17 20:59:54 UTC) #92
falken
On 2017/05/17 13:45:52, msramek wrote: > It's ClearSiteDataThrottleBrowserTest.ServiceWorker. It navigates to a page that > ...
3 years, 7 months ago (2017-05-18 02:03:57 UTC) #94
mmenke
Sorry for the unreasonable delay. I'll start reviewing tests today, too, but may not get ...
3 years, 7 months ago (2017-05-22 18:35:35 UTC) #95
mmenke
I'll look at browser tests tomorrow. https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.h File content/browser/browsing_data/clear_site_data_throttle.h (right): https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.h#newcode70 content/browser/browsing_data/clear_site_data_throttle.h:70: static std::unique_ptr<ResourceThrottle> CreateThrottleForRequest( ...
3 years, 7 months ago (2017-05-22 19:36:09 UTC) #96
Mike West
I talked with msramek@ about this yesterday, and the broad strokes still LGTM. That said, ...
3 years, 7 months ago (2017-05-24 11:13:18 UTC) #97
msramek
Thanks for the thorough review so far :) I addressed your comments and rebased (due ...
3 years, 7 months ago (2017-05-24 22:59:53 UTC) #107
mmenke
Quick responses to your comment. I will actually review the browser tests today. Sorry for ...
3 years, 7 months ago (2017-05-25 15:19:01 UTC) #108
mmenke
Really like those browser tests! https://codereview.chromium.org/2368923003/diff/360001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/360001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode113 content/browser/browsing_data/clear_site_data_throttle.cc:113: return; This isn't handling ...
3 years, 7 months ago (2017-05-25 19:23:10 UTC) #109
msramek
I addressed your comments, but in two cases I didn't understand the concern. I have ...
3 years, 6 months ago (2017-05-30 21:58:46 UTC) #115
mmenke
quick responses https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode195 content/browser/browsing_data/clear_site_data_throttle.cc:195: if (message.url == last_seen_url) { On 2017/05/30 ...
3 years, 6 months ago (2017-05-30 22:58:35 UTC) #118
mmenke
May give this another once over, but I'm happy with this. https://codereview.chromium.org/2368923003/diff/360001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc File content/browser/browsing_data/clear_site_data_throttle_browsertest.cc (right): ...
3 years, 6 months ago (2017-05-31 16:25:33 UTC) #119
mmenke
One other thing: You should probably add the new browser test fixture to testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter, since ...
3 years, 6 months ago (2017-05-31 21:10:29 UTC) #120
msramek
https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/300001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode195 content/browser/browsing_data/clear_site_data_throttle.cc:195: if (message.url == last_seen_url) { On 2017/05/30 22:58:35, mmenke ...
3 years, 6 months ago (2017-06-01 22:02:28 UTC) #129
msramek
On 2017/05/31 21:10:29, mmenke wrote: > One other thing: You should probably add the new ...
3 years, 6 months ago (2017-06-01 22:03:20 UTC) #130
mmenke
Going to punt this until Monday, just because you're OOO. Hope to sign off on ...
3 years, 6 months ago (2017-06-02 19:42:34 UTC) #137
mmenke
Response to an old comment (Sending it separately to reduce chance it's overlooked) https://codereview.chromium.org/2368923003/diff/400001/content/browser/browsing_data/clear_site_data_throttle.cc File ...
3 years, 6 months ago (2017-06-05 21:05:50 UTC) #138
mmenke
Still need a final pass on the browser tests https://codereview.chromium.org/2368923003/diff/400001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/400001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode224 content/browser/browsing_data/clear_site_data_throttle.cc:224: ...
3 years, 6 months ago (2017-06-05 22:39:37 UTC) #139
mmenke
Forgot one nit. https://codereview.chromium.org/2368923003/diff/460001/content/browser/browsing_data/clear_site_data_throttle.cc File content/browser/browsing_data/clear_site_data_throttle.cc (right): https://codereview.chromium.org/2368923003/diff/460001/content/browser/browsing_data/clear_site_data_throttle.cc#newcode283 content/browser/browsing_data/clear_site_data_throttle.cc:283: return std::unique_ptr<ResourceThrottle>(); These two returns can ...
3 years, 6 months ago (2017-06-05 22:42:36 UTC) #140
mmenke
Just one question on the browser test, and we're done at long last. :) https://codereview.chromium.org/2368923003/diff/460001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc ...
3 years, 6 months ago (2017-06-06 16:16:09 UTC) #141
msramek
I addressed the latest round of comments, PTAL! (Also, no worries about delays - this ...
3 years, 6 months ago (2017-06-06 18:20:58 UTC) #144
mmenke
LGTM! https://codereview.chromium.org/2368923003/diff/460001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc File content/browser/browsing_data/clear_site_data_throttle_browsertest.cc (right): https://codereview.chromium.org/2368923003/diff/460001/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc#newcode805 content/browser/browsing_data/clear_site_data_throttle_browsertest.cc:805: url = https_server()->GetURL("origin1.com", "/resource"); On 2017/06/06 18:20:57, msramek ...
3 years, 6 months ago (2017-06-06 18:30:57 UTC) #145
msramek
Thanks! \o/
3 years, 6 months ago (2017-06-06 18:43:31 UTC) #147
msramek
+Max, +John, please have a look as well. Max: Changes in the fuzzer. The tested ...
3 years, 6 months ago (2017-06-06 18:44:33 UTC) #149
mmoroz
LGTM for fuzzer changes https://codereview.chromium.org/2368923003/diff/480001/content/test/fuzzer/clear_site_data_fuzzer.cc File content/test/fuzzer/clear_site_data_fuzzer.cc (right): https://codereview.chromium.org/2368923003/diff/480001/content/test/fuzzer/clear_site_data_fuzzer.cc#newcode7 content/test/fuzzer/clear_site_data_fuzzer.cc:7: #include <vector> nit: #include <string> ...
3 years, 6 months ago (2017-06-06 18:53:44 UTC) #150
jam
lgtm https://codereview.chromium.org/2368923003/diff/480001/content/public/test/mock_browsing_data_remover_delegate.h File content/public/test/mock_browsing_data_remover_delegate.h (right): https://codereview.chromium.org/2368923003/diff/480001/content/public/test/mock_browsing_data_remover_delegate.h#newcode19 content/public/test/mock_browsing_data_remover_delegate.h:19: : public content::BrowsingDataRemoverDelegate { nit: this whole file ...
3 years, 6 months ago (2017-06-07 01:19:16 UTC) #153
msramek
Thanks everyone! Landing this now :) https://codereview.chromium.org/2368923003/diff/480001/content/public/test/mock_browsing_data_remover_delegate.h File content/public/test/mock_browsing_data_remover_delegate.h (right): https://codereview.chromium.org/2368923003/diff/480001/content/public/test/mock_browsing_data_remover_delegate.h#newcode19 content/public/test/mock_browsing_data_remover_delegate.h:19: : public content::BrowsingDataRemoverDelegate ...
3 years, 6 months ago (2017-06-07 09:53:07 UTC) #154
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/2368923003/500001
3 years, 6 months ago (2017-06-07 09:54:02 UTC) #157
commit-bot: I haz the power
3 years, 6 months ago (2017-06-07 11:23:33 UTC) #160
Message was sent while issue was closed.
Committed patchset #17 (id:500001) as
https://chromium.googlesource.com/chromium/src/+/9bc8902cf5825d5cbcdbf2b77662...

Powered by Google App Engine
This is Rietveld 408576698