Commit fd81dc85 authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of WorkerPool in gesture_feedback.cc.

The following traits are used:

Priority: BACKGROUND
  User won't notice if this task takes an arbitrarily long time
  to complete.

Shutdown behavior: CONTINUE_ON_SHUTDOWN
  Tasks posted with this mode which have not started executing before
  shutdown is initiated will never run. Tasks with this mode running at
  shutdown will be ignored (the worker will not be joined).

  Note: Tasks that were previously posted to base::WorkerPool should
  use this shutdown behavior because this is how base::WorkerPool
  handles all its tasks.

May Block:
  Tasks posted with MayBlock() may block. This includes but is not
  limited to tasks that wait on synchronous file I/O operations:
  read or write a file from disk, interact with a pipe or a socket,
  rename or delete a file, enumerate files in a directory, etc. This
  trait isn't required for the mere use of locks.

BUG=659191

Review-Url: https://codereview.chromium.org/2611463002
Cr-Commit-Position: refs/heads/master@{#441426}
parent 8a2e2308
......@@ -15,7 +15,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/worker_pool.h"
#include "base/task_scheduler/post_task.h"
#include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h"
namespace ui {
......@@ -232,11 +232,15 @@ void DumpTouchEventLog(
}
}
// Compress touchpad/mouse logs on another thread and return.
base::WorkerPool::PostTaskAndReply(
FROM_HERE,
// Compress touchpad/mouse logs asynchronously
base::PostTaskWithTraitsAndReply(
FROM_HERE, base::TaskTraits()
.WithShutdownBehavior(
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
.WithPriority(base::TaskPriority::BACKGROUND)
.MayBlock(),
base::Bind(&CompressDumpedLog, base::Passed(&log_paths_to_be_compressed)),
base::Bind(reply, base::Passed(&log_paths)), true /* task_is_slow */);
base::Bind(reply, base::Passed(&log_paths)));
}
} // namespace ui
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment