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

Unified Diff: webkit/quota/usage_tracker.h

Issue 7618025: Send notifications on the IO thread when changes are made to the special storage policy. Listen f... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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
« no previous file with comments | « webkit/quota/special_storage_policy.cc ('k') | webkit/quota/usage_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/usage_tracker.h
===================================================================
--- webkit/quota/usage_tracker.h (revision 96595)
+++ webkit/quota/usage_tracker.h (working copy)
@@ -15,15 +15,16 @@
#include "base/callback.h"
#include "base/memory/scoped_callback_factory.h"
#include "base/memory/scoped_ptr.h"
+#include "base/threading/non_thread_safe.h"
#include "googleurl/src/gurl.h"
#include "webkit/quota/quota_client.h"
#include "webkit/quota/quota_task.h"
#include "webkit/quota/quota_types.h"
+#include "webkit/quota/special_storage_policy.h"
namespace quota {
class ClientUsageTracker;
-class SpecialStoragePolicy;
// A helper class that gathers and tracks the amount of data stored in
// all quota clients.
@@ -79,13 +80,14 @@
// This class holds per-client usage tracking information and caches per-host
// usage data. An instance of this class is created per client.
-class ClientUsageTracker {
+class ClientUsageTracker : public SpecialStoragePolicy::Observer,
+ public base::NonThreadSafe {
public:
ClientUsageTracker(UsageTracker* tracker,
QuotaClient* client,
StorageType type,
SpecialStoragePolicy* special_storage_policy);
- ~ClientUsageTracker();
+ virtual ~ClientUsageTracker();
void GetGlobalUsage(GlobalUsageCallback* callback);
void GetHostUsage(const std::string& host, HostUsageCallback* callback);
@@ -109,10 +111,10 @@
void GatherHostUsageComplete(const std::string& host);
int64 GetCachedHostUsage(const std::string& host);
-
+ int64 GetCachedGlobalUnlimitedUsage();
+ virtual void OnSpecialStoragePolicyChanged() OVERRIDE;
void NoopHostUsageCallback(
const std::string& host, StorageType type, int64 usage);
-
bool IsStorageUnlimited(const GURL& origin) const;
UsageTracker* tracker_;
@@ -122,6 +124,7 @@
int64 global_usage_;
int64 global_unlimited_usage_;
bool global_usage_retrieved_;
+ bool global_unlimited_usage_is_valid_;
HostSet cached_hosts_;
HostUsageMap cached_usage_;
« no previous file with comments | « webkit/quota/special_storage_policy.cc ('k') | webkit/quota/usage_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698