| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UPDATER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UPDATER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UPDATER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // Set blacklist checks on or off. | 201 // Set blacklist checks on or off. |
| 202 void set_blacklist_checks_enabled(bool enabled) { | 202 void set_blacklist_checks_enabled(bool enabled) { |
| 203 blacklist_checks_enabled_ = enabled; | 203 blacklist_checks_enabled_ = enabled; |
| 204 } | 204 } |
| 205 | 205 |
| 206 // Returns true iff CheckSoon() has been called but the update check | 206 // Returns true iff CheckSoon() has been called but the update check |
| 207 // hasn't been performed yet. This is used mostly by tests; calling | 207 // hasn't been performed yet. This is used mostly by tests; calling |
| 208 // code should just call CheckSoon(). | 208 // code should just call CheckSoon(). |
| 209 bool WillCheckSoon() const; | 209 bool WillCheckSoon() const; |
| 210 | 210 |
| 211 void set_use_utility_process_for_testing(bool value) { |
| 212 use_utility_process_ = value; |
| 213 } |
| 214 |
| 211 private: | 215 private: |
| 212 friend class ExtensionUpdaterTest; | 216 friend class ExtensionUpdaterTest; |
| 213 friend class ExtensionUpdaterFileHandler; | 217 friend class ExtensionUpdaterFileHandler; |
| 214 friend class SafeManifestParser; | 218 friend class SafeManifestParser; |
| 215 | 219 |
| 216 // We need to keep track of some information associated with a url | 220 // We need to keep track of some information associated with a url |
| 217 // when doing a fetch. | 221 // when doing a fetch. |
| 218 struct ExtensionFetch { | 222 struct ExtensionFetch { |
| 219 ExtensionFetch(); | 223 ExtensionFetch(); |
| 220 ExtensionFetch(const std::string& i, const GURL& u, | 224 ExtensionFetch(const std::string& i, const GURL& u, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // The ids of extensions that have in-progress update checks. | 380 // The ids of extensions that have in-progress update checks. |
| 377 std::set<std::string> in_progress_ids_; | 381 std::set<std::string> in_progress_ids_; |
| 378 | 382 |
| 379 // Observes CRX installs we initiate. | 383 // Observes CRX installs we initiate. |
| 380 content::NotificationRegistrar registrar_; | 384 content::NotificationRegistrar registrar_; |
| 381 | 385 |
| 382 // True when a CrxInstaller is doing an install. Used in MaybeUpdateCrxFile() | 386 // True when a CrxInstaller is doing an install. Used in MaybeUpdateCrxFile() |
| 383 // to keep more than one install from running at once. | 387 // to keep more than one install from running at once. |
| 384 bool crx_install_is_running_; | 388 bool crx_install_is_running_; |
| 385 | 389 |
| 390 // True if the utility process is used, false otherwise (i.e. for tests). |
| 391 bool use_utility_process_; |
| 392 |
| 386 // Fetched CRX files waiting to be installed. | 393 // Fetched CRX files waiting to be installed. |
| 387 std::stack<FetchedCRXFile> fetched_crx_files_; | 394 std::stack<FetchedCRXFile> fetched_crx_files_; |
| 388 | 395 |
| 389 FRIEND_TEST_ALL_PREFIXES(ExtensionUpdaterTest, TestStartUpdateCheckMemory); | 396 FRIEND_TEST_ALL_PREFIXES(ExtensionUpdaterTest, TestStartUpdateCheckMemory); |
| 390 FRIEND_TEST_ALL_PREFIXES(ExtensionUpdaterTest, TestAfterStopBehavior); | 397 FRIEND_TEST_ALL_PREFIXES(ExtensionUpdaterTest, TestAfterStopBehavior); |
| 391 | 398 |
| 392 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); | 399 DISALLOW_COPY_AND_ASSIGN(ExtensionUpdater); |
| 393 }; | 400 }; |
| 394 | 401 |
| 395 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UPDATER_H_ | 402 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UPDATER_H_ |
| OLD | NEW |