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

Unified Diff: chrome/browser/component_updater/component_unpacker.h

Issue 321473003: Elevated install of recovery component (component update part) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 | « no previous file | chrome/browser/component_updater/component_unpacker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/component_unpacker.h
diff --git a/chrome/browser/component_updater/component_unpacker.h b/chrome/browser/component_updater/component_unpacker.h
index ffd69dd9c4adf21c1fa16a385dfdeb3c5d19207f..6cb929bd9d875eedf912d5e133e4a1933a3fd974 100644
--- a/chrome/browser/component_updater/component_unpacker.h
+++ b/chrome/browser/component_updater/component_unpacker.h
@@ -91,7 +91,7 @@ class ComponentUnpacker : public base::RefCountedThreadSafe<ComponentUnpacker> {
typedef base::Callback<void(Error, int)> Callback;
// Constructs an unpacker for a specific component unpacking operation.
- // |pk_hash| is the expected/ public key SHA256 hash. |path| is the current
+ // |pk_hash| is the expected public key SHA256 hash. |path| is the current
// location of the CRX.
ComponentUnpacker(const std::vector<uint8>& pk_hash,
const base::FilePath& path,
@@ -104,8 +104,24 @@ class ComponentUnpacker : public base::RefCountedThreadSafe<ComponentUnpacker> {
// package is a differential update. Calls |callback| with the result.
void Unpack(const Callback& callback);
+ // Set the base directory where the unpack directory will be created.
+ // If this is not set, files will be unzipped to temporary dir.
+ void set_unpack_base_dir(const base::FilePath& path);
+
+ // Creates a ComponentUnpacker by loading CRX and related install information
+ // from |backup_path| that was previously saved by SaveInstallSource(). This
+ // is to retry failed component installation. |pk_hash| is the expected public
+ // key SHA256 hash.
+ static scoped_refptr<ComponentUnpacker> CreateFromBackup(
+ const base::FilePath& backup_path,
+ const std::vector<uint8>& pk_hash,
+ ComponentInstaller* installer,
+ scoped_refptr<base::SequencedTaskRunner> task_runner);
+
+
private:
friend class base::RefCountedThreadSafe<ComponentUnpacker>;
+ friend class ComponentUnpackerTest;
virtual ~ComponentUnpacker();
@@ -138,6 +154,16 @@ class ComponentUnpacker : public base::RefCountedThreadSafe<ComponentUnpacker> {
// Finish is responsible for calling the callback provided in Start().
void Finish();
+ // Saves the original CRX file, along with |fingerprint_|, |pk_hash_| and
+ // |in_process_|, to |backup_path|. This is to re-create ComponentUnpacker for
+ // retrying failed component patching.
+ bool SaveInstallSource(const base::FilePath& backup_path) const;
+
+ // Creates the directory for unzip. |new_dir| will be the full path to the
+ // directory.
+ bool CreateUnpackDirectory(base::FilePath* new_dir);
+
+ base::FilePath unpack_base_dir_;
std::vector<uint8> pk_hash_;
base::FilePath path_;
base::FilePath unpack_path_;
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698