Chromium Code Reviews| Index: chrome/browser/extensions/activity_log/activity_log.cc |
| diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc |
| index f2b38ba97372581f83387c85c23dc65cb37cadb7..e9219999d2de6f6935b087d6f22b31db34228602 100644 |
| --- a/chrome/browser/extensions/activity_log/activity_log.cc |
| +++ b/chrome/browser/extensions/activity_log/activity_log.cc |
| @@ -132,7 +132,8 @@ ActivityLogFactory::~ActivityLogFactory() { |
| void ActivityLog::SetDefaultPolicy(ActivityLogPolicy::PolicyType policy_type) { |
| // Can't use IsLogEnabled() here because this is called from inside Init. |
| if (policy_type != policy_type_ && enabled_) { |
| - delete policy_; |
| + if (policy_) |
| + policy_->Close(); |
|
felt
2013/07/09 22:14:51
What if Close() hasn't finished before policy is r
mvrable
2013/07/09 23:03:22
That occurred to me earlier; I think the current c
felt
2013/07/10 00:14:36
At present, I don't expect this code path will be
mvrable
2013/07/10 17:49:17
I've changed this to a CHECK to catch cases where
felt
2013/07/10 18:35:17
LogWithoutArguments should be triggering this code
mvrable
2013/07/10 18:53:56
I somehow missed this since I wasn't running that
mvrable
2013/07/10 20:48:41
I convinced myself (and Adrienne, in an offline di
|
| switch (policy_type) { |
| case ActivityLogPolicy::POLICY_FULLSTREAM: |
| policy_ = new FullStreamUIPolicy(profile_); |
| @@ -207,8 +208,7 @@ void ActivityLog::Shutdown() { |
| } |
| ActivityLog::~ActivityLog() { |
| - // TODO(felt): Turn policy_ into a scoped_ptr. |
| - delete policy_; |
| + policy_->Close(); |
| } |
| bool ActivityLog::IsLogEnabled() { |