Commit 9b818f0b authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of WorkerPool in navigation_entry_screenshot_manager.cc.

The following traits are used:

Priority: Inherited (default)
  The priority is inherited from the calling context (i.e. TaskTraits
  are initialized with the priority of the current task).

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.

Does Not Block (default):
  Tasks without the MayBlock() and WithBaseSyncPrimitives() traits
  may not block.

BUG=659191
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2604343002
Cr-Commit-Position: refs/heads/master@{#441316}
parent f9977a81
......@@ -6,7 +6,7 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/threading/worker_pool.h"
#include "base/task_scheduler/post_task.h"
#include "content/browser/frame_host/navigation_controller_impl.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
......@@ -32,14 +32,10 @@ class ScreenshotData : public base::RefCountedThreadSafe<ScreenshotData> {
}
void EncodeScreenshot(const SkBitmap& bitmap, base::Closure callback) {
if (!base::WorkerPool::PostTaskAndReply(FROM_HERE,
base::Bind(&ScreenshotData::EncodeOnWorker,
this,
bitmap),
callback,
true)) {
callback.Run();
}
base::PostTaskWithTraitsAndReply(
FROM_HERE, base::TaskTraits().WithShutdownBehavior(
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
base::Bind(&ScreenshotData::EncodeOnWorker, this, bitmap), callback);
}
scoped_refptr<base::RefCountedBytes> data() const { return data_; }
......
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