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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api_helpers.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
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
index 5a7113d44bc6e25e2293c526ef5df4244cb85e55..e476069e5a5c01b9e63fb71b74594afe1aa4f029 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc
@@ -10,7 +10,9 @@
#include "base/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/web_request/web_request_api.h"
+#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/browser_thread.h"
#include "net/base/net_log.h"
#include "net/cookies/parsed_cookie.h"
#include "net/http/http_util.h"
@@ -1017,4 +1019,20 @@ bool CanExtensionAccessURL(const extensions::Extension* extension,
url.GetOrigin() == extension->url());
}
+namespace {
Yoyo Zhou 2012/08/31 20:24:57 I understand why you might want to keep this code
battre 2012/09/03 09:56:44 Done.
+void ClearCacheOnNavigationOnUI() {
+ WebCacheManager::GetInstance()->ClearCacheOnNavigation();
+}
+} // namespace
+
+void ClearCacheOnNavigation() {
+ if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
+ ClearCacheOnNavigationOnUI();
+ } else {
+ content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&ClearCacheOnNavigationOnUI));
+ }
+}
+
+
} // namespace extension_web_request_api_helpers
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698