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

Unified Diff: components/web_cache/browser/web_cache_manager.h

Issue 1706603004: Replace web_cache_messages.h with Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ken's comments Created 4 years, 10 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/browser/web_cache_manager.h
diff --git a/components/web_cache/browser/web_cache_manager.h b/components/web_cache/browser/web_cache_manager.h
index a0c19073612c326778bc3109dfc636a823581ad5..4fd3e9c8a32b3c8c591a445c612ff337c001ae4a 100644
--- a/components/web_cache/browser/web_cache_manager.h
+++ b/components/web_cache/browser/web_cache_manager.h
@@ -19,6 +19,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
+#include "components/web_cache/public/interfaces/web_cache_service.mojom.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -31,6 +32,8 @@ class PrefRegistrySimple;
namespace web_cache {
+using mojom::WebCacheServicePtr;
+
// Note: memory usage uses uint64_t because potentially the browser could be
// 32 bit and the renderers 64 bits.
class WebCacheManager : public content::NotificationObserver {
@@ -140,6 +143,8 @@ class WebCacheManager : public content::NotificationObserver {
// each renderer is permitted to consume for its cache.
typedef std::list<Allocation> AllocationStrategy;
+ typedef std::map<int, WebCacheServicePtr> WebCacheServicesMap;
+
// This class is a singleton. Do not instantiate directly.
WebCacheManager();
friend struct base::DefaultSingletonTraits<WebCacheManager>;
@@ -257,6 +262,9 @@ class WebCacheManager : public content::NotificationObserver {
content::NotificationRegistrar registrar_;
+ // Maps every renderer_id with its corresponding WebCacheServicePtr.
+ WebCacheServicesMap web_cache_services_;
+
base::WeakPtrFactory<WebCacheManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebCacheManager);

Powered by Google App Engine
This is Rietveld 408576698