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

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

Issue 2171383002: Deprecate the CallbackSubscription in BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize masks to -1 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 52b67d6362b13444cdbac5e84f6593d228bf78ea..7d18345e2d39f03ae1a852f29043b00acffe089b 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.h
+++ b/chrome/browser/browsing_data/browsing_data_remover.h
@@ -144,28 +144,6 @@ class BrowsingDataRemover : public KeyedService
MAX_CHOICE_VALUE
};
- // When BrowsingDataRemover successfully removes data, a notification of type
- // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of
- // this type.
- struct NotificationDetails {
- NotificationDetails();
- NotificationDetails(const NotificationDetails& details);
- NotificationDetails(base::Time removal_begin,
- int removal_mask,
- int origin_type_mask);
- ~NotificationDetails();
-
- // The beginning of the removal time range.
- base::Time removal_begin;
-
- // The removal mask (see the RemoveDataMask enum for details).
- int removal_mask;
-
- // The origin type mask (see BrowsingDataHelper::OriginTypeMask for
- // details).
- int origin_type_mask;
- };
-
struct TimeRange {
TimeRange(base::Time begin, base::Time end) : begin(begin), end(end) {}
bool operator==(const TimeRange& other) const;
@@ -192,10 +170,6 @@ class BrowsingDataRemover : public KeyedService
virtual ~Observer() {}
};
- using Callback = base::Callback<void(const NotificationDetails&)>;
- using CallbackSubscription = std::unique_ptr<
- base::CallbackList<void(const NotificationDetails&)>::Subscription>;
-
// The completion inhibitor can artificially delay completion of the browsing
// data removal process. It is used during testing to simulate scenarios in
// which the deletion stalls or takes a very long time.
@@ -228,14 +202,6 @@ class BrowsingDataRemover : public KeyedService
completion_inhibitor_ = inhibitor;
}
- // Add a callback to the list of callbacks to be called during a browsing data
- // removal event. Returns a subscription object that can be used to
- // un-register the callback.
- // TODO(crbug.com/483528): Make this non-static and merge it with the Observer
- // interface.
- static CallbackSubscription RegisterOnBrowsingDataRemovedCallback(
- const Callback& callback);
-
// Removes the specified items related to browsing for all origins that match
// the provided |origin_type_mask| (see BrowsingDataHelper::OriginTypeMask).
void Remove(const TimeRange& time_range,
@@ -265,6 +231,15 @@ class BrowsingDataRemover : public KeyedService
std::unique_ptr<WebappRegistry> webapp_registry);
#endif
+ // Parameters of the last call are exposed to be used by tests. Removal and
+ // origin type masks equal to -1 mean that no removal has ever been executed.
+ // TODO(msramek): If other consumers than tests are interested in this,
+ // consider returning them in OnBrowsingDataRemoverDone() callback.
+ const base::Time& GetLastUsedBeginTime();
+ const base::Time& GetLastUsedEndTime();
+ int GetLastUsedRemovalMask();
+ int GetLastUsedOriginTypeMask();
+
protected:
// Use BrowsingDataRemoverFactory::GetForBrowserContext to get an instance of
// this class. The constructor is protected so that the class is mockable.
« 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