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

Side by Side Diff: components/update_client/component_unpacker.h

Issue 897873002: Make ComponentInstaller refcounted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2015_01_19_component_installer
Patch Set: fix Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_ 5 #ifndef COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_
6 #define COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_ 6 #define COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 kDeltaPatchProcessFailure, 88 kDeltaPatchProcessFailure,
89 kDeltaMissingExistingFile, 89 kDeltaMissingExistingFile,
90 kFingerprintWriteFailed, 90 kFingerprintWriteFailed,
91 }; 91 };
92 92
93 typedef base::Callback<void(Error, int)> Callback; 93 typedef base::Callback<void(Error, int)> Callback;
94 94
95 // Constructs an unpacker for a specific component unpacking operation. 95 // Constructs an unpacker for a specific component unpacking operation.
96 // |pk_hash| is the expected/ public key SHA256 hash. |path| is the current 96 // |pk_hash| is the expected/ public key SHA256 hash. |path| is the current
97 // location of the CRX. 97 // location of the CRX.
98 ComponentUnpacker(const std::vector<uint8_t>& pk_hash, 98 ComponentUnpacker(
99 const base::FilePath& path, 99 const std::vector<uint8_t>& pk_hash,
100 const std::string& fingerprint, 100 const base::FilePath& path,
101 ComponentInstaller* installer, 101 const std::string& fingerprint,
102 scoped_refptr<OutOfProcessPatcher> oop_patcher, 102 const scoped_refptr<ComponentInstaller>& installer,
103 scoped_refptr<base::SequencedTaskRunner> task_runner); 103 const scoped_refptr<OutOfProcessPatcher>& oop_patcher,
104 const scoped_refptr<base::SequencedTaskRunner>& task_runner);
104 105
105 // Begins the actual unpacking of the files. May invoke a patcher if the 106 // Begins the actual unpacking of the files. May invoke a patcher if the
106 // package is a differential update. Calls |callback| with the result. 107 // package is a differential update. Calls |callback| with the result.
107 void Unpack(const Callback& callback); 108 void Unpack(const Callback& callback);
108 109
109 private: 110 private:
110 friend class base::RefCountedThreadSafe<ComponentUnpacker>; 111 friend class base::RefCountedThreadSafe<ComponentUnpacker>;
111 112
112 virtual ~ComponentUnpacker(); 113 virtual ~ComponentUnpacker();
113 114
(...skipping 26 matching lines...) Expand all
140 // Finish is responsible for calling the callback provided in Start(). 141 // Finish is responsible for calling the callback provided in Start().
141 void Finish(); 142 void Finish();
142 143
143 std::vector<uint8_t> pk_hash_; 144 std::vector<uint8_t> pk_hash_;
144 base::FilePath path_; 145 base::FilePath path_;
145 base::FilePath unpack_path_; 146 base::FilePath unpack_path_;
146 base::FilePath unpack_diff_path_; 147 base::FilePath unpack_diff_path_;
147 bool is_delta_; 148 bool is_delta_;
148 std::string fingerprint_; 149 std::string fingerprint_;
149 scoped_refptr<ComponentPatcher> patcher_; 150 scoped_refptr<ComponentPatcher> patcher_;
150 ComponentInstaller* installer_; 151 scoped_refptr<ComponentInstaller> installer_;
151 Callback callback_; 152 Callback callback_;
152 scoped_refptr<OutOfProcessPatcher> oop_patcher_; 153 scoped_refptr<OutOfProcessPatcher> oop_patcher_;
153 Error error_; 154 Error error_;
154 int extended_error_; 155 int extended_error_;
155 scoped_refptr<base::SequencedTaskRunner> task_runner_; 156 scoped_refptr<base::SequencedTaskRunner> task_runner_;
156 157
157 DISALLOW_COPY_AND_ASSIGN(ComponentUnpacker); 158 DISALLOW_COPY_AND_ASSIGN(ComponentUnpacker);
158 }; 159 };
159 160
160 } // namespace update_client 161 } // namespace update_client
161 162
162 #endif // COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_ 163 #endif // COMPONENTS_UPDATE_CLIENT_COMPONENT_UNPACKER_H_
OLDNEW
« no previous file with comments | « components/update_client/component_patcher_operation.cc ('k') | components/update_client/component_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698