diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 16:54:31 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 16:54:31 +0000 |
commit | e81d4d7c8966f4650ea8041f8d0bad4fe72b4f54 (patch) | |
tree | 46394d04d84e59b9caf598a7138350c3400762c9 /chrome/renderer/chrome_render_process_observer.h | |
parent | 965b6b2599050aab93cc398630d10ce30f3b4248 (diff) | |
download | chromium_src-e81d4d7c8966f4650ea8041f8d0bad4fe72b4f54.zip chromium_src-e81d4d7c8966f4650ea8041f8d0bad4fe72b4f54.tar.gz chromium_src-e81d4d7c8966f4650ea8041f8d0bad4fe72b4f54.tar.bz2 |
Allow webRequest API extensions to clear the in-memory cache of WebKit.
If the behavior of a webRequest API extension changes (i.e. different URLs are blocked) this effect was not visible instantly due to WebKit's in-memory cache. This CL introduces a means to clear the cache.
BUG=94284
TEST=no
Review URL: http://codereview.chromium.org/7835031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/chrome_render_process_observer.h')
-rw-r--r-- | chrome/renderer/chrome_render_process_observer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/renderer/chrome_render_process_observer.h b/chrome/renderer/chrome_render_process_observer.h index 80bf18ef..615b6c3 100644 --- a/chrome/renderer/chrome_render_process_observer.h +++ b/chrome/renderer/chrome_render_process_observer.h @@ -33,6 +33,10 @@ class ChromeRenderProcessObserver : public RenderProcessObserver { static bool is_incognito_process() { return is_incognito_process_; } + // Needs to be called by RenderViews in case of navigations to execute + // any 'clear cache' commands that were delayed until the next navigation. + void ExecutePendingClearCache(); + private: // RenderProcessObserver implementation. virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; @@ -45,7 +49,9 @@ class ChromeRenderProcessObserver : public RenderProcessObserver { void OnSetCacheCapacities(size_t min_dead_capacity, size_t max_dead_capacity, size_t capacity); - void OnClearCache(); + // If |on_navigation| is true, the clearing is delayed until the next + // navigation event. + void OnClearCache(bool on_navigation); void OnGetCacheResourceStats(); void OnSetFieldTrialGroup(const std::string& fiel_trial_name, const std::string& group_name); @@ -58,6 +64,8 @@ class ChromeRenderProcessObserver : public RenderProcessObserver { static bool is_incognito_process_; scoped_ptr<ResourceDispatcherDelegate> resource_delegate_; chrome::ChromeContentRendererClient* client_; + // If true, the web cache shall be cleared before the next navigation event. + bool clear_cache_pending_; DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); }; |