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

Unified Diff: chrome/browser/android/thumbnail/thumbnail_cache.cc

Issue 2531673002: Use TaskScheduler instead of WorkerPool in thumbnail_cache.cc. (Closed)
Patch Set: CONTINUE_ON_SHUTDOWN Created 4 years, 1 month 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/android/thumbnail/thumbnail_cache.cc
diff --git a/chrome/browser/android/thumbnail/thumbnail_cache.cc b/chrome/browser/android/thumbnail/thumbnail_cache.cc
index 8765934d86c4f05e870747b617c3c05492c4206e..f72a51ac12f1f7849218b5b6568a4bfe5d9649b5 100644
--- a/chrome/browser/android/thumbnail/thumbnail_cache.cc
+++ b/chrome/browser/android/thumbnail/thumbnail_cache.cc
@@ -17,7 +17,7 @@
#include "base/files/file_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
@@ -378,12 +378,13 @@ void ThumbnailCache::CompressThumbnailIfNecessary(
gfx::Size encoded_size = GetEncodedSize(
raw_data_size, ui_resource_provider_->SupportsETC1NonPowerOfTwo());
- base::WorkerPool::PostTask(FROM_HERE,
- base::Bind(&ThumbnailCache::CompressionTask,
- bitmap,
- encoded_size,
- post_compression_task),
- true);
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits()
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
+ base::Bind(&ThumbnailCache::CompressionTask, bitmap, encoded_size,
+ post_compression_task));
}
void ThumbnailCache::ReadNextThumbnail() {
@@ -775,11 +776,11 @@ void ThumbnailCache::ReadTask(
}
if (decompress) {
- base::WorkerPool::PostTask(
+ base::PostTaskWithTraits(
FROM_HERE,
+ base::TaskTraits().WithPriority(base::TaskPriority::BACKGROUND),
base::Bind(post_read_task, std::move(compressed_data), scale,
- content_size),
- true);
+ content_size));
} else {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
« 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