Home | History | Annotate | Download | only in extensions

Lines Matching refs:bucket

51     // Apply heuristic to each item (bucket).
80 void QuotaLimitHeuristic::Bucket::Reset(const Config& config,
98 if ((*i)->expiration().is_null()) // A brand new bucket.
114 bool ExtensionsQuotaService::TimedLimit::Apply(Bucket* bucket,
116 if (event_time > bucket->expiration())
117 bucket->Reset(config(), event_time);
119 return bucket->DeductToken();
122 bool ExtensionsQuotaService::SustainedLimit::Apply(Bucket* bucket,
124 if (event_time > bucket->expiration()) {
127 // state in the bucket expired recently (it has been long enough since the
128 // event that we don't care about the last event), but the bucket still has
131 // up all the tokens in the last bucket, nothing happened in the entire
133 if (bucket->has_tokens() || event_time > bucket->expiration() +
135 bucket->Reset(config(), event_time);
140 // repeat_exhaustion_allowance_ times, it's a violation. Reset the bucket
143 bucket->Reset(config(), bucket->expiration());
150 // We can go negative since we check has_tokens when we get to *next* bucket,
153 bucket->DeductToken();