OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 | 130 |
131 // Stop the timer to prevent scheduled updates for testing. | 131 // Stop the timer to prevent scheduled updates for testing. |
132 void StopTimerForTesting(); | 132 void StopTimerForTesting(); |
133 | 133 |
134 private: | 134 private: |
135 friend class ExtensionUpdaterTest; | 135 friend class ExtensionUpdaterTest; |
136 friend class ExtensionUpdaterFileHandler; | 136 friend class ExtensionUpdaterFileHandler; |
137 | 137 |
138 // FetchedCRXFile holds information about a CRX file we fetched to disk, | 138 // FetchedCRXFile holds information about a CRX file we fetched to disk, |
139 // but have not yet installed. | 139 // but have not yet installed. |
140 struct FetchedCRXFile { | 140 struct FetchedCRXFile : public CRXFileInfo { |
asargent_no_longer_on_chrome
2015/02/03 00:42:55
I think we'd be better off using composition (have
| |
141 FetchedCRXFile(); | 141 FetchedCRXFile(); |
142 FetchedCRXFile(const std::string& id, | 142 FetchedCRXFile(const CRXFileInfo& file, |
143 const base::FilePath& path, | |
144 bool file_ownership_passed, | 143 bool file_ownership_passed, |
145 const std::set<int>& request_ids); | 144 const std::set<int>& request_ids); |
146 ~FetchedCRXFile(); | 145 ~FetchedCRXFile(); |
147 | 146 |
148 std::string extension_id; | |
149 base::FilePath path; | |
150 bool file_ownership_passed; | 147 bool file_ownership_passed; |
151 std::set<int> request_ids; | 148 std::set<int> request_ids; |
152 }; | 149 }; |
153 | 150 |
154 struct InProgressCheck { | 151 struct InProgressCheck { |
155 InProgressCheck(); | 152 InProgressCheck(); |
156 ~InProgressCheck(); | 153 ~InProgressCheck(); |
157 | 154 |
158 bool install_immediately; | 155 bool install_immediately; |
159 FinishedCallback callback; | 156 FinishedCallback callback; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 void TimerFired(); | 188 void TimerFired(); |
192 | 189 |
193 // Posted by CheckSoon(). | 190 // Posted by CheckSoon(). |
194 void DoCheckSoon(); | 191 void DoCheckSoon(); |
195 | 192 |
196 // Implementation of ExtensionDownloaderDelegate. | 193 // Implementation of ExtensionDownloaderDelegate. |
197 void OnExtensionDownloadFailed(const std::string& id, | 194 void OnExtensionDownloadFailed(const std::string& id, |
198 Error error, | 195 Error error, |
199 const PingResult& ping, | 196 const PingResult& ping, |
200 const std::set<int>& request_ids) override; | 197 const std::set<int>& request_ids) override; |
201 void OnExtensionDownloadFinished(const std::string& id, | 198 void OnExtensionDownloadFinished(const CRXFileInfo& file, |
202 const base::FilePath& path, | |
203 bool file_ownership_passed, | 199 bool file_ownership_passed, |
204 const GURL& download_url, | 200 const GURL& download_url, |
205 const std::string& version, | 201 const std::string& version, |
206 const PingResult& ping, | 202 const PingResult& ping, |
207 const std::set<int>& request_id) override; | 203 const std::set<int>& request_id) override; |
208 bool GetPingDataForExtension(const std::string& id, | 204 bool GetPingDataForExtension(const std::string& id, |
209 ManifestFetchData::PingData* ping_data) override; | 205 ManifestFetchData::PingData* ping_data) override; |
210 std::string GetUpdateUrlData(const std::string& id) override; | 206 std::string GetUpdateUrlData(const std::string& id) override; |
211 bool IsExtensionPending(const std::string& id) override; | 207 bool IsExtensionPending(const std::string& id) override; |
212 bool GetExtensionExistingVersion(const std::string& id, | 208 bool GetExtensionExistingVersion(const std::string& id, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 std::set<std::string> forced_updates_; | 287 std::set<std::string> forced_updates_; |
292 | 288 |
293 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; | 289 base::WeakPtrFactory<ExtensionUpdater> weak_ptr_factory_; |
294 | 290 |
295 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); | 291 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); |
296 }; | 292 }; |
297 | 293 |
298 } // namespace extensions | 294 } // namespace extensions |
299 | 295 |
300 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ | 296 #endif // CHROME_BROWSER_EXTENSIONS_UPDATER_EXTENSION_UPDATER_H_ |
OLD | NEW |