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

Unified Diff: chrome/browser/local_discovery/privet_notifications.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/local_discovery/privet_notifications.cc
diff --git a/chrome/browser/local_discovery/privet_notifications.cc b/chrome/browser/local_discovery/privet_notifications.cc
index 493d8ee9b6b422fb45ec956bac6c67ec09312dac..23945cb4b4c0bb8e17b41bd77a4363faf70c2167 100644
--- a/chrome/browser/local_discovery/privet_notifications.cc
+++ b/chrome/browser/local_discovery/privet_notifications.cc
@@ -6,11 +6,13 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/rand_util.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/local_discovery/privet_device_lister_impl.h"
#include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h"
@@ -196,11 +198,10 @@ PrivetNotificationsListener::DeviceContext::~DeviceContext() {
PrivetNotificationService::PrivetNotificationService(
content::BrowserContext* profile)
: profile_(profile) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&PrivetNotificationService::Start, AsWeakPtr()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&PrivetNotificationService::Start, AsWeakPtr()),
base::TimeDelta::FromSeconds(kStartDelaySeconds +
- base::RandInt(0, kStartDelaySeconds/4)));
+ base::RandInt(0, kStartDelaySeconds / 4)));
}
PrivetNotificationService::~PrivetNotificationService() {
« no previous file with comments | « chrome/browser/local_discovery/privet_http_unittest.cc ('k') | chrome/browser/local_discovery/privet_traffic_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698