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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 2406423003: Remove MessageLoop::current() from history_service.cc (Closed)
Patch Set: CR sdefresne #11 Created 4 years, 2 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/history/core/browser/history_backend.cc
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index 166921d35f49382abad71db0023e596e36b0f9c5..50383baf27d5b2e8e65f2c573ae4e6787671ff30 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -17,7 +17,6 @@
#include "base/compiler_specific.h"
#include "base/files/file_enumerator.h"
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
#include "base/sequenced_task_runner.h"
@@ -213,7 +212,6 @@ HistoryBackend::HistoryBackend(
scheduled_kill_db_(false),
expirer_(this, backend_client.get(), task_runner),
recent_redirects_(kMaxRedirectCount),
- backend_destroy_message_loop_(nullptr),
segment_queried_(false),
backend_client_(std::move(backend_client)),
task_runner_(task_runner) {}
@@ -230,9 +228,8 @@ HistoryBackend::~HistoryBackend() {
if (!backend_destroy_task_.is_null()) {
// Notify an interested party (typically a unit test) that we're done.
- DCHECK(backend_destroy_message_loop_);
- backend_destroy_message_loop_->task_runner()->PostTask(
- FROM_HERE, backend_destroy_task_);
+ DCHECK(backend_destroy_task_runner_);
+ backend_destroy_task_runner_->PostTask(FROM_HERE, backend_destroy_task_);
}
#if defined(OS_ANDROID)
@@ -257,11 +254,12 @@ void HistoryBackend::Init(
base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this))));
}
-void HistoryBackend::SetOnBackendDestroyTask(base::MessageLoop* message_loop,
- const base::Closure& task) {
+void HistoryBackend::SetOnBackendDestroyTask(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ const base::Closure& task) {
if (!backend_destroy_task_.is_null())
DLOG(WARNING) << "Setting more than one destroy task, overriding";
- backend_destroy_message_loop_ = message_loop;
+ backend_destroy_task_runner_ = std::move(task_runner);
backend_destroy_task_ = task;
}
« no previous file with comments | « components/history/core/browser/history_backend.h ('k') | components/history/core/browser/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698