|
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}
Total comments: 2
|
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
|
Total messages: 41 (32 generated)
|