| Index: components/update_client/update_engine.h
|
| diff --git a/components/update_client/update_engine.h b/components/update_client/update_engine.h
|
| index f2a577a393f4cecef88220d82ac76a0b552fc800..1d69ece4d62ca51363623fb2b29b82e5937b433b 100644
|
| --- a/components/update_client/update_engine.h
|
| +++ b/components/update_client/update_engine.h
|
| @@ -63,6 +63,10 @@ class UpdateEngine {
|
| private:
|
| void UpdateComplete(UpdateContext* update_context, int error);
|
|
|
| + // Returns true if the update engine rejects this update call because it
|
| + // occurs too soon.
|
| + bool IsThrottled(bool is_foreground) const;
|
| +
|
| base::ThreadChecker thread_checker_;
|
|
|
| scoped_refptr<Configurator> config_;
|
| @@ -79,6 +83,12 @@ class UpdateEngine {
|
| // Contains the contexts associated with each update in progress.
|
| std::set<UpdateContext*> update_contexts_;
|
|
|
| + // Implements a rate limiting mechanism for background update checks. Has the
|
| + // effect of rejecting the update call if the update call occurs before
|
| + // a certain time, which is negotiated with the server as part of the
|
| + // update protocol. See the comments for X-Retry-After header.
|
| + base::Time throttle_updates_until_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(UpdateEngine);
|
| };
|
|
|
| @@ -135,6 +145,9 @@ struct UpdateContext {
|
|
|
| // Contains the ids of the items to update.
|
| std::queue<std::string> queue;
|
| +
|
| + // The time in seconds to wait until doing further update checks.
|
| + int retry_after_sec_;
|
| };
|
|
|
| } // namespace update_client
|
|
|