summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_quota_service.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 09:20:25 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 09:20:25 +0000
commitfd50e7b218e48d2299664f71b3af13e4acae1868 (patch)
tree6e0a1b640147e352b2d9849fcd47148dc5cc5d9e /chrome/browser/extensions/extensions_quota_service.h
parent52447df4674e60c7dc78fa6742885f8ae470a517 (diff)
downloadchromium_src-fd50e7b218e48d2299664f71b3af13e4acae1868.zip
chromium_src-fd50e7b218e48d2299664f71b3af13e4acae1868.tar.gz
chromium_src-fd50e7b218e48d2299664f71b3af13e4acae1868.tar.bz2
Trigger warning if extensions call webRequest.handlerBehaviorChanged too frequently
BUG=Write extension that calls webRequest.handlerBehaviorChanged 10 times in short succession - already simulated in unittest. TEST=no Review URL: http://codereview.chromium.org/8417038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_quota_service.h')
-rw-r--r--chrome/browser/extensions/extensions_quota_service.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_quota_service.h b/chrome/browser/extensions/extensions_quota_service.h
index a0329b2a..0f16686 100644
--- a/chrome/browser/extensions/extensions_quota_service.h
+++ b/chrome/browser/extensions/extensions_quota_service.h
@@ -19,6 +19,7 @@
#include <map>
#include <string>
+#include "base/compiler_specific.h"
#include "base/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
@@ -141,6 +142,20 @@ class QuotaLimitHeuristic {
BucketList* buckets) = 0;
};
+ // Maps all calls to the same bucket, regardless of |args|, for this
+ // QuotaLimitHeuristic.
+ class SingletonBucketMapper : public BucketMapper {
+ public:
+ SingletonBucketMapper() {}
+ virtual ~SingletonBucketMapper() {}
+ virtual void GetBucketsForArgs(const ListValue* args,
+ BucketList* buckets) OVERRIDE;
+
+ private:
+ Bucket bucket_;
+ DISALLOW_COPY_AND_ASSIGN(SingletonBucketMapper);
+ };
+
// Ownership of |mapper| is given to the new QuotaLimitHeuristic.
QuotaLimitHeuristic(const Config& config, BucketMapper* map);
virtual ~QuotaLimitHeuristic();