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

Unified Diff: components/update_client/test_installer.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 | « 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 21a3b2a3bed0d1ccec928601cad5fe5bdea1f999..3232bd6cf58bea2970635f49bf7033d92f60cf04 100644
--- a/components/update_client/test_installer.cc
+++ b/components/update_client/test_installer.cc
@@ -9,6 +9,7 @@
#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 {
@@ -19,10 +20,14 @@ void TestInstaller::OnUpdateError(int error) {
error_ = error;
}
-bool TestInstaller::Install(const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+CrxInstaller::Result TestInstaller::Install(
+ const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) {
++install_count_;
- return base::DeleteFile(unpack_path, true);
+ if (!base::DeleteFile(unpack_path, true))
+ return Result(InstallError::GENERIC_ERROR);
+
+ return Result(InstallError::NONE);
}
bool TestInstaller::GetInstalledFile(const std::string& file,
@@ -58,8 +63,9 @@ VersionedTestInstaller::~VersionedTestInstaller() {
base::DeleteFile(install_directory_, true);
}
-bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) {
+CrxInstaller::Result 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());
@@ -68,10 +74,10 @@ bool VersionedTestInstaller::Install(const base::DictionaryValue& manifest,
path = install_directory_.AppendASCII(version.GetString());
base::CreateDirectory(path.DirName());
if (!base::Move(unpack_path, path))
- return false;
+ return Result(InstallError::GENERIC_ERROR);
current_version_ = version;
++install_count_;
- return true;
+ return Result(InstallError::NONE);
}
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