summaryrefslogtreecommitdiffstats
path: root/components/component_updater
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
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')
-rw-r--r--components/component_updater/default_component_installer.cc21
-rw-r--r--components/component_updater/default_component_installer.h8
2 files changed, 11 insertions, 18 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_)
diff --git a/components/component_updater/default_component_installer.h b/components/component_updater/default_component_installer.h
index 1725798..5815cd1 100644
--- a/components/component_updater/default_component_installer.h
+++ b/components/component_updater/default_component_installer.h
@@ -9,7 +9,6 @@
#include <string>
#include <vector>
-#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -91,9 +90,7 @@ class DefaultComponentInstaller : public update_client::ComponentInstaller {
scoped_ptr<ComponentInstallerTraits> installer_traits);
// Registers the component for update checks and installs.
- // The passed |callback| will be called once the initial check for installed
- // versions is done and the component has been registered.
- void Register(ComponentUpdateService* cus, const base::Closure& callback);
+ void Register(ComponentUpdateService* cus);
// Overridden from ComponentInstaller:
void OnUpdateError(int error) override;
@@ -111,8 +108,7 @@ class DefaultComponentInstaller : public update_client::ComponentInstaller {
const base::FilePath& unpack_path,
const base::FilePath& install_path);
void StartRegistration(ComponentUpdateService* cus);
- void FinishRegistration(ComponentUpdateService* cus,
- const base::Closure& callback);
+ void FinishRegistration(ComponentUpdateService* cus);
void ComponentReady(scoped_ptr<base::DictionaryValue> manifest);
void UninstallOnTaskRunner();