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

Issue 1603903002: Add an OriginFilterBuilder class for [white|black]listing origins. (Closed)

Created:
4 years, 11 months ago by msramek
Modified:
4 years, 10 months ago
CC:
asanka, cbentzel+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, markusheintz_
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add an OriginFilterBuilder class for [white|black]listing origins. We already have at least two different usecases for origin-based browsing data deletion - by whitelist (delete the data of one or more particular sites) or blacklist (clear browsing data, but protect a certain set of sites that are deemed valuable). Furthermore, the deletion might be done on a particular origin, or including subdomains (could be decided on a per-backend basis, settable by an advanced user, or a product decision). To avoid plumbing this functionality separately into all backends, we instead pass a GURL->bool predicate to individual backends that they can use as a blackbox to evaluate whether a certain URL should be deleted. We introduce an OriginFilterBuilder class that constructs such predicates. To illustrate the usage of the new API, we also modify the origin-based deletion in DownloadManager. See https://docs.google.com/document/d/12UeAMGOk9MDFwrT9kfNldL4qnUIfnIdVbQSk-hb-mWg/ for more details. BUG=578162 Committed: https://crrev.com/d9c162ad0a240aa967c247f5be258056d6a4efbf Cr-Commit-Position: refs/heads/master@{#376967}

Patch Set 1 : #

Total comments: 6

Patch Set 2 : Move to browsing_data/, pass around callback #

Patch Set 3 : Rebase. #

Patch Set 4 : Fixed content_unittests. #

Total comments: 26

Patch Set 5 : Builder pattern #

Total comments: 6

Patch Set 6 : Empty filter. #

Total comments: 21

Patch Set 7 : Lifetime management. #

Total comments: 4

Patch Set 8 : DCHECK(not many origins) #

Total comments: 3

Patch Set 9 : History TODO. #

Patch Set 10 : Rebase over 1246583002 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -60 lines) Patch
M chrome/browser/android/download/download_manager_service_unittest.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover.cc View 1 2 3 4 5 6 7 8 4 chunks +21 lines, -6 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 3 4 5 6 5 chunks +64 lines, -4 lines 0 comments Download
A chrome/browser/browsing_data/origin_filter_builder.h View 1 2 3 4 5 6 1 chunk +70 lines, -0 lines 0 comments Download
A chrome/browser/browsing_data/origin_filter_builder.cc View 1 2 3 4 5 6 7 1 chunk +111 lines, -0 lines 0 comments Download
A chrome/browser/browsing_data/origin_filter_builder_unittest.cc View 1 2 3 4 5 6 1 chunk +140 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +19 lines, -23 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -5 lines 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -11 lines 0 comments Download
M content/public/test/mock_download_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 49 (20 generated)
msramek
Hello guys, can you have a look? Mike and Daniel - this is the implementation ...
4 years, 10 months ago (2016-02-01 16:37:26 UTC) #14
dmurph
On 2016/02/01 at 16:37:26, msramek wrote: > Hello guys, > > can you have a ...
4 years, 10 months ago (2016-02-01 19:21:08 UTC) #15
brettw
I left a comment in the doc. It seems better to me if we can ...
4 years, 10 months ago (2016-02-01 22:48:25 UTC) #16
msramek
I didn't have time to get to this CL today, so just to respond. Brett ...
4 years, 10 months ago (2016-02-02 18:29:15 UTC) #17
msramek
+ttr314@googlemail.com I'm CC-ing you so that we can coordinate with your work on crbug.com/113968. I'm ...
4 years, 10 months ago (2016-02-05 09:42:34 UTC) #18
Timo Reimann
On 2016/02/05 09:42:34, msramek wrote: > mailto:+ttr314@googlemail.com > > I'm CC-ing you so that we ...
4 years, 10 months ago (2016-02-05 10:34:06 UTC) #19
msramek
Please have another look! I'm now passing around const base::Callback<bool(const GURL&)>&, as per Brett's suggestion. ...
4 years, 10 months ago (2016-02-05 17:16:35 UTC) #20
Timo Reimann
Just my 2 cents. :-) https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode267 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:267: // TODO(msramek): This is ...
4 years, 10 months ago (2016-02-05 19:01:24 UTC) #22
brettw
https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/origin_filter_builder.cc File chrome/browser/browsing_data/origin_filter_builder.cc (right): https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/origin_filter_builder.cc#newcode52 chrome/browser/browsing_data/origin_filter_builder.cc:52: bool OriginFilterBuilder::MatchesURLWithSubdomains(const GURL& url) const { Since you have ...
4 years, 10 months ago (2016-02-05 21:26:04 UTC) #23
msramek
https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/1603903002/diff/260001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode267 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:267: // TODO(msramek): This is only used for backends that ...
4 years, 10 months ago (2016-02-10 14:30:37 UTC) #25
Timo Reimann
Sorry for the late second round -- I noticed another two smallish things only after ...
4 years, 10 months ago (2016-02-11 22:46:43 UTC) #27
msramek
https://codereview.chromium.org/1603903002/diff/300001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/1603903002/diff/300001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode2227 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:2227: base::Callback<bool(const GURL&)> filter = builder.BuildSameOriginFilter(); On 2016/02/11 22:46:43, Timo ...
4 years, 10 months ago (2016-02-12 14:24:50 UTC) #28
Timo Reimann
https://codereview.chromium.org/1603903002/diff/300001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/1603903002/diff/300001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode2227 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:2227: base::Callback<bool(const GURL&)> filter = builder.BuildSameOriginFilter(); On 2016/02/12 14:24:50, msramek ...
4 years, 10 months ago (2016-02-15 07:39:15 UTC) #29
msramek
Mike, friendly ping! Can you please review as the owner of browsing_data/ ?
4 years, 10 months ago (2016-02-17 10:58:25 UTC) #30
Timo Reimann
https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.cc File chrome/browser/browsing_data/origin_filter_builder.cc (right): https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.cc#newcode59 chrome/browser/browsing_data/origin_filter_builder.cc:59: return base::Bind(&OriginFilterBuilder::MatchesURL, base::Unretained(this)); As discussed with Martin, the current ...
4 years, 10 months ago (2016-02-17 14:59:23 UTC) #31
Mike West
The changes to c/b/browsing_data/browsing_data_remover* look good to me. I have a few questions about the ...
4 years, 10 months ago (2016-02-17 15:22:10 UTC) #32
brettw
https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.h File chrome/browser/browsing_data/origin_filter_builder.h (right): https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.h#newcode32 chrome/browser/browsing_data/origin_filter_builder.h:32: OriginFilterBuilder* AddOrigin(const url::Origin& origin); Thanks for the update on ...
4 years, 10 months ago (2016-02-17 20:34:24 UTC) #33
Mike West
https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.h File chrome/browser/browsing_data/origin_filter_builder.h (right): https://codereview.chromium.org/1603903002/diff/320001/chrome/browser/browsing_data/origin_filter_builder.h#newcode46 chrome/browser/browsing_data/origin_filter_builder.h:46: base::Callback<bool(const GURL&)> BuildDomainFilter(); On 2016/02/17 at 20:34:24, brettw wrote: ...
4 years, 10 months ago (2016-02-18 10:50:31 UTC) #34
msramek
I fixed the problems with origin_list_ lifetime, and I think the entire concept is much ...
4 years, 10 months ago (2016-02-18 12:48:43 UTC) #35
Mike West
https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc File chrome/browser/browsing_data/origin_filter_builder.cc (right): https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc#newcode57 chrome/browser/browsing_data/origin_filter_builder.cc:57: base::Owned(origins), mode_); Copying the list makes sense if we're ...
4 years, 10 months ago (2016-02-19 07:07:33 UTC) #36
msramek
https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc File chrome/browser/browsing_data/origin_filter_builder.cc (right): https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc#newcode57 chrome/browser/browsing_data/origin_filter_builder.cc:57: base::Owned(origins), mode_); On 2016/02/19 07:07:32, Mike West wrote: > ...
4 years, 10 months ago (2016-02-19 12:02:11 UTC) #37
Mike West
On 2016/02/19 at 12:02:11, msramek wrote: > https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc > File chrome/browser/browsing_data/origin_filter_builder.cc (right): > > https://codereview.chromium.org/1603903002/diff/340001/chrome/browser/browsing_data/origin_filter_builder.cc#newcode57 ...
4 years, 10 months ago (2016-02-19 14:14:02 UTC) #38
msramek
Thanks, Mike. I'll leave the metrics to a follow-up CL, since I'm apparently blocking people ...
4 years, 10 months ago (2016-02-22 17:27:44 UTC) #39
brettw
lgtm https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode399 chrome/browser/browsing_data/browsing_data_remover.cc:399: // TODO(msramek): Investigate whether history deletion, especially in ...
4 years, 10 months ago (2016-02-22 23:23:59 UTC) #40
msramek
https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsing_data/browsing_data_remover.cc File chrome/browser/browsing_data/browsing_data_remover.cc (right): https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsing_data/browsing_data_remover.cc#newcode399 chrome/browser/browsing_data/browsing_data_remover.cc:399: // TODO(msramek): Investigate whether history deletion, especially in the ...
4 years, 10 months ago (2016-02-23 09:21:40 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1603903002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1603903002/400001
4 years, 10 months ago (2016-02-23 09:58:57 UTC) #44
commit-bot: I haz the power
Committed patchset #10 (id:400001)
4 years, 10 months ago (2016-02-23 11:17:29 UTC) #46
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/d9c162ad0a240aa967c247f5be258056d6a4efbf Cr-Commit-Position: refs/heads/master@{#376967}
4 years, 10 months ago (2016-02-23 11:18:56 UTC) #48
brettw
4 years, 10 months ago (2016-02-23 17:53:23 UTC) #49
Message was sent while issue was closed.
https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsin...
File chrome/browser/browsing_data/browsing_data_remover.cc (right):

https://codereview.chromium.org/1603903002/diff/360001/chrome/browser/browsin...
chrome/browser/browsing_data/browsing_data_remover.cc:399: // TODO(msramek):
Investigate whether history deletion, especially in the
I'm not sure why anybody serverside would be necessary. The browser history
service can just delete matching URLs and those deletions will by synced around.

Powered by Google App Engine
This is Rietveld 408576698