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

Issue 2578723002: Reduce BrowsingDataRemover's dependencies on Chrome (Closed)

Created:
4 years ago by msramek
Modified:
3 years, 11 months ago
CC:
cbentzel+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, davemoore+watch_chromium.org, dbeam+watch-settings_chromium.org, dbeam+watch-options_chromium.org, eroman, extensions-reviews_chromium.org, gavinp+prer_chromium.org, harkness+watch_chromium.org, johnme+watch_chromium.org, markusheintz_, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-options_chromium.org, mmenke, msramek+watch_chromium.org, oshima+watch_chromium.org, Peter Beverloo, stevenjb+watch-md-settings_chromium.org, tburkard+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce BrowsingDataRemover's dependencies on Chrome 1. Remove TimePeriod-related methods from BDR and its tests. Explanation: TimePeriod represents the deletion options provided in the Chrome UI, and is used in communication between Chrome UI and BDR, and thus there is no reason for content/ to know about it. In fact, if BDR was moved to content/ while still containing TimePeriod-related methods, we would have to introduce a new build target in components/ to make TimePeriod usable in all three of chrome/, ios/, and content/. 2. Remove the TimeRange class from BDR entirely. Explanation: TimeRange is a class inside BDR which would move to content/ together with it. The UI needs a way to convert TimePeriod to TimeRange. Such a conversion cannot live in content/ (which doesn't know about TimePeriod) nor components/ (which wouldn't know about TimeRange). It could be detached from BDR to a separate file in chrome/. However, the update cost of detaching it to a separate file is the same as breaking it into a pair of base::Time arguments. Here are reasons why the latter is better: -> It reduces the complexity of keeping two confusingly similar TimePeriod and TimeRange classes -> Consistency - basically all data storage backends, and also the BDRDelegate, have an interface with two base::Time arguments rather than base::TimeRange -> It can be argued that this definition does not logically belong to BDR; if anyone, it should be base/time/ who defines a class representing a base::Time interval class 3. Replace Profile with BrowserContext inside BDR (as that's the content/ equivalent). 4. Split the REMOVE_DOWNLOADS section to two parts. The first part (download history deletion) stays in content/, the second part (download path reset) moves to the embedder. 5. Add a comment explaining that the |may_delete_history| variable must be honored in content/ (while deleting download history), but must be provided by the embedder (from policy or supervised users) through ContentBrowserClient. This is not possible to fix while BDR is still in chrome/, as chrome/ cannot depend on ChromeContentBrowserClient. TBR=jochen@chromium.org BUG=668114 Committed: https://crrev.com/1c8e19d3f6a71793b80525aa995723ece0574756 Cr-Commit-Position: refs/heads/master@{#441440}

Patch Set 1 #

Total comments: 2

Patch Set 2 : AnHourAgo #

Patch Set 3 : Rebase (no conflicts) #

Patch Set 4 : A new callsite appeared through rebase - fixed the compilation error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+301 lines, -244 lines) Patch
M chrome/browser/android/preferences/pref_service_bridge.cc View 2 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/android/signin/signin_manager_android.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover.h View 14 chunks +24 lines, -29 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover.cc View 1 2 17 chunks +53 lines, -72 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 77 chunks +102 lines, -92 lines 0 comments Download
M chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc View 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 5 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chrome_content_browser_client_unittest.cc View 9 chunks +31 lines, -20 lines 0 comments Download
M chrome/browser/chromeos/profiles/profile_helper.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/browsing_data/browsing_data_api.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/browsing_data/browsing_data_test.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/net/errorpage_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/net/predictor_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/sdch_browsertest.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profile_resetter/profile_resetter.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/profiles/profiles_state.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_commands.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/net_internals/net_internals_ui.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/clear_browser_data_handler.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc View 1 2 1 chunk +5 lines, -2 lines 0 comments Download
M components/browsing_data/core/browsing_data_utils.h View 1 chunk +6 lines, -0 lines 0 comments Download
M components/browsing_data/core/browsing_data_utils.cc View 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (32 generated)
msramek
Hi Bernhard! Please have a look at this next CL in the process of content-ifying ...
4 years ago (2016-12-15 12:48:49 UTC) #14
Bernhard Bauer
LGTM https://codereview.chromium.org/2578723002/diff/40001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/2578723002/diff/40001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode399 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:399: base::Time HourAgo() { Small nit: AnHourAgo()?
4 years ago (2016-12-16 17:03:05 UTC) #17
msramek
Thanks Bernhard! +Dan PTAL at the changes in webui/ - it's just a replacement of ...
3 years, 11 months ago (2017-01-03 12:06:53 UTC) #24
jochen (gone - plz use gerrit)
lgtm
3 years, 11 months ago (2017-01-03 12:13:03 UTC) #27
Dan Beam
lgtm
3 years, 11 months ago (2017-01-04 18:56:53 UTC) #32
msramek
Thanks both!
3 years, 11 months ago (2017-01-04 19:09:49 UTC) #33
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/2578723002/100001
3 years, 11 months ago (2017-01-04 19:10:27 UTC) #36
commit-bot: I haz the power
Committed patchset #4 (id:100001)
3 years, 11 months ago (2017-01-04 20:05:25 UTC) #39
commit-bot: I haz the power
3 years, 11 months ago (2017-01-04 20:09:39 UTC) #41
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/1c8e19d3f6a71793b80525aa995723ece0574756
Cr-Commit-Position: refs/heads/master@{#441440}

Powered by Google App Engine
This is Rietveld 408576698