| Index: chrome/browser/extensions/api/web_request/web_request_api.cc
|
| diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc
|
| index 665c484b212ed1beece388d12a8f85dffbf10f74..74d9a1af5c48ff79a2e9c4037fd1a2f3fe3f60ba 100644
|
| --- a/chrome/browser/extensions/api/web_request/web_request_api.cc
|
| +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc
|
| @@ -31,6 +31,7 @@
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/renderer_host/chrome_render_message_filter.h"
|
| #include "chrome/browser/renderer_host/web_cache_manager.h"
|
| +#include "chrome/common/extensions/api/web_request.h"
|
| #include "chrome/common/extensions/event_filtering_info.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/common/extensions/extension_constants.h"
|
| @@ -59,6 +60,7 @@ using extensions::web_navigation_api_helpers::GetFrameId;
|
|
|
| namespace helpers = extension_web_request_api_helpers;
|
| namespace keys = extension_web_request_api_constants;
|
| +namespace web_request = extensions::api::web_request;
|
|
|
| namespace {
|
|
|
| @@ -1557,7 +1559,10 @@ void ExtensionWebRequestEventRouter::ClearSignaled(uint64 request_id,
|
| class ClearCacheQuotaHeuristic : public QuotaLimitHeuristic {
|
| public:
|
| ClearCacheQuotaHeuristic(const Config& config, BucketMapper* map)
|
| - : QuotaLimitHeuristic(config, map),
|
| + : QuotaLimitHeuristic(
|
| + config,
|
| + map,
|
| + "MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES"),
|
| callback_registered_(false),
|
| weak_ptr_factory_(this) {}
|
| virtual ~ClearCacheQuotaHeuristic() {}
|
| @@ -1791,8 +1796,9 @@ bool WebRequestEventHandled::RunImpl() {
|
| void WebRequestHandlerBehaviorChanged::GetQuotaLimitHeuristics(
|
| QuotaLimitHeuristics* heuristics) const {
|
| QuotaLimitHeuristic::Config config = {
|
| - 20, // Refill 20 tokens per interval.
|
| - base::TimeDelta::FromMinutes(10) // 10 minutes refill interval.
|
| + // See web_request.json for current value.
|
| + web_request::MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES,
|
| + base::TimeDelta::FromMinutes(10)
|
| };
|
| QuotaLimitHeuristic::BucketMapper* bucket_mapper =
|
| new QuotaLimitHeuristic::SingletonBucketMapper();
|
| @@ -1801,7 +1807,8 @@ void WebRequestHandlerBehaviorChanged::GetQuotaLimitHeuristics(
|
| heuristics->push_back(heuristic);
|
| }
|
|
|
| -void WebRequestHandlerBehaviorChanged::OnQuotaExceeded() {
|
| +void WebRequestHandlerBehaviorChanged::OnQuotaExceeded(
|
| + const std::string& violation_error) {
|
| // Post warning message.
|
| std::set<std::string> extension_ids;
|
| extension_ids.insert(extension_id());
|
|
|