Chromium Code Reviews| Index: chrome/browser/component_updater/component_updater_service.h |
| diff --git a/chrome/browser/component_updater/component_updater_service.h b/chrome/browser/component_updater/component_updater_service.h |
| index 6dec6016c6b239a6f139ccab0d623263b7efa6f8..665ed65dbfcbaca586d64d316ab97269101ac515 100644 |
| --- a/chrome/browser/component_updater/component_updater_service.h |
| +++ b/chrome/browser/component_updater/component_updater_service.h |
| @@ -8,6 +8,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "base/callback_forward.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/version.h" |
| @@ -171,6 +172,16 @@ class ComponentUpdateService { |
| // proactively triggered outside the normal component update service schedule. |
| virtual OnDemandUpdater& GetOnDemandUpdater() = 0; |
| + // |callback| is called on the main thread once the component with |crx_id| |
| + // is downloaded and installed. |callback| may be called synchronously |
|
Sorin Jianu
2014/08/01 00:03:06
We need to better document the intention and the f
tommycli
2014/08/05 21:30:25
I rewrote parts of the comment. It's a bit long no
|
| + // if component is already installed. The function implements a cooldown |
| + // interval of 30 minutes. That means it will ineffective to call the |
| + // function before the cooldown interval has passed. This behavior is intended |
| + // to be defensive against programming bugs, usually triggered by web fetches, |
| + // where the on-demand functionality is invoked too often. |
| + virtual void MaybeThrottle(const std::string& crx_id, |
| + const base::Closure& callback) = 0; |
| + |
| // Returns a task runner suitable for use by component installers. |
| virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() = 0; |
| @@ -183,7 +194,6 @@ class ComponentUpdateService { |
| CrxUpdateItem* item) const = 0; |
| friend class ::ComponentsUI; |
| - FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate); |
| }; |
| typedef ComponentUpdateService::Observer ServiceObserver; |
| @@ -192,17 +202,6 @@ class OnDemandUpdater { |
| public: |
| virtual ~OnDemandUpdater() {} |
| - // Returns a network resource throttle. It means that a component will be |
| - // downloaded and installed before the resource is unthrottled. This function |
| - // can be called from the IO thread. The function implements a cooldown |
| - // interval of 30 minutes. That means it will ineffective to call the |
| - // function before the cooldown interval has passed. This behavior is intended |
| - // to be defensive against programming bugs, usually triggered by web fetches, |
| - // where the on-demand functionality is invoked too often. |
| - virtual content::ResourceThrottle* GetOnDemandResourceThrottle( |
| - net::URLRequest* request, |
| - const std::string& crx_id) = 0; |
| - |
| private: |
| friend class OnDemandTester; |
| friend class ::ComponentsUI; |