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

Unified Diff: chrome/browser/extensions/activity_log/activity_log_policy.h

Issue 18660004: Extension activity log database refactoring (step 1) (Closed) Base URL: http://git.chromium.org/chromium/src.git@incognito-tests
Patch Set: Change lifetime management for policies Created 7 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
Index: chrome/browser/extensions/activity_log/activity_log_policy.h
diff --git a/chrome/browser/extensions/activity_log/activity_log_policy.h b/chrome/browser/extensions/activity_log/activity_log_policy.h
index ce6ca0799182a0db67dcedb5994128f76dd3469d..d4267ff8437abfcd38a59b227f29ebf61555349c 100644
--- a/chrome/browser/extensions/activity_log/activity_log_policy.h
+++ b/chrome/browser/extensions/activity_log/activity_log_policy.h
@@ -72,7 +72,8 @@ class ActivityLogPolicy {
// TODO(felt,dbabic) Since only ReadData uses thread_id, it would be
// cleaner to pass thread_id as a param of ReadData directly.
explicit ActivityLogPolicy(Profile* profile);
- virtual ~ActivityLogPolicy();
+
+ virtual void Close() = 0;
// Updates the internal state of the model summarizing actions and possibly
// writes to the database. Implements the default policy storing internal
@@ -115,6 +116,10 @@ class ActivityLogPolicy {
virtual std::string GetKey(KeyType key_id) const;
protected:
+ // An ActivityLogPolicy is not directly destroyed. Instead, call Close()
+ // which will cause the object to be deleted when it is safe.
+ virtual ~ActivityLogPolicy();
+
// The Schedule methods dispatch the calls to the database on a
// separate thread. We dispatch to the UI thread if the DB thread doesn't
// exist, which should only happen in tests where there is no DB thread.
@@ -145,6 +150,9 @@ class ActivityLogPolicy {
base::FilePath profile_base_path_;
base::RepeatingTimer<ActivityLogPolicy> timer_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActivityLogPolicy);
felt 2013/07/09 22:14:51 yikes. is this missing in other policy files too?
mvrable 2013/07/09 23:03:22 Yes, it was missing in the ActivityLogPolicy subcl
felt 2013/07/10 00:14:36 If it's inherited, then nevermind. Thanks for catc
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698