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

Unified Diff: components/update_client/test_installer.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 | « components/update_client/test_installer.h ('k') | components/update_client/update_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/test_installer.cc
diff --git a/components/update_client/test_installer.cc b/components/update_client/test_installer.cc
index 3232bd6cf58bea2970635f49bf7033d92f60cf04..21a3b2a3bed0d1ccec928601cad5fe5bdea1f999 100644
--- a/components/update_client/test_installer.cc
+++ b/components/update_client/test_installer.cc
@@ -9,7 +9,6 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/values.h"
-#include "components/update_client/update_client_errors.h"
namespace update_client {
@@ -20,14 +19,10 @@
error_ = error;
}
-CrxInstaller::Result TestInstaller::Install(
- const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+bool TestInstaller::Install(const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) {
++install_count_;
- if (!base::DeleteFile(unpack_path, true))
- return Result(InstallError::GENERIC_ERROR);
-
- return Result(InstallError::NONE);
+ return base::DeleteFile(unpack_path, true);
}
bool TestInstaller::GetInstalledFile(const std::string& file,
@@ -63,9 +58,8 @@
base::DeleteFile(install_directory_, true);
}
-CrxInstaller::Result VersionedTestInstaller::Install(
- const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) {
std::string version_string;
manifest.GetStringASCII("version", &version_string);
base::Version version(version_string.c_str());
@@ -74,10 +68,10 @@
path = install_directory_.AppendASCII(version.GetString());
base::CreateDirectory(path.DirName());
if (!base::Move(unpack_path, path))
- return Result(InstallError::GENERIC_ERROR);
+ return false;
current_version_ = version;
++install_count_;
- return Result(InstallError::NONE);
+ return true;
}
bool VersionedTestInstaller::GetInstalledFile(const std::string& file,
« no previous file with comments | « components/update_client/test_installer.h ('k') | components/update_client/update_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698