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

Unified Diff: chrome/browser/chromeos/file_manager/zip_file_creator.cc

Issue 2627093004: Use TaskScheduler instead of blocking pool in zip_file_creator.cc. (Closed)
Patch Set: Created 3 years, 11 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/chromeos/file_manager/zip_file_creator.cc
diff --git a/chrome/browser/chromeos/file_manager/zip_file_creator.cc b/chrome/browser/chromeos/file_manager/zip_file_creator.cc
index 5a3a2f432c724c08e6743b7a5e3cf7dcab8c3bc4..d5d66208ab835621f5e36f56db946b8bedb1be10 100644
--- a/chrome/browser/chromeos/file_manager/zip_file_creator.cc
+++ b/chrome/browser/chromeos/file_manager/zip_file_creator.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/message_loop/message_loop.h"
-#include "base/threading/sequenced_worker_pool.h"
+#include "base/task_scheduler/post_task.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h"
@@ -22,7 +22,7 @@ using content::UtilityProcessHost;
namespace {
// Creates the destination zip file only if it does not already exist.
-base::File OpenFileHandleOnBlockingThreadPool(const base::FilePath& zip_path) {
+base::File OpenFileHandleAsync(const base::FilePath& zip_path) {
return base::File(zip_path, base::File::FLAG_CREATE | base::File::FLAG_WRITE);
}
@@ -45,10 +45,9 @@ ZipFileCreator::ZipFileCreator(
void ZipFileCreator::Start() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool(),
- FROM_HERE,
- base::Bind(&OpenFileHandleOnBlockingThreadPool, dest_file_),
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock(),
+ base::Bind(&OpenFileHandleAsync, dest_file_),
base::Bind(&ZipFileCreator::OnOpenFileHandle, 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