Commit f530646a authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Revert "Replace GetBlockingPool and FILE thread with post_task API"

This reverts commit d9339152.

Reason for revert: <INSERT REASONING HERE>
Causing compile error here:
https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Win/builds/19349

Original change's description:
> Replace GetBlockingPool and FILE thread with post_task API
> 
> BUG=689520,667892
> 
> Change-Id: I1143fbc8c5f7c12dfdd8e5764d58c9b372d3cb16
> Reviewed-on: https://chromium-review.googlesource.com/544782
> Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#481889}

TBR=xiyuan@chromium.org,grt@chromium.org

Change-Id: I4fbdb87edffff078ca60bb16c10628b5b13da00a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 689520, 667892
Reviewed-on: https://chromium-review.googlesource.com/546115Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481902}
parent 8bacc33c
......@@ -6,7 +6,7 @@
#include "base/memory/weak_ptr.h"
#include "base/task_runner_util.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "chrome/browser/browser_process.h"
......@@ -40,7 +40,7 @@ void VersionUpdaterWin::CheckForUpdate(const StatusCallback& callback,
(base::win::OSInfo::GetInstance()->service_pack().major == 0) &&
!base::win::UserAccountControlIsEnabled())) {
callback_.Run(CHECKING, 0, std::string(), 0, base::string16());
BeginUpdateCheckInBackground(false /* !install_update_if_possible */);
BeginUpdateCheckOnFileThread(false /* !install_update_if_possible */);
}
}
......@@ -51,13 +51,12 @@ void VersionUpdaterWin::OnUpdateCheckComplete(
if (new_version.empty()) {
// Google Update says that no new version is available. Check to see if a
// restart is needed for a previously-applied update to take effect.
if (base::PostTaskWithTraitsAndReplyWithResult(
if (base::PostTaskAndReplyWithResult(
content::BrowserThread::GetBlockingPool(),
FROM_HERE,
{base::TaskPriority::USER_VISIBLE, base::MayBlock(),
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(&upgrade_util::IsUpdatePendingRestart),
base::BindOnce(&VersionUpdaterWin::OnPendingRestartCheck,
weak_factory_.GetWeakPtr()))) {
base::Bind(&upgrade_util::IsUpdatePendingRestart),
base::Bind(&VersionUpdaterWin::OnPendingRestartCheck,
weak_factory_.GetWeakPtr()))) {
// Early exit since callback_ will be Run in OnPendingRestartCheck.
return;
}
......@@ -68,7 +67,7 @@ void VersionUpdaterWin::OnUpdateCheckComplete(
} else {
// Notify the caller that the update is now beginning and initiate it.
status = UPDATING;
BeginUpdateCheckInBackground(true /* install_update_if_possible */);
BeginUpdateCheckOnFileThread(true /* install_update_if_possible */);
}
callback_.Run(status, 0, std::string(), 0, base::string16());
}
......@@ -115,13 +114,12 @@ void VersionUpdaterWin::OnError(GoogleUpdateErrorCode error_code,
callback_.Run(status, 0, std::string(), 0, message);
}
void VersionUpdaterWin::BeginUpdateCheckInBackground(
void VersionUpdaterWin::BeginUpdateCheckOnFileThread(
bool install_update_if_possible) {
// Disconnect from any previous attempts to avoid redundant callbacks.
weak_factory_.InvalidateWeakPtrs();
BeginUpdateCheck(base::CreateCOMSTATaskRunnerWithTraits(
(base::TaskPriority::USER_VISIBLE, base::MayBlock(),
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)),
BeginUpdateCheck(content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::FILE),
g_browser_process->GetApplicationLocale(),
install_update_if_possible, owner_widget_,
weak_factory_.GetWeakPtr());
......
......@@ -38,7 +38,7 @@ class VersionUpdaterWin : public VersionUpdater,
const base::string16& new_version) override;
private:
void BeginUpdateCheckInBackground(bool install_update_if_possible);
void BeginUpdateCheckOnFileThread(bool install_update_if_possible);
// A task run on the UI thread with the result of checking for a pending
// restart.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment