Chromium Code Reviews| Index: chrome/browser/extensions/activity_log/fullstream_ui_policy.cc |
| diff --git a/chrome/browser/extensions/activity_log/fullstream_ui_policy.cc b/chrome/browser/extensions/activity_log/fullstream_ui_policy.cc |
| index 654f6c1168351bf696d7495a9979172c082e6484..e6da9d2697557f23e2eaa82dc794b97f07c869ae 100644 |
| --- a/chrome/browser/extensions/activity_log/fullstream_ui_policy.cc |
| +++ b/chrome/browser/extensions/activity_log/fullstream_ui_policy.cc |
| @@ -43,13 +43,33 @@ namespace extensions { |
| FullStreamUIPolicy::FullStreamUIPolicy(Profile* profile) |
| : ActivityLogPolicy(profile) { |
| - db_ = new ActivityDatabase(); |
| + db_ = new ActivityDatabase(this); |
| FilePath database_name = profile_base_path_.Append( |
| chrome::kExtensionActivityLogFilename); |
| ScheduleAndForget(db_, &ActivityDatabase::Init, database_name); |
| } |
| -FullStreamUIPolicy::~FullStreamUIPolicy() { |
| +bool FullStreamUIPolicy::DatabaseInitCallback(sql::Connection* db) { |
| + // Create the DOMAction database. |
|
Matt Perry
2013/07/10 23:19:30
nit: these comments are redundant
mvrable
2013/07/11 17:30:33
Deleted, though all this code will be gone soon in
|
| + if (!DOMAction::InitializeTable(db)) |
| + return false; |
| + |
| + // Create the APIAction database. |
| + if (!APIAction::InitializeTable(db)) |
| + return false; |
| + |
| + // Create the BlockedAction database. |
| + if (!BlockedAction::InitializeTable(db)) |
| + return false; |
| + |
| + return true; |
| +} |
| + |
| +void FullStreamUIPolicy::DatabaseCloseCallback() { |
| + delete this; |
| +} |
| + |
| +void FullStreamUIPolicy::Close() { |
| // The policy object should have never been created if there's no DB thread. |
| DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::DB)); |
| ScheduleAndForget(db_, &ActivityDatabase::Close); |
| @@ -70,11 +90,6 @@ void FullStreamUIPolicy::ReadData( |
| callback); |
| } |
| -void FullStreamUIPolicy::SetSaveStateOnRequestOnly() { |
| - ScheduleAndForget(db_, &ActivityDatabase::SetBatchModeForTesting, false); |
| - ActivityLogPolicy::SetSaveStateOnRequestOnly(); |
| -} |
| - |
| std::string FullStreamUIPolicy::GetKey(ActivityLogPolicy::KeyType key_ty) const |
| { |
| switch (key_ty) { |