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

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

Issue 10898002: Refactor BrowsingDataRemover creation for clarity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating callsites. Created 8 years, 4 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
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 5a1e9f879cdc69e42903523f76d99839a1808261..bf449e2336a95e41e94a1c24a36a6f0d2afe8230 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.h
+++ b/chrome/browser/browsing_data/browsing_data_remover.h
@@ -116,15 +116,25 @@ class BrowsingDataRemover : public content::NotificationObserver,
virtual ~Observer() {}
};
- // Creates a BrowsingDataRemover to remove browser data from the specified
- // profile in the specified time range. Use Remove to initiate the removal.
- BrowsingDataRemover(Profile* profile, base::Time delete_begin,
- base::Time delete_end);
+ // Creates a BrowsingDataRemover object that removes data regardless of the
+ // time it was last modified.
+ static BrowsingDataRemover* CreateForUnboundedRange(Profile* profile);
- // Creates a BrowsingDataRemover to remove browser data from the specified
- // profile in the specified time range.
- BrowsingDataRemover(Profile* profile, TimePeriod time_period,
- base::Time delete_end);
+ // Creates a BrowsingDataRemover object bound on both sides by a time.
+ static BrowsingDataRemover* CreateForRange(Profile* profile,
+ base::Time delete_begin,
+ base::Time delete_end);
+
+ // Creates a BrowsingDataRemover bound to a specific period of time (as
+ // defined via a TimePeriod).
+ static BrowsingDataRemover* CreateForPeriod(Profile* profile,
+ TimePeriod deletionPeriod);
+
+ // Quota managed data uses a different bitmask for types than
+ // BrowsingDataRemover uses. This method generates that mask.
+ static int GenerateQuotaClientMask(int remove_mask);
+
+ static bool is_removing() { return removing_; }
markusheintz_ 2012/08/28 13:10:23 Please add a comment about the meaning of the retu
Mike West 2012/08/28 13:28:39 Done.
// Removes the specified items related to browsing for all origins that match
// the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask).
@@ -136,15 +146,9 @@ class BrowsingDataRemover : public content::NotificationObserver,
// Called when history deletion is done.
void OnHistoryDeletionDone();
- // Quota managed data uses a different bitmask for types than
- // BrowsingDataRemover uses. This method generates that mask.
- static int GenerateQuotaClientMask(int remove_mask);
-
// Used for testing.
void OverrideQuotaManagerForTesting(quota::QuotaManager* quota_manager);
- static bool is_removing() { return removing_; }
-
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.
@@ -167,6 +171,12 @@ class BrowsingDataRemover : public content::NotificationObserver,
STATE_DONE
};
+ // Creates a BrowsingDataRemover to remove browser data from the specified
+ // profile in the specified time range. Use Remove to initiate the removal.
+ // The constructor is private: use the static Create* methods instead.
markusheintz_ 2012/08/28 13:10:23 I think this line is not needed. The pure existenc
Mike West 2012/08/28 13:28:39 Done.
+ BrowsingDataRemover(Profile* profile, base::Time delete_begin,
+ base::Time delete_end);
+
// BrowsingDataRemover deletes itself (using DeleteHelper) and is not supposed
// to be deleted by other objects so make destructor private and DeleteHelper
// a friend.
@@ -287,7 +297,7 @@ class BrowsingDataRemover : public content::NotificationObserver,
void OnClearedFormData();
// Calculate the begin time for the deletion range specified by |time_period|.
- base::Time CalculateBeginDeleteTime(TimePeriod time_period);
+ static base::Time CalculateBeginDeleteTime(TimePeriod time_period);
markusheintz_ 2012/08/28 13:10:23 Now that this method is static, please move the me
Mike West 2012/08/28 13:28:39 Done.
// Returns true if we're all done.
bool AllDone();
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698