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

Unified Diff: webkit/browser/quota/quota_manager.h

Issue 218793002: Provide monitoring of usage for a storage type and origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: webkit/browser/quota/quota_manager.h
diff --git a/webkit/browser/quota/quota_manager.h b/webkit/browser/quota/quota_manager.h
index a6eeb837ac630108234fddbf08fe40b7f637b222..861ee8ac1192cef2698554cd672c7b79d355bb2c 100644
--- a/webkit/browser/quota/quota_manager.h
+++ b/webkit/browser/quota/quota_manager.h
@@ -25,6 +25,7 @@
#include "webkit/browser/quota/quota_database.h"
#include "webkit/browser/quota/quota_task.h"
#include "webkit/browser/quota/special_storage_policy.h"
+#include "webkit/browser/quota/storage_observer.h"
#include "webkit/browser/webkit_storage_browser_export.h"
namespace base {
@@ -43,6 +44,7 @@ class MockQuotaManager;
class QuotaDatabase;
class QuotaManagerProxy;
class QuotaTemporaryStorageEvictor;
+class StorageMonitor;
class UsageTracker;
struct QuotaManagerDeleter;
@@ -225,6 +227,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
bool ResetUsageTracker(StorageType type);
+ // Used to register/deregister observers that wish to monitor storage events.
+ void AddStorageObserver(StorageObserver* observer,
+ const StorageObserver::MonitorParams& params);
+ void RemoveStorageObserver(StorageObserver* observer);
+ void RemoveStorageObserverForFilter(StorageObserver* observer,
+ const StorageObserver::Filter& filter);
+
// Determines the portion of the temp pool that can be
// utilized by a single host (ie. 5 for 20%).
static const int kPerHostTemporaryPortion;
@@ -257,6 +266,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
friend class QuotaManagerTest;
friend class QuotaTemporaryStorageEvictor;
friend struct QuotaManagerDeleter;
+ friend class StorageMonitorTest;
class GetUsageInfoTask;
@@ -425,6 +435,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManager
// value. The default value points to base::SysInfo::AmountOfFreeDiskSpace.
GetAvailableDiskSpaceFn get_disk_space_fn_;
+ scoped_ptr<StorageMonitor> storage_monitor_;
+
base::WeakPtrFactory<QuotaManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(QuotaManager);

Powered by Google App Engine
This is Rietveld 408576698