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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 2623313002: Use TaskScheduler instead of blocking pool in chrome_download_manager_delegate.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/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 9a863078fc9f638f9843d8c73026d7d6f8aeadd7..3c53d58034b8aee1b05c3813b8d6dcad414f3e63 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -15,7 +15,7 @@
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_runner.h"
-#include "base/task_runner_util.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -176,7 +176,7 @@ void CheckDownloadUrlDone(
#endif // FULL_SAFE_BROWSING
-// Called on the blocking pool to determine the MIME type for |path|.
+// Called asynchronously to determine the MIME type for |path|.
std::string GetMimeType(const base::FilePath& path) {
std::string mime_type;
net::GetMimeTypeFromFile(path, &mime_type);
@@ -676,10 +676,9 @@ void ChromeDownloadManagerDelegate::GetFileMimeType(
const base::FilePath& path,
const GetFileMimeTypeCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- base::PostTaskAndReplyWithResult(BrowserThread::GetBlockingPool(),
- FROM_HERE,
- base::Bind(&GetMimeType, path),
- callback);
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock(), base::Bind(&GetMimeType, path),
+ callback);
}
#if defined(FULL_SAFE_BROWSING)
« 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