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

Side by Side Diff: chrome/browser/extensions/extensions_quota_service.cc

Issue 7342047: Cleanup base/stl_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unneeded include + rebase Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extensions_quota_service.h" 5 #include "chrome/browser/extensions/extensions_quota_service.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/extensions/extension_function.h" 9 #include "chrome/browser/extensions/extension_function.h"
10 10
11 // If the browser stays open long enough, we reset state once a day. 11 // If the browser stays open long enough, we reset state once a day.
12 // Whatever this value is, it should be an order of magnitude longer than 12 // Whatever this value is, it should be an order of magnitude longer than
13 // the longest interval in any of the QuotaLimitHeuristics in use. 13 // the longest interval in any of the QuotaLimitHeuristics in use.
14 static const int kPurgeIntervalInDays = 1; 14 static const int kPurgeIntervalInDays = 1;
15 15
16 const char QuotaLimitHeuristic::kGenericOverQuotaError[] = 16 const char QuotaLimitHeuristic::kGenericOverQuotaError[] =
17 "This request exceeds available quota."; 17 "This request exceeds available quota.";
18 18
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return false; 146 return false;
147 } 147 }
148 } 148 }
149 149
150 // We can go negative since we check has_tokens when we get to *next* bucket, 150 // We can go negative since we check has_tokens when we get to *next* bucket,
151 // and for the small interval all that matters is whether we used up all the 151 // and for the small interval all that matters is whether we used up all the
152 // tokens (which is true if num_tokens_ <= 0). 152 // tokens (which is true if num_tokens_ <= 0).
153 bucket->DeductToken(); 153 bucket->DeductToken();
154 return true; 154 return true;
155 } 155 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698