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

Unified Diff: components/web_cache/renderer/web_cache_render_process_observer.h

Issue 1706603004: Replace web_cache_messages.h with Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 years, 9 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: 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..d0b7d8c0dd839123f538ac8708e19ebc0c57fcdb 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/public/interfaces/web_cache.mojom.h"
#include "content/public/renderer/render_process_observer.h"
+#include "mojo/public/cpp/bindings/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 mojom::WebCache.
+class WebCacheRenderProcessObserver : public mojom::WebCache,
+ public content::RenderProcessObserver {
public:
WebCacheRenderProcessObserver();
~WebCacheRenderProcessObserver() override;
+ void BindRequest(mojo::InterfaceRequest<mojom::WebCache> 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);
+ // mojom::WebCache 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::BindingSet<mojom::WebCache> bindings_;
+
DISALLOW_COPY_AND_ASSIGN(WebCacheRenderProcessObserver);
};

Powered by Google App Engine
This is Rietveld 408576698