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

Unified Diff: chromeos/settings/timezone_settings.cc

Issue 2611433002: Use TaskScheduler instead of WorkerPool in timezone_settings.cc. (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/settings/timezone_settings.cc
diff --git a/chromeos/settings/timezone_settings.cc b/chromeos/settings/timezone_settings.cc
index 38ea65d653ac09e82014bf3bf3d3cd1542203c55..496e8879f4de02fd5bb41d499bb441398c1a4252 100644
--- a/chromeos/settings/timezone_settings.cc
+++ b/chromeos/settings/timezone_settings.cc
@@ -22,7 +22,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/sys_info.h"
#include "base/task_runner.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "chromeos/settings/timezone_settings_helper.h"
namespace chromeos {
@@ -390,8 +390,13 @@ void TimezoneSettingsImpl::SetTimezone(const icu::TimeZone& timezone) {
VLOG(1) << "Setting timezone to " << id;
// It's safe to change the timezone config files in the background as the
// following operations don't depend on the completion of the config change.
- base::WorkerPool::GetTaskRunner(true /* task is slow */)->
- PostTask(FROM_HERE, base::Bind(&SetTimezoneIDFromString, id));
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .MayBlock(),
+ base::Bind(&SetTimezoneIDFromString, id));
icu::TimeZone::setDefault(*known_timezone);
for (auto& observer : observers_)
observer.TimezoneChanged(*known_timezone);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698