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

Unified Diff: chrome/browser/extensions/activity_log/activity_database.cc

Issue 2980503002: [Extensions][TaskScheduler] Update ActivityLog for scheduling migration (Closed)
Patch Set: . Created 3 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_database.cc
diff --git a/chrome/browser/extensions/activity_log/activity_database.cc b/chrome/browser/extensions/activity_log/activity_database.cc
index 2b4bc9b26646a640b2363986c4ec504d8b723037..baf2743cf5f14c796799fe408336f53380180efa 100644
--- a/chrome/browser/extensions/activity_log/activity_database.cc
+++ b/chrome/browser/extensions/activity_log/activity_database.cc
@@ -10,11 +10,10 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
-#include "base/threading/thread.h"
-#include "base/threading/thread_checker.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "chrome/browser/extensions/activity_log/activity_log_task_runner.h"
#include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h"
#include "chrome/common/chrome_switches.h"
#include "sql/error_delegate_util.h"
@@ -26,8 +25,6 @@
#include "base/mac/mac_util.h"
#endif
-using content::BrowserThread;
-
namespace extensions {
// A size threshold at which data should be flushed to the database. The
@@ -56,11 +53,13 @@ ActivityDatabase::ActivityDatabase(ActivityDatabase::Delegate* delegate)
ActivityDatabase::~ActivityDatabase() {}
void ActivityDatabase::Init(const base::FilePath& db_name) {
- if (did_init_) return;
+ LOG(WARNING) << "INITING";
+ if (did_init_)
+ return;
did_init_ = true;
- if (BrowserThread::IsMessageLoopValid(BrowserThread::DB))
- DCHECK_CURRENTLY_ON(BrowserThread::DB);
+ DCHECK(GetActivityLogTaskRunner()->RunsTasksInCurrentSequence());
db_.set_histogram_tag("Activity");
+ LOG(WARNING) << "Set callback";
db_.set_error_callback(
base::Bind(&ActivityDatabase::DatabaseErrorCallback,
base::Unretained(this)));
@@ -140,12 +139,10 @@ void ActivityDatabase::SetBatchModeForTesting(bool batch_mode) {
}
sql::Connection* ActivityDatabase::GetSqlConnection() {
- if (BrowserThread::IsMessageLoopValid(BrowserThread::DB))
- DCHECK_CURRENTLY_ON(BrowserThread::DB);
+ DCHECK(GetActivityLogTaskRunner()->RunsTasksInCurrentSequence());
if (valid_db_) {
return &db_;
} else {
- LOG(WARNING) << "Activity log database is not valid";
return NULL;
}
}
« no previous file with comments | « chrome/browser/extensions/BUILD.gn ('k') | chrome/browser/extensions/activity_log/activity_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698