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

Unified Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc

Issue 2627083005: Use TaskScheduler instead of blocking pool in wallpaper_manager.cc. (Closed)
Patch Set: Created 3 years, 11 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: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
index 479ba1c9e00f54aae38ac8c67d101e1a70a8736a..cd1566ba705a2f08db57f31cd343a5a38528735c 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -19,6 +19,7 @@
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_info.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
@@ -960,8 +961,8 @@ void WallpaperManager::OnDeviceWallpaperExists(const AccountId& account_id,
const std::string& hash,
bool exist) {
if (exist) {
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool(), FROM_HERE,
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock(),
base::Bind(&CheckDeviceWallpaperMatchHash, GetDeviceWallpaperFilePath(),
hash),
base::Bind(&WallpaperManager::OnCheckDeviceWallpaperMatchHash,
@@ -988,8 +989,8 @@ void WallpaperManager::OnDeviceWallpaperDownloaded(const AccountId& account_id,
return;
}
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool(), FROM_HERE,
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock(),
base::Bind(&CheckDeviceWallpaperMatchHash, GetDeviceWallpaperFilePath(),
hash),
base::Bind(&WallpaperManager::OnCheckDeviceWallpaperMatchHash,
@@ -1304,8 +1305,8 @@ bool WallpaperManager::SetDeviceWallpaperIfApplicable(
if (ShouldSetDeviceWallpaper(account_id, &url, &hash)) {
// Check if the device wallpaper exists and matches the hash. If so, use it
// directly. Otherwise download it first.
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool(), FROM_HERE,
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock(),
base::Bind(&base::PathExists, GetDeviceWallpaperFilePath()),
base::Bind(&WallpaperManager::OnDeviceWallpaperExists,
weak_factory_.GetWeakPtr(), account_id, url, hash));
« 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