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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc

Issue 10905040: Clear in-memory caches of renderers when rules change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Previous version was incomplete Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
index 12d5dac386458bc46fc163186acd74988a49640b..77bc9b8f44ef22fa8bbbf5a3aa67ed9398a29687 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc
@@ -165,6 +165,8 @@ std::string WebRequestRulesRegistry::AddRulesImpl(
}
url_matcher_.AddConditionSets(all_new_condition_sets);
+ ClearCacheOnNavigation();
+
return "";
}
@@ -200,6 +202,8 @@ std::string WebRequestRulesRegistry::RemoveRulesImpl(
// Clear URLMatcher based on condition_set_ids that are not needed any more.
url_matcher_.RemoveConditionSets(remove_from_url_matcher);
+ ClearCacheOnNavigation();
+
return "";
}
@@ -214,6 +218,8 @@ std::string WebRequestRulesRegistry::RemoveAllRulesImpl(
rule_identifiers.push_back(global_rule_id.second);
}
+ // No need to call ClearCacheOnNavigation() here because RemoveRulesImpl
+ // takes care of that.
return RemoveRulesImpl(extension_id, rule_identifiers);
}
@@ -236,4 +242,8 @@ base::Time WebRequestRulesRegistry::GetExtensionInstallationTime(
return extension_info_map_->GetInstallTime(extension_id);
}
+void WebRequestRulesRegistry::ClearCacheOnNavigation() {
+ extension_web_request_api_helpers::ClearCacheOnNavigation();
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698