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

Unified Diff: chrome/browser/ui/ash/chrome_screenshot_grabber.cc

Issue 2841723002: Use TaskScheduler instead of blocking pool in chrome_screenshot_grabber.cc. (Closed)
Patch Set: fix-build-error Created 3 years, 8 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/ui/ash/chrome_screenshot_grabber.cc
diff --git a/chrome/browser/ui/ash/chrome_screenshot_grabber.cc b/chrome/browser/ui/ash/chrome_screenshot_grabber.cc
index 6fdb08ccd0eb1377cf6af322b31fe82ccbcbd1c8..4ec03eb8669347c993b0058d91e5df0a0b567be9 100644
--- a/chrome/browser/ui/ash/chrome_screenshot_grabber.cc
+++ b/chrome/browser/ui/ash/chrome_screenshot_grabber.cc
@@ -18,6 +18,7 @@
#include "base/metrics/user_metrics.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -72,8 +73,6 @@ void CopyScreenshotToClipboard(scoped_refptr<base::RefCountedString> png_data) {
}
void ReadFileAndCopyToClipboardLocal(const base::FilePath& screenshot_path) {
- DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
-
scoped_refptr<base::RefCountedString> png_data(new base::RefCountedString());
if (!base::ReadFileToString(screenshot_path, &(png_data->data()))) {
LOG(ERROR) << "Failed to read the screenshot file: "
@@ -281,9 +280,12 @@ std::string GetScreenshotBaseFilename() {
ChromeScreenshotGrabber::ChromeScreenshotGrabber()
: screenshot_grabber_(new ui::ScreenshotGrabber(
this,
- content::BrowserThread::GetBlockingPool()
- ->GetTaskRunnerWithShutdownBehavior(
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))),
+ base::CreateTaskRunnerWithTraits(
+ base::TaskTraits()
+ .MayBlock()
+ .WithPriority(base::TaskPriority::BACKGROUND)
James Cook 2017/04/26 20:46:44 I think this should be USER_VISIBLE. The user is w
fdoray 2017/04/27 13:35:31 Done.
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))),
profile_for_test_(NULL) {
screenshot_grabber_->AddObserver(this);
}
« 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