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

Unified Diff: ui/arc/notification/arc_notification_item.cc

Issue 2603153002: Use TaskScheduler instead of WorkerPool in arc_notification_item.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: ui/arc/notification/arc_notification_item.cc
diff --git a/ui/arc/notification/arc_notification_item.cc b/ui/arc/notification/arc_notification_item.cc
index ca97cf6bb6f048a19eed796a03b325b46cb4c822..f67f33a3501ae06a9964810564540cb5293595fd 100644
--- a/ui/arc/notification/arc_notification_item.cc
+++ b/ui/arc/notification/arc_notification_item.cc
@@ -12,8 +12,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_runner.h"
-#include "base/task_runner_util.h"
-#include "base/threading/worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "ui/gfx/codec/png_codec.h"
@@ -33,7 +32,6 @@ constexpr char kNotifierId[] = "ARC_NOTIFICATION";
constexpr char kNotificationIdPrefix[] = "ARC_NOTIFICATION_";
SkBitmap DecodeImage(const std::vector<uint8_t>& data) {
- DCHECK(base::WorkerPool::RunsTasksOnCurrentThread());
DCHECK(!data.empty()); // empty string should be handled in caller.
// We may decode an image in the browser process since it has been generated
@@ -237,8 +235,9 @@ void ArcNotificationItem::UpdateWithArcNotificationData(
}
// TODO(yoshiki): Remove decoding by passing a bitmap directly from Android.
- base::PostTaskAndReplyWithResult(
- base::WorkerPool::GetTaskRunner(true).get(), FROM_HERE,
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
base::Bind(&DecodeImage, data->icon_data),
base::Bind(&ArcNotificationItem::OnImageDecoded,
weak_ptr_factory_.GetWeakPtr()));
« 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