// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SYNC_ENGINE_CYCLE_COMMIT_QUOTA_H_ #define COMPONENTS_SYNC_ENGINE_CYCLE_COMMIT_QUOTA_H_ #include "base/time/time.h" namespace syncer { // Tracks quota for commits with `max_tokens` being also the initial token // count. A token is refilled every `refill_interval` if below the maximum token // count. Tokens are consumed one by one by `ConsumeToken()` until they reach // the zero. When having zero tokens, calls to `ConsumeToken()` only reset the // refill "timer" (pushing away the next refill to happen after // `refill_interval` from now). class CommitQuota { … }; } // namespace syncer #endif // COMPONENTS_SYNC_ENGINE_CYCLE_COMMIT_QUOTA_H_