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

Unified Diff: chrome/browser/prerender/prerender_manager.cc

Issue 1143343005: chrome/browser: 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, 6 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/prerender/prerender_manager.cc
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc
index 58d621582227854b8d95193d548376a14f82a486..f06bb5b7a2df586c85c6c997dd96505d9b81c2f5 100644
--- a/chrome/browser/prerender/prerender_manager.cc
+++ b/chrome/browser/prerender/prerender_manager.cc
@@ -11,8 +11,11 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/location.h"
#include "base/logging.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 "base/timer/elapsed_timer.h"
#include "base/values.h"
@@ -122,7 +125,8 @@ class PrerenderManager::OnCloseWebContentsDeleter
tab_(tab),
suppressed_dialog_(false) {
tab_->SetDelegate(this);
- base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
base::Bind(&OnCloseWebContentsDeleter::ScheduleWebContentsForDeletion,
AsWeakPtr(), true),
base::TimeDelta::FromSeconds(kDeleteWithExtremePrejudiceSeconds));
@@ -1041,9 +1045,8 @@ void PrerenderManager::PeriodicCleanup() {
void PrerenderManager::PostCleanupTask() {
DCHECK(CalledOnValidThread());
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&PrerenderManager::PeriodicCleanup, AsWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&PrerenderManager::PeriodicCleanup, AsWeakPtr()));
}
base::TimeTicks PrerenderManager::GetExpiryTimeForNewPrerender(

Powered by Google App Engine
This is Rietveld 408576698