diff options
author | bauerb <bauerb@chromium.org> | 2015-02-08 16:00:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-09 00:01:15 +0000 |
commit | 1f6657e7f1cf36e7a490c494c0794b124c86b6ec (patch) | |
tree | a7d54dc73cb55c5f5136fd6237bf7d0cb9a977cc /components/update_client | |
parent | cce3cff79038a60aab74990acd2974de518d5c9f (diff) | |
download | chromium_src-1f6657e7f1cf36e7a490c494c0794b124c86b6ec.zip chromium_src-1f6657e7f1cf36e7a490c494c0794b124c86b6ec.tar.gz chromium_src-1f6657e7f1cf36e7a490c494c0794b124c86b6ec.tar.bz2 |
Add support for uninstalling components and use it in SupervisedUserWhitelistInstaller.
TBR=agl@chromium.org
BUG=436459
Review URL: https://codereview.chromium.org/879993005
Cr-Commit-Position: refs/heads/master@{#315246}
Diffstat (limited to 'components/update_client')
-rw-r--r-- | components/update_client/crx_update_item.h | 4 | ||||
-rw-r--r-- | components/update_client/test/test_installer.cc | 4 | ||||
-rw-r--r-- | components/update_client/test/test_installer.h | 2 | ||||
-rw-r--r-- | components/update_client/update_client.cc | 4 | ||||
-rw-r--r-- | components/update_client/update_client.h | 5 |
5 files changed, 17 insertions, 2 deletions
diff --git a/components/update_client/crx_update_item.h b/components/update_client/crx_update_item.h index ba38a1b..09af62f 100644 --- a/components/update_client/crx_update_item.h +++ b/components/update_client/crx_update_item.h @@ -71,6 +71,10 @@ struct CrxUpdateItem { // enforce conditions or notify observers of the change. Status status; + // True if the component was recently unregistered and will be uninstalled + // soon (after the currently operation is finished, if there is one). + bool unregistered; + std::string id; CrxComponent component; diff --git a/components/update_client/test/test_installer.cc b/components/update_client/test/test_installer.cc index de32b1f..6c03f49 100644 --- a/components/update_client/test/test_installer.cc +++ b/components/update_client/test/test_installer.cc @@ -33,6 +33,10 @@ bool TestInstaller::GetInstalledFile(const std::string& file, TestInstaller::~TestInstaller() { } +bool TestInstaller::Uninstall() { + return false; +} + ReadOnlyTestInstaller::ReadOnlyTestInstaller(const base::FilePath& install_dir) : install_directory_(install_dir) { } diff --git a/components/update_client/test/test_installer.h b/components/update_client/test/test_installer.h index 2d9ae9f..a31c499 100644 --- a/components/update_client/test/test_installer.h +++ b/components/update_client/test/test_installer.h @@ -31,6 +31,8 @@ class TestInstaller : public ComponentInstaller { bool GetInstalledFile(const std::string& file, base::FilePath* installed_file) override; + bool Uninstall() override; + int error() const { return error_; } diff --git a/components/update_client/update_client.cc b/components/update_client/update_client.cc index b7fff2b..35cc5bb 100644 --- a/components/update_client/update_client.cc +++ b/components/update_client/update_client.cc @@ -10,6 +10,7 @@ namespace update_client { CrxUpdateItem::CrxUpdateItem() : status(kNew), + unregistered(false), on_demand(false), diff_update_failed(false), error_category(0), @@ -23,8 +24,7 @@ CrxUpdateItem::CrxUpdateItem() CrxUpdateItem::~CrxUpdateItem() { } -CrxComponent::CrxComponent() - : installer(NULL), allow_background_download(true) { +CrxComponent::CrxComponent() : allow_background_download(true) { } CrxComponent::~CrxComponent() { diff --git a/components/update_client/update_client.h b/components/update_client/update_client.h index 28b69c0..35b3cca 100644 --- a/components/update_client/update_client.h +++ b/components/update_client/update_client.h @@ -45,6 +45,11 @@ class ComponentInstaller virtual bool GetInstalledFile(const std::string& file, base::FilePath* installed_file) = 0; + // Called by the component updater when a component has been unregistered and + // all versions should be uninstalled from disk. Returns true if + // uninstallation is supported, false otherwise. + virtual bool Uninstall() = 0; + protected: friend class base::RefCountedThreadSafe<ComponentInstaller>; |