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

Unified Diff: chrome/browser/browsing_data/browsing_data_remover.h

Issue 2161583002: Make BrowsingDataRemover mockable and filter builders comparable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_remover.h
diff --git a/chrome/browser/browsing_data/browsing_data_remover.h b/chrome/browser/browsing_data/browsing_data_remover.h
index 9e12be054b20b9017f3bf3c858329eb5e34f4cd3..1b302762e35a031dcc731f37df3fc3267f933224 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.h
+++ b/chrome/browser/browsing_data/browsing_data_remover.h
@@ -170,6 +170,7 @@ class BrowsingDataRemover : public KeyedService
struct TimeRange {
TimeRange(base::Time begin, base::Time end) : begin(begin), end(end) {}
+ bool operator==(const TimeRange& other) const;
base::Time begin;
base::Time end;
@@ -241,10 +242,10 @@ class BrowsingDataRemover : public KeyedService
// TODO(dmurph): Support all backends with filter (crbug.com/113621).
// DO NOT USE THIS METHOD UNLESS CALLER KNOWS WHAT THEY'RE DOING. NOT ALL
// BACKENDS ARE SUPPORTED YET, AND MORE DATA THAN EXPECTED COULD BE DELETED.
- void RemoveWithFilter(const TimeRange& time_range,
- int remove_mask,
- int origin_type_mask,
- const BrowsingDataFilterBuilder& origin_filter);
+ virtual void RemoveWithFilter(const TimeRange& time_range,
+ int remove_mask,
+ int origin_type_mask,
+ const BrowsingDataFilterBuilder& origin_filter);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -258,6 +259,12 @@ class BrowsingDataRemover : public KeyedService
std::unique_ptr<WebappRegistry> webapp_registry);
#endif
+ protected:
+ // Use BrowsingDataRemoverFactory::GetForBrowserContext to get an instance of
+ // this class. The constructor is protected so that the class is mockable.
+ BrowsingDataRemover(content::BrowserContext* browser_context);
+ ~BrowsingDataRemover() override;
+
private:
// The clear API needs to be able to toggle removing_ in order to test that
// only one BrowsingDataRemover instance can be called at a time.
@@ -286,11 +293,6 @@ class BrowsingDataRemover : public KeyedService
bool(const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern)>& predicate);
- // Use BrowsingDataRemoverFactory::GetForBrowserContext to get an instance of
- // this class.
- BrowsingDataRemover(content::BrowserContext* browser_context);
- ~BrowsingDataRemover() override;
-
void Shutdown() override;
// Setter for |is_removing_|; DCHECKs that we can only start removing if we're
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698