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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc

Issue 2677913002: Use TaskScheduler instead of blocking pool in private_api_mount.cc. (Closed)
Patch Set: USER_BLOCKING Created 3 years, 10 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/extensions/file_manager/private_api_mount.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc
index 3da5dc94a809ca74969d0cd0b04749c1fb91f748..550715db68ad99f429aac2b46d02ba1f4060b5c3 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc
@@ -10,6 +10,7 @@
#include "base/format_macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
+#include "base/task_scheduler/post_task.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
@@ -32,7 +33,7 @@ namespace extensions {
namespace {
// Does chmod o+r for the given path to ensure the file is readable from avfs.
-void EnsureReadableFilePermissionOnBlockingPool(
+void EnsureReadableFilePermissionAsync(
const base::FilePath& path,
const base::Callback<void(drive::FileError, const base::FilePath&)>&
callback) {
@@ -99,15 +100,14 @@ bool FileManagerPrivateAddMountFunction::RunAsync() {
if (is_under_downloads) {
// For files under downloads, change the file permission and make it
// readable from avfs/fuse if needed.
- BrowserThread::PostBlockingPoolTask(
- FROM_HERE,
- base::Bind(&EnsureReadableFilePermissionOnBlockingPool,
- path,
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::USER_BLOCKING),
+ base::Bind(&EnsureReadableFilePermissionAsync, path,
google_apis::CreateRelayCallback(
base::Bind(&FileManagerPrivateAddMountFunction::
RunAfterMarkCacheFileAsMounted,
- this,
- path.BaseName()))));
+ this, path.BaseName()))));
} else {
RunAfterMarkCacheFileAsMounted(
path.BaseName(), drive::FILE_ERROR_OK, path);
« 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