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

Unified Diff: extensions/browser/updater/update_install_shim.cc

Issue 2483513002: Revert of Makes the component installers return a Result instead of a bool. (Closed)
Patch Set: Created 4 years, 1 month 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 | « extensions/browser/updater/update_install_shim.h ('k') | ios/chrome/browser/net/crl_set_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/updater/update_install_shim.cc
diff --git a/extensions/browser/updater/update_install_shim.cc b/extensions/browser/updater/update_install_shim.cc
index 671303b7598cf485d21393546570f8bab9af4f9b..4072a85d1d774932663baf0fc78d9e7309cb6680 100644
--- a/extensions/browser/updater/update_install_shim.cc
+++ b/extensions/browser/updater/update_install_shim.cc
@@ -11,15 +11,9 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "components/update_client/update_client_errors.h"
#include "content/public/browser/browser_thread.h"
namespace extensions {
-
-namespace {
-using InstallError = update_client::InstallError;
-using Result = update_client::CrxInstaller::Result;
-} // namespace
UpdateInstallShim::UpdateInstallShim(std::string extension_id,
const base::FilePath& extension_root,
@@ -32,11 +26,11 @@
VLOG(1) << "OnUpdateError (" << extension_id_ << ") " << error;
}
-Result UpdateInstallShim::Install(const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+bool UpdateInstallShim::Install(const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) {
base::ScopedTempDir temp_dir;
if (!temp_dir.CreateUniqueTempDir())
- return Result(InstallError::GENERIC_ERROR);
+ return false;
// The UpdateClient code will delete unpack_path if it still exists after
// this method is done, so we rename it on top of our temp dir.
@@ -45,13 +39,13 @@
LOG(ERROR) << "Trying to install update for " << extension_id_
<< "and failed to move " << unpack_path.value() << " to "
<< temp_dir.GetPath().value();
- return Result(InstallError::GENERIC_ERROR);
+ return false;
}
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&UpdateInstallShim::RunCallbackOnUIThread, this,
temp_dir.Take()));
- return Result(InstallError::NONE);
+ return true;
}
bool UpdateInstallShim::GetInstalledFile(const std::string& file,
« no previous file with comments | « extensions/browser/updater/update_install_shim.h ('k') | ios/chrome/browser/net/crl_set_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698