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

Unified Diff: components/precache/core/precache_database.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 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: components/precache/core/precache_database.cc
diff --git a/components/precache/core/precache_database.cc b/components/precache/core/precache_database.cc
index aba25dbb09c8697d51d998bf58a0570646a162a3..7dfa0523bbea778c69fc68bbf2b8ccf9beb5f252 100644
--- a/components/precache/core/precache_database.cc
+++ b/components/precache/core/precache_database.cc
@@ -6,8 +6,10 @@
#include "base/bind.h"
#include "base/files/file_path.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/metrics/histogram.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "sql/connection.h"
#include "sql/transaction.h"
@@ -217,11 +219,10 @@ void PrecacheDatabase::MaybePostFlush() {
return;
}
- DCHECK(base::MessageLoop::current());
// Post a delayed task to flush the buffer in 1 second, so that multiple
// database writes can be buffered up and flushed together in the same
// transaction.
- base::MessageLoop::current()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, base::Bind(&PrecacheDatabase::PostedFlush,
scoped_refptr<PrecacheDatabase>(this)),
base::TimeDelta::FromSeconds(1));
« no previous file with comments | « components/precache/content/precache_manager_unittest.cc ('k') | components/precache/core/precache_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698