summaryrefslogtreecommitdiffstats
path: root/components/component_updater/default_component_installer.cc
diff options
context:
space:
mode:
authorqyearsley <qyearsley@chromium.org>2015-02-26 19:27:07 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-27 03:27:45 +0000
commitb978c75f5f0fc04a172836c91b90b607d36e2d19 (patch)
treea37f4d6a5ff9f40e441bd0f97c7389b3bcc27bf5 /components/component_updater/default_component_installer.cc
parent089e28561693b3287409b96048d0c3c02cd0b740 (diff)
downloadchromium_src-b978c75f5f0fc04a172836c91b90b607d36e2d19.zip
chromium_src-b978c75f5f0fc04a172836c91b90b607d36e2d19.tar.gz
chromium_src-b978c75f5f0fc04a172836c91b90b607d36e2d19.tar.bz2
Revert of Don't check for supervised user whitelist updates until after registering the corresponding componeā€¦ (patchset #4 id:60001 of https://codereview.chromium.org/938053002/)
Reason for revert: Suspected possible cause of compile failure: http://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Mac/builds/22562 Original issue's description: > Don't check for supervised user whitelist updates until after registering the corresponding component. > > Previously, the call to OnDemandUpdate would fail because the component wasn't registered yet, but SupervisedUserWhitelistInstaller didn't check the return value. Now it does, and the unit test checks that OnDemandUpdate isn't called too early. > > BUG=436459 > > Committed: https://crrev.com/9dcd9897bddc7f8b2da43292c72c025a60c58fbc > Cr-Commit-Position: refs/heads/master@{#318372} TBR=sorin@chromium.org,bauerb@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=436459 Review URL: https://codereview.chromium.org/963673002 Cr-Commit-Position: refs/heads/master@{#318391}
Diffstat (limited to 'components/component_updater/default_component_installer.cc')
-rw-r--r--components/component_updater/default_component_installer.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/components/component_updater/default_component_installer.cc b/components/component_updater/default_component_installer.cc
index d430863..027b1cb 100644
--- a/components/component_updater/default_component_installer.cc
+++ b/components/component_updater/default_component_installer.cc
@@ -44,9 +44,7 @@ DefaultComponentInstaller::DefaultComponentInstaller(
DefaultComponentInstaller::~DefaultComponentInstaller() {
}
-void DefaultComponentInstaller::Register(
- ComponentUpdateService* cus,
- const base::Closure& callback) {
+void DefaultComponentInstaller::Register(ComponentUpdateService* cus) {
DCHECK(thread_checker_.CalledOnValidThread());
task_runner_ = cus->GetSequencedTaskRunner();
@@ -55,12 +53,10 @@ void DefaultComponentInstaller::Register(
<< "has no installer traits.";
return;
}
- task_runner_->PostTaskAndReply(
+ task_runner_->PostTask(
FROM_HERE,
base::Bind(&DefaultComponentInstaller::StartRegistration,
- this, cus),
- base::Bind(&DefaultComponentInstaller::FinishRegistration,
- this, cus, callback));
+ this, cus));
}
void DefaultComponentInstaller::OnUpdateError(int error) {
@@ -203,6 +199,11 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) {
// browser startup.
for (const auto& older_path : older_paths)
base::DeleteFile(older_path, true);
+
+ main_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&DefaultComponentInstaller::FinishRegistration,
+ this, cus));
}
void DefaultComponentInstaller::UninstallOnTaskRunner() {
@@ -238,8 +239,7 @@ base::FilePath DefaultComponentInstaller::GetInstallDirectory() {
}
void DefaultComponentInstaller::FinishRegistration(
- ComponentUpdateService* cus,
- const base::Closure& callback) {
+ ComponentUpdateService* cus) {
DCHECK(thread_checker_.CalledOnValidThread());
if (installer_traits_->CanAutoUpdate()) {
CrxComponent crx;
@@ -255,9 +255,6 @@ void DefaultComponentInstaller::FinishRegistration(
<< installer_traits_->GetName();
return;
}
-
- if (!callback.is_null())
- callback.Run();
}
if (!current_manifest_)