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

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

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 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') | extensions/common/file_util.cc » ('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 4072a85d1d774932663baf0fc78d9e7309cb6680..671303b7598cf485d21393546570f8bab9af4f9b 100644
--- a/extensions/browser/updater/update_install_shim.cc
+++ b/extensions/browser/updater/update_install_shim.cc
@@ -11,10 +11,16 @@
#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,
const UpdateInstallShimCallback& callback)
@@ -26,11 +32,11 @@ void UpdateInstallShim::OnUpdateError(int error) {
VLOG(1) << "OnUpdateError (" << extension_id_ << ") " << error;
}
-bool UpdateInstallShim::Install(const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+Result UpdateInstallShim::Install(const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) {
base::ScopedTempDir temp_dir;
if (!temp_dir.CreateUniqueTempDir())
- return false;
+ return Result(InstallError::GENERIC_ERROR);
// 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.
@@ -39,13 +45,13 @@ bool UpdateInstallShim::Install(const base::DictionaryValue& manifest,
LOG(ERROR) << "Trying to install update for " << extension_id_
<< "and failed to move " << unpack_path.value() << " to "
<< temp_dir.GetPath().value();
- return false;
+ return Result(InstallError::GENERIC_ERROR);
}
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&UpdateInstallShim::RunCallbackOnUIThread, this,
temp_dir.Take()));
- return true;
+ return Result(InstallError::NONE);
}
bool UpdateInstallShim::GetInstalledFile(const std::string& file,
« no previous file with comments | « extensions/browser/updater/update_install_shim.h ('k') | extensions/common/file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698