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

Unified Diff: chrome/browser/component_updater/component_updater_service.h

Issue 313373004: Eliminate the cooldown for direct calls to on-demand updates in CUS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35d4b3aa856bed09fbaf4f8f87123c983d4f31e7..fe77d4e4927b7ca3f0f76a3e1548b57ffe58b460 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/gtest_prod_util.h"
#include "base/version.h"
#include "url/gurl.h"
@@ -199,12 +200,6 @@ class ComponentUpdateService {
// Returns a list of registered components.
virtual std::vector<std::string> GetComponentIDs() const = 0;
- // Returns details about registered component.
- // Note: Object returned here is owned by this class, in simple words
- // don't try to free this object.
- virtual CrxUpdateItem* GetComponentDetails(
- const std::string& component_id) const = 0;
-
// Returns an interface for on-demand updates. On-demand updates are
// proactively triggered outside the normal component update service schedule.
virtual OnDemandUpdater& GetOnDemandUpdater() = 0;
@@ -212,7 +207,13 @@ class ComponentUpdateService {
virtual ~ComponentUpdateService() {}
private:
+ // Returns details about registered component. The object returned is owned
+ // by this class. TODO(sorin): replace with a WeakPtr.
+ virtual CrxUpdateItem* GetComponentDetails(
+ const std::string& component_id) const = 0;
+
friend class ::ComponentsUI;
+ FRIEND_TEST_ALL_PREFIXES(ComponentUpdaterTest, ResourceThrottleLiveNoUpdate);
};
typedef ComponentUpdateService::Observer ServiceObserver;
@@ -223,7 +224,11 @@ class 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.
+ // 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;
@@ -237,7 +242,7 @@ class OnDemandUpdater {
// in progress, the function returns |kInProgress|. If an update is available,
// the update will be applied. The caller can subscribe to component update
// service notifications to get an indication about the outcome of the
- // on-demand update.
+ // on-demand update. The function does not implement any cooldown interval.
virtual ComponentUpdateService::Status OnDemandUpdate(
const std::string& component_id) = 0;
};
« no previous file with comments | « no previous file | chrome/browser/component_updater/component_updater_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698