summaryrefslogtreecommitdiff
path: root/chrome/browser/component_updater/recovery_component_installer.cc
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-06-03 10:58:34 +0100
committerTorne (Richard Coles) <torne@google.com>2014-06-03 10:58:34 +0100
commitcedac228d2dd51db4b79ea1e72c7f249408ee061 (patch)
treeaa4ff43d7fe316e95d12721ce5e17653a768a0dd /chrome/browser/component_updater/recovery_component_installer.cc
parent6a869ecff032b5bed299d661b078b0555034598b (diff)
downloadchromium_org-cedac228d2dd51db4b79ea1e72c7f249408ee061.tar.gz
Merge from Chromium at DEPS revision 273901
This commit was generated by merge_to_master.py. Change-Id: I45745444894df927ffc1045ab8de88b9e52636a3
Diffstat (limited to 'chrome/browser/component_updater/recovery_component_installer.cc')
-rw-r--r--chrome/browser/component_updater/recovery_component_installer.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/component_updater/recovery_component_installer.cc b/chrome/browser/component_updater/recovery_component_installer.cc
index 642f94cec6..4baa3666db 100644
--- a/chrome/browser/component_updater/recovery_component_installer.cc
+++ b/chrome/browser/component_updater/recovery_component_installer.cc
@@ -20,6 +20,7 @@
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chrome/browser/component_updater/component_updater_service.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -114,11 +115,23 @@ bool RecoveryComponentInstaller::Install(const base::DictionaryValue& manifest,
return false;
if (current_version_.CompareTo(version) >= 0)
return false;
- base::FilePath main_file = unpack_path.Append(kRecoveryFileName);
+
+ // Passed the basic tests. Copy the installation to a permanent directory.
+ base::FilePath path;
+ if (!PathService::Get(chrome::DIR_RECOVERY_BASE, &path))
+ return false;
+ path = path.AppendASCII(version.GetString());
+ if (base::PathExists(path) && !base::DeleteFile(path, true))
+ return false;
+ if (!base::Move(unpack_path, path)) {
+ DVLOG(1) << "Recovery component move failed.";
+ return false;
+ }
+
+ base::FilePath main_file = path.Append(kRecoveryFileName);
if (!base::PathExists(main_file))
return false;
- // Passed the basic tests. The installation continues with the
- // recovery component itself running from the temp directory.
+ // Run the recovery component.
CommandLine cmdline(main_file);
std::string arguments;
if (manifest.GetStringASCII("x-recovery-args", &arguments))