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 EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ | 5 #ifndef EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ |
6 #define EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ | 6 #define EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 // The |request_id| is passed on as is to the various |delegate_| callbacks. | 73 // The |request_id| is passed on as is to the various |delegate_| callbacks. |
74 // This is used for example by ExtensionUpdater to keep track of when | 74 // This is used for example by ExtensionUpdater to keep track of when |
75 // potentially concurrent update checks complete. | 75 // potentially concurrent update checks complete. |
76 bool AddExtension(const Extension& extension, int request_id); | 76 bool AddExtension(const Extension& extension, int request_id); |
77 | 77 |
78 // Adds extension |id| to the list of extensions to check for updates. | 78 // Adds extension |id| to the list of extensions to check for updates. |
79 // Returns false if the |id| can't be updated due to invalid details. | 79 // Returns false if the |id| can't be updated due to invalid details. |
80 // In that case, no callbacks will be performed on the |delegate_|. | 80 // In that case, no callbacks will be performed on the |delegate_|. |
81 // The |request_id| is passed on as is to the various |delegate_| callbacks. | 81 // The |request_id| is passed on as is to the various |delegate_| callbacks. |
82 // This is used for example by ExtensionUpdater to keep track of when | 82 // This is used for example by ExtensionUpdater to keep track of when |
83 // potentially concurrent update checks complete. | 83 // potentially concurrent update checks complete. |
lazyboy
2016/09/02 19:21:53
Update comment about |is_corrupt_reinstall|
asargent_no_longer_on_chrome
2016/09/09 03:30:44
Done.
| |
84 bool AddPendingExtension(const std::string& id, | 84 bool AddPendingExtension(const std::string& id, |
85 const GURL& update_url, | 85 const GURL& update_url, |
86 bool is_corrupt_reinstall, | |
86 int request_id); | 87 int request_id); |
87 | 88 |
88 // Schedules a fetch of the manifest of all the extensions added with | 89 // Schedules a fetch of the manifest of all the extensions added with |
89 // AddExtension() and AddPendingExtension(). | 90 // AddExtension() and AddPendingExtension(). |
90 void StartAllPending(ExtensionCache* cache); | 91 void StartAllPending(ExtensionCache* cache); |
91 | 92 |
92 // Schedules an update check of the blacklist. | 93 // Schedules an update check of the blacklist. |
93 void StartBlacklistUpdate(const std::string& version, | 94 void StartBlacklistUpdate(const std::string& version, |
94 const ManifestFetchData::PingData& ping_data, | 95 const ManifestFetchData::PingData& ping_data, |
95 int request_id); | 96 int request_id); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 // Counts the number of times OAuth2 authentication has been attempted for | 176 // Counts the number of times OAuth2 authentication has been attempted for |
176 // this fetch. | 177 // this fetch. |
177 int oauth2_attempt_count; | 178 int oauth2_attempt_count; |
178 }; | 179 }; |
179 | 180 |
180 // Helper for AddExtension() and AddPendingExtension(). | 181 // Helper for AddExtension() and AddPendingExtension(). |
181 bool AddExtensionData(const std::string& id, | 182 bool AddExtensionData(const std::string& id, |
182 const base::Version& version, | 183 const base::Version& version, |
183 Manifest::Type extension_type, | 184 Manifest::Type extension_type, |
184 const GURL& extension_update_url, | 185 const GURL& extension_update_url, |
185 const std::string& update_url_data, | 186 const ManifestFetchData::ExtraParams* extra, |
lazyboy
2016/09/02 19:21:53
Prefer ManifestFetchData::ExtraParams const ref to
asargent_no_longer_on_chrome
2016/09/09 03:30:44
Done.
| |
186 int request_id); | 187 int request_id); |
187 | 188 |
188 // Adds all recorded stats taken so far to histogram counts. | 189 // Adds all recorded stats taken so far to histogram counts. |
189 void ReportStats() const; | 190 void ReportStats() const; |
190 | 191 |
191 // Begins an update check. | 192 // Begins an update check. |
192 void StartUpdateCheck(std::unique_ptr<ManifestFetchData> fetch_data); | 193 void StartUpdateCheck(std::unique_ptr<ManifestFetchData> fetch_data); |
193 | 194 |
194 // Called by RequestQueue when a new manifest fetch request is started. | 195 // Called by RequestQueue when a new manifest fetch request is started. |
195 void CreateManifestFetcher(); | 196 void CreateManifestFetcher(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 | 328 |
328 // Used to create WeakPtrs to |this|. | 329 // Used to create WeakPtrs to |this|. |
329 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_; | 330 base::WeakPtrFactory<ExtensionDownloader> weak_ptr_factory_; |
330 | 331 |
331 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader); | 332 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloader); |
332 }; | 333 }; |
333 | 334 |
334 } // namespace extensions | 335 } // namespace extensions |
335 | 336 |
336 #endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ | 337 #endif // EXTENSIONS_BROWSER_UPDATER_EXTENSION_DOWNLOADER_H_ |
OLD | NEW |