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

Unified Diff: chrome/browser/component_updater/recovery_component_installer.cc

Issue 2548643002: Use TaskScheduler instead of WorkerPool in recovery_component_installer.cc. (Closed)
Patch Set: Created 4 years 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/component_updater/recovery_component_installer.cc
diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc
index fc88910ca9d0bbf554fc187a7445f9bc2d24fa63..9c6d799d2fab5e9b70904d742fdd0fc14ba69d71 100644
--- a/chrome/browser/component_updater/recovery_component_installer.cc
+++ b/chrome/browser/component_updater/recovery_component_installer.cc
@@ -18,6 +18,7 @@
#include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/logging.h"
+#include "base/task_scheduler/post_task.h"
#if defined(OS_MACOSX)
#include "base/mac/authorization_util.h"
#include "base/mac/scoped_authorizationref.h"
@@ -27,7 +28,6 @@
#include "base/process/kill.h"
#include "base/process/launch.h"
#include "base/process/process.h"
-#include "base/threading/worker_pool.h"
#include "build/build_config.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -224,17 +224,23 @@ void DoElevatedInstallRecoveryComponent(const base::FilePath& path) {
}
base::Process process = base::Process::Open(pid);
#endif
- base::WorkerPool::PostTask(
- FROM_HERE,
- base::Bind(&WaitForElevatedInstallToComplete, base::Passed(&process)),
- true);
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithWait(),
+ base::Bind(&WaitForElevatedInstallToComplete, base::Passed(&process)));
}
void ElevatedInstallRecoveryComponent(const base::FilePath& installer_path) {
- base::WorkerPool::PostTask(
- FROM_HERE,
- base::Bind(&DoElevatedInstallRecoveryComponent, installer_path),
- true);
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithFileIO(),
+ base::Bind(&DoElevatedInstallRecoveryComponent, installer_path));
}
#endif // defined(OS_WIN)
@@ -365,11 +371,14 @@ bool RecoveryComponentInstaller::RunInstallCommand(
return false;
// Let worker pool thread wait for us so we don't block Chrome shutdown.
- base::WorkerPool::PostTask(
- FROM_HERE,
- base::Bind(&WaitForInstallToComplete,
- base::Passed(&process), installer_folder, prefs_),
- true);
+ base::PostTaskWithTraits(
+ FROM_HERE, base::TaskTraits()
+ .WithShutdownBehavior(
+ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
+ .WithPriority(base::TaskPriority::BACKGROUND)
+ .WithWait(),
+ base::Bind(&WaitForInstallToComplete, base::Passed(&process),
+ installer_folder, prefs_));
// Returns true regardless of install result since from updater service
// perspective the install is done, even we may need to do elevated
« 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