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

Unified Diff: chrome/browser/ui/browser.cc

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Harmonize MessageLoop/TTRH usage. 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/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index e24eb7b54127253efdfe1f3784e16806617d5c29..e0bdfe4ba078325cee7f107f752a82cc1be9faa8 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -15,15 +15,18 @@
#include "base/base_paths.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/process/process_info.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
@@ -1160,7 +1163,7 @@ void Browser::TabStripEmpty() {
// Note: This will be called several times if TabStripEmpty is called several
// times. This is because it does not close the window if tabs are
// still present.
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&Browser::CloseFrame, weak_factory_.GetWeakPtr()));
// Instant may have visible WebContents that need to be detached before the
@@ -2191,10 +2194,9 @@ void Browser::ScheduleUIUpdate(WebContents* source,
if (!chrome_updater_factory_.HasWeakPtrs()) {
// No task currently scheduled, start another.
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&Browser::ProcessPendingUIUpdates,
- chrome_updater_factory_.GetWeakPtr()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&Browser::ProcessPendingUIUpdates,
+ chrome_updater_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kUIUpdateCoalescingTimeMS));
}
}

Powered by Google App Engine
This is Rietveld 408576698