| Index: components/web_cache/renderer/web_cache_render_process_observer.h
|
| diff --git a/components/web_cache/renderer/web_cache_render_process_observer.h b/components/web_cache/renderer/web_cache_render_process_observer.h
|
| index 714ef231f2bb0134f0d83b3e06e24b1a7fbca4b9..17d1f8e920906d2c904c7fadf7284a562d99f640 100644
|
| --- a/components/web_cache/renderer/web_cache_render_process_observer.h
|
| +++ b/components/web_cache/renderer/web_cache_render_process_observer.h
|
| @@ -10,33 +10,37 @@
|
|
|
| #include "base/compiler_specific.h"
|
| #include "base/macros.h"
|
| +#include "components/web_cache/common/web_cache_service.mojom.h"
|
| #include "content/public/renderer/render_process_observer.h"
|
| +#include "mojo/public/cpp/bindings/weak_binding_set.h"
|
|
|
| namespace web_cache {
|
|
|
| -// This class filters the incoming cache related control messages.
|
| -class WebCacheRenderProcessObserver : public content::RenderProcessObserver {
|
| +// This class implements the Mojo interface WebCacheService.
|
| +class WebCacheRenderProcessObserver : public WebCacheService,
|
| + public content::RenderProcessObserver {
|
| public:
|
| WebCacheRenderProcessObserver();
|
| ~WebCacheRenderProcessObserver() override;
|
|
|
| + void BindRequest(mojo::InterfaceRequest<WebCacheService> web_cache_request);
|
| +
|
| // 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.
|
| - bool OnControlMessageReceived(const IPC::Message& message) override;
|
| void WebKitInitialized() override;
|
| void OnRenderProcessShutdown() override;
|
|
|
| - // Message handlers.
|
| - void OnSetCacheCapacities(uint64_t min_dead_capacity,
|
| - uint64_t max_dead_capacity,
|
| - uint64_t capacity);
|
| + // WebCacheService methods:
|
| + void SetCacheCapacities(uint64_t min_dead_capacity,
|
| + uint64_t max_dead_capacity,
|
| + uint64_t capacity) override;
|
| // If |on_navigation| is true, the clearing is delayed until the next
|
| // navigation event.
|
| - void OnClearCache(bool on_navigation);
|
| + void ClearCache(bool on_navigation) override;
|
|
|
| // If true, the web cache shall be cleared before the next navigation event.
|
| bool clear_cache_pending_;
|
| @@ -45,6 +49,8 @@ class WebCacheRenderProcessObserver : public content::RenderProcessObserver {
|
| size_t pending_cache_max_dead_capacity_;
|
| size_t pending_cache_capacity_;
|
|
|
| + mojo::WeakBindingSet<WebCacheService> bindings_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(WebCacheRenderProcessObserver);
|
| };
|
|
|
|
|