Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <list> | 10 #include <list> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <utility> | |
| 14 #include <vector> | 15 #include <vector> |
| 15 | 16 |
| 16 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 17 #include "base/callback.h" | 18 #include "base/callback.h" |
| 18 #include "base/file_path.h" | 19 #include "base/file_path.h" |
| 19 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_callback_factory.h" | 21 #include "base/memory/weak_ptr.h" |
| 21 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
| 22 #include "webkit/quota/quota_database.h" | 23 #include "webkit/quota/quota_database.h" |
| 23 #include "webkit/quota/quota_client.h" | 24 #include "webkit/quota/quota_client.h" |
| 24 #include "webkit/quota/quota_task.h" | 25 #include "webkit/quota/quota_task.h" |
| 25 #include "webkit/quota/quota_types.h" | 26 #include "webkit/quota/quota_types.h" |
| 26 #include "webkit/quota/special_storage_policy.h" | 27 #include "webkit/quota/special_storage_policy.h" |
| 27 | 28 |
| 28 class FilePath; | 29 class FilePath; |
| 29 | 30 |
| 30 namespace base { | 31 namespace base { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 43 class QuotaManagerProxy; | 44 class QuotaManagerProxy; |
| 44 class QuotaTemporaryStorageEvictor; | 45 class QuotaTemporaryStorageEvictor; |
| 45 class UsageTracker; | 46 class UsageTracker; |
| 46 class MockQuotaManager; | 47 class MockQuotaManager; |
| 47 | 48 |
| 48 // An interface called by QuotaTemporaryStorageEvictor. | 49 // An interface called by QuotaTemporaryStorageEvictor. |
| 49 class QuotaEvictionHandler { | 50 class QuotaEvictionHandler { |
| 50 public: | 51 public: |
| 51 virtual ~QuotaEvictionHandler() {} | 52 virtual ~QuotaEvictionHandler() {} |
| 52 | 53 |
| 53 typedef Callback1<const GURL&>::Type GetLRUOriginCallback; | 54 typedef base::Callback<void (const GURL&)> GetLRUOriginCallback; |
|
awong
2011/09/29 18:05:15
Remove space after void. Here and elsewhere in fi
tzik
2011/10/11 04:53:57
Done.
| |
| 54 typedef StatusCallback EvictOriginDataCallback; | 55 typedef StatusCallback EvictOriginDataCallback; |
| 55 typedef Callback5<QuotaStatusCode, | 56 typedef base::Callback<void (QuotaStatusCode, |
| 56 int64 /* usage */, | 57 int64 /* usage */, |
| 57 int64 /* unlimited_usage */, | 58 int64 /* unlimited_usage */, |
| 58 int64 /* quota */, | 59 int64 /* quota */, |
| 59 int64 /* physical_available */ >::Type | 60 int64 /* physical_available */)> |
| 60 GetUsageAndQuotaForEvictionCallback; | 61 GetUsageAndQuotaForEvictionCallback; |
| 61 | 62 |
| 62 // Returns the least recently used origin. It might return empty | 63 // Returns the least recently used origin. It might return empty |
| 63 // GURL when there are no evictable origins. | 64 // GURL when there are no evictable origins. |
| 64 virtual void GetLRUOrigin( | 65 virtual void GetLRUOrigin( |
| 65 StorageType type, | 66 StorageType type, |
| 66 GetLRUOriginCallback* callback) = 0; | 67 GetLRUOriginCallback callback) = 0; |
| 67 | 68 |
| 68 virtual void EvictOriginData( | 69 virtual void EvictOriginData( |
| 69 const GURL& origin, | 70 const GURL& origin, |
| 70 StorageType type, | 71 StorageType type, |
| 71 EvictOriginDataCallback* callback) = 0; | 72 EvictOriginDataCallback callback) = 0; |
| 72 | 73 |
| 73 virtual void GetUsageAndQuotaForEviction( | 74 virtual void GetUsageAndQuotaForEviction( |
| 74 GetUsageAndQuotaForEvictionCallback* callback) = 0; | 75 GetUsageAndQuotaForEvictionCallback callback) = 0; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 // The quota manager class. This class is instantiated per profile and | 78 // The quota manager class. This class is instantiated per profile and |
| 78 // held by the profile. With the exception of the constructor and the | 79 // held by the profile. With the exception of the constructor and the |
| 79 // proxy() method, all methods should only be called on the IO thread. | 80 // proxy() method, all methods should only be called on the IO thread. |
| 80 class QuotaManager : public QuotaTaskObserver, | 81 class QuotaManager : public QuotaTaskObserver, |
| 81 public QuotaEvictionHandler, | 82 public QuotaEvictionHandler, |
| 82 public base::RefCountedThreadSafe< | 83 public base::RefCountedThreadSafe< |
| 83 QuotaManager, QuotaManagerDeleter> { | 84 QuotaManager, QuotaManagerDeleter> { |
| 84 public: | 85 public: |
| 85 typedef Callback3<QuotaStatusCode, | 86 typedef base::Callback<void (QuotaStatusCode, |
| 86 int64 /* usage */, | 87 int64 /* usage */, |
| 87 int64 /* quota */>::Type GetUsageAndQuotaCallback; | 88 int64 /* quota */)> |
| 89 GetUsageAndQuotaCallback; | |
| 88 | 90 |
| 89 QuotaManager(bool is_incognito, | 91 QuotaManager(bool is_incognito, |
| 90 const FilePath& profile_path, | 92 const FilePath& profile_path, |
| 91 base::MessageLoopProxy* io_thread, | 93 base::MessageLoopProxy* io_thread, |
| 92 base::MessageLoopProxy* db_thread, | 94 base::MessageLoopProxy* db_thread, |
| 93 SpecialStoragePolicy* special_storage_policy); | 95 SpecialStoragePolicy* special_storage_policy); |
| 94 | 96 |
| 95 virtual ~QuotaManager(); | 97 virtual ~QuotaManager(); |
| 96 | 98 |
| 97 // Returns a proxy object that can be used on any thread. | 99 // Returns a proxy object that can be used on any thread. |
| 98 QuotaManagerProxy* proxy() { return proxy_.get(); } | 100 QuotaManagerProxy* proxy() { return proxy_.get(); } |
| 99 | 101 |
| 100 // Called by clients or webapps. | 102 // Called by clients or webapps. |
| 101 // This method is declared as virtual to allow test code to override it. | 103 // This method is declared as virtual to allow test code to override it. |
| 102 // note: returns host usage and quota | 104 // note: returns host usage and quota |
| 103 virtual void GetUsageAndQuota(const GURL& origin, | 105 virtual void GetUsageAndQuota(const GURL& origin, |
| 104 StorageType type, | 106 StorageType type, |
| 105 GetUsageAndQuotaCallback* callback); | 107 GetUsageAndQuotaCallback callback); |
|
awong
2011/09/29 18:05:15
const &.
tzik
2011/10/11 04:53:57
Done.
| |
| 106 | 108 |
| 107 // Called by clients via proxy. | 109 // Called by clients via proxy. |
| 108 // Client storage should call this method when storage is accessed. | 110 // Client storage should call this method when storage is accessed. |
| 109 // Used to maintain LRU ordering. | 111 // Used to maintain LRU ordering. |
| 110 void NotifyStorageAccessed(QuotaClient::ID client_id, | 112 void NotifyStorageAccessed(QuotaClient::ID client_id, |
| 111 const GURL& origin, | 113 const GURL& origin, |
| 112 StorageType type); | 114 StorageType type); |
| 113 | 115 |
| 114 // Called by clients via proxy. | 116 // Called by clients via proxy. |
| 115 // Client storage must call this method whenever they have made any | 117 // Client storage must call this method whenever they have made any |
| 116 // modifications that change the amount of data stored in their storage. | 118 // modifications that change the amount of data stored in their storage. |
| 117 void NotifyStorageModified(QuotaClient::ID client_id, | 119 void NotifyStorageModified(QuotaClient::ID client_id, |
| 118 const GURL& origin, | 120 const GURL& origin, |
| 119 StorageType type, | 121 StorageType type, |
| 120 int64 delta); | 122 int64 delta); |
| 121 | 123 |
| 122 // Used to avoid evicting origins with open pages. | 124 // Used to avoid evicting origins with open pages. |
| 123 // A call to NotifyOriginInUse must be balanced by a later call | 125 // A call to NotifyOriginInUse must be balanced by a later call |
| 124 // to NotifyOriginNoLongerInUse. | 126 // to NotifyOriginNoLongerInUse. |
| 125 void NotifyOriginInUse(const GURL& origin); | 127 void NotifyOriginInUse(const GURL& origin); |
| 126 void NotifyOriginNoLongerInUse(const GURL& origin); | 128 void NotifyOriginNoLongerInUse(const GURL& origin); |
| 127 bool IsOriginInUse(const GURL& origin) const { | 129 bool IsOriginInUse(const GURL& origin) const { |
| 128 return origins_in_use_.find(origin) != origins_in_use_.end(); | 130 return origins_in_use_.find(origin) != origins_in_use_.end(); |
| 129 } | 131 } |
| 130 | 132 |
| 131 // Called by UI. | 133 // Called by UI. |
| 132 virtual void DeleteOriginData(const GURL& origin, | 134 virtual void DeleteOriginData(const GURL& origin, |
| 133 StorageType type, | 135 StorageType type, |
| 134 StatusCallback* callback); | 136 StatusCallback callback); |
|
awong
2011/09/29 18:05:15
const &.
okay...I give up. Const& whenever you'r
tzik
2011/10/11 04:53:57
Done for all (I hope).
It's too boring...
| |
| 135 | 137 |
| 136 // Called by UI and internal modules. | 138 // Called by UI and internal modules. |
| 137 void GetAvailableSpace(AvailableSpaceCallback* callback); | 139 void GetAvailableSpace(AvailableSpaceCallback callback); |
| 138 void GetTemporaryGlobalQuota(QuotaCallback* callback); | 140 void GetTemporaryGlobalQuota(QuotaCallback callback); |
| 139 void SetTemporaryGlobalQuota(int64 new_quota, QuotaCallback* callback); | 141 void SetTemporaryGlobalQuota(int64 new_quota, QuotaCallback callback); |
| 140 void GetPersistentHostQuota(const std::string& host, | 142 void GetPersistentHostQuota(const std::string& host, |
| 141 HostQuotaCallback* callback); | 143 HostQuotaCallback callback); |
| 142 void SetPersistentHostQuota(const std::string& host, | 144 void SetPersistentHostQuota(const std::string& host, |
| 143 int64 new_quota, | 145 int64 new_quota, |
| 144 HostQuotaCallback* callback); | 146 HostQuotaCallback callback); |
| 145 void GetGlobalUsage(StorageType type, GlobalUsageCallback* callback); | 147 void GetGlobalUsage(StorageType type, GlobalUsageCallback callback); |
| 146 void GetHostUsage(const std::string& host, StorageType type, | 148 void GetHostUsage(const std::string& host, StorageType type, |
| 147 HostUsageCallback* callback); | 149 HostUsageCallback callback); |
| 148 | 150 |
| 149 void GetStatistics(std::map<std::string, std::string>* statistics); | 151 void GetStatistics(std::map<std::string, std::string>* statistics); |
| 150 | 152 |
| 151 bool IsStorageUnlimited(const GURL& origin) const { | 153 bool IsStorageUnlimited(const GURL& origin) const { |
| 152 return special_storage_policy_.get() && | 154 return special_storage_policy_.get() && |
| 153 special_storage_policy_->IsStorageUnlimited(origin); | 155 special_storage_policy_->IsStorageUnlimited(origin); |
| 154 } | 156 } |
| 155 | 157 |
| 156 virtual void GetOriginsModifiedSince(StorageType type, | 158 virtual void GetOriginsModifiedSince(StorageType type, |
| 157 base::Time modified_since, | 159 base::Time modified_since, |
| 158 GetOriginsCallback* callback); | 160 GetOriginsCallback callback); |
| 159 | 161 |
| 160 bool ResetUsageTracker(StorageType type); | 162 bool ResetUsageTracker(StorageType type); |
| 161 | 163 |
| 162 // Used to determine the total size of the temp pool. | 164 // Used to determine the total size of the temp pool. |
| 163 static const int64 kTemporaryStorageQuotaDefaultSize; | 165 static const int64 kTemporaryStorageQuotaDefaultSize; |
| 164 static const int64 kTemporaryStorageQuotaMaxSize; | 166 static const int64 kTemporaryStorageQuotaMaxSize; |
| 165 static const int64 kIncognitoDefaultTemporaryQuota; | 167 static const int64 kIncognitoDefaultTemporaryQuota; |
| 166 | 168 |
| 167 // Determines the portion of the temp pool that can be | 169 // Determines the portion of the temp pool that can be |
| 168 // utilized by a single host (ie. 5 for 20%). | 170 // utilized by a single host (ie. 5 for 20%). |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 196 | 198 |
| 197 class AvailableSpaceQueryTask; | 199 class AvailableSpaceQueryTask; |
| 198 class DumpQuotaTableTask; | 200 class DumpQuotaTableTask; |
| 199 class DumpOriginInfoTableTask; | 201 class DumpOriginInfoTableTask; |
| 200 | 202 |
| 201 typedef QuotaDatabase::QuotaTableEntry QuotaTableEntry; | 203 typedef QuotaDatabase::QuotaTableEntry QuotaTableEntry; |
| 202 typedef QuotaDatabase::OriginInfoTableEntry OriginInfoTableEntry; | 204 typedef QuotaDatabase::OriginInfoTableEntry OriginInfoTableEntry; |
| 203 typedef std::vector<QuotaTableEntry> QuotaTableEntries; | 205 typedef std::vector<QuotaTableEntry> QuotaTableEntries; |
| 204 typedef std::vector<OriginInfoTableEntry> OriginInfoTableEntries; | 206 typedef std::vector<OriginInfoTableEntry> OriginInfoTableEntries; |
| 205 | 207 |
| 206 typedef Callback1<const QuotaTableEntries&>::Type DumpQuotaTableCallback; | 208 typedef base::Callback<void (const QuotaTableEntries&)> |
| 207 typedef Callback1<const OriginInfoTableEntries&>::Type | 209 DumpQuotaTableCallback; |
| 210 typedef base::Callback<void (const OriginInfoTableEntries&)> | |
| 208 DumpOriginInfoTableCallback; | 211 DumpOriginInfoTableCallback; |
| 209 | 212 |
| 210 struct EvictionContext { | 213 struct EvictionContext { |
| 211 EvictionContext() | 214 EvictionContext() |
| 212 : evicted_type(kStorageTypeUnknown), | 215 : evicted_type(kStorageTypeUnknown), |
| 213 usage(0), | 216 usage(0), |
| 214 unlimited_usage(0), | 217 unlimited_usage(0), |
| 215 quota(0) {} | 218 quota(0) {} |
| 216 virtual ~EvictionContext() {} | 219 virtual ~EvictionContext() {} |
| 217 | 220 |
| 218 GURL evicted_origin; | 221 GURL evicted_origin; |
| 219 StorageType evicted_type; | 222 StorageType evicted_type; |
| 220 | 223 |
| 221 scoped_ptr<EvictOriginDataCallback> evict_origin_data_callback; | 224 EvictOriginDataCallback evict_origin_data_callback; |
| 222 | 225 |
| 223 scoped_ptr<GetUsageAndQuotaForEvictionCallback> | 226 GetUsageAndQuotaForEvictionCallback get_usage_and_quota_callback; |
| 224 get_usage_and_quota_callback; | |
| 225 int64 usage; | 227 int64 usage; |
| 226 int64 unlimited_usage; | 228 int64 unlimited_usage; |
| 227 int64 quota; | 229 int64 quota; |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 typedef std::pair<std::string, StorageType> HostAndType; | 232 typedef std::pair<std::string, StorageType> HostAndType; |
| 231 typedef std::map<HostAndType, UsageAndQuotaDispatcherTask*> | 233 typedef std::map<HostAndType, UsageAndQuotaDispatcherTask*> |
| 232 UsageAndQuotaDispatcherTaskMap; | 234 UsageAndQuotaDispatcherTaskMap; |
| 233 | 235 |
| 234 friend class quota_internals::QuotaInternalsProxy; | 236 friend class quota_internals::QuotaInternalsProxy; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 262 const GURL& origin, | 264 const GURL& origin, |
| 263 StorageType type, | 265 StorageType type, |
| 264 base::Time accessed_time); | 266 base::Time accessed_time); |
| 265 void NotifyStorageModifiedInternal( | 267 void NotifyStorageModifiedInternal( |
| 266 QuotaClient::ID client_id, | 268 QuotaClient::ID client_id, |
| 267 const GURL& origin, | 269 const GURL& origin, |
| 268 StorageType type, | 270 StorageType type, |
| 269 int64 delta, | 271 int64 delta, |
| 270 base::Time modified_time); | 272 base::Time modified_time); |
| 271 | 273 |
| 272 void DumpQuotaTable(DumpQuotaTableCallback* callback); | 274 void DumpQuotaTable(DumpQuotaTableCallback callback); |
| 273 void DumpOriginInfoTable(DumpOriginInfoTableCallback* callback); | 275 void DumpOriginInfoTable(DumpOriginInfoTableCallback callback); |
| 274 | 276 |
| 275 // Methods for eviction logic. | 277 // Methods for eviction logic. |
| 276 void StartEviction(); | 278 void StartEviction(); |
| 277 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); | 279 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); |
| 278 | 280 |
| 279 void DidOriginDataEvicted(QuotaStatusCode status); | 281 void DidOriginDataEvicted(QuotaStatusCode status); |
| 280 void DidGetAvailableSpaceForEviction( | 282 void DidGetAvailableSpaceForEviction( |
| 281 QuotaStatusCode status, | 283 QuotaStatusCode status, |
| 282 int64 available_space); | 284 int64 available_space); |
| 283 void DidGetGlobalQuotaForEviction( | 285 void DidGetGlobalQuotaForEviction( |
| 284 QuotaStatusCode status, | 286 QuotaStatusCode status, |
| 285 StorageType type, | 287 StorageType type, |
| 286 int64 quota); | 288 int64 quota); |
| 287 void DidGetGlobalUsageForEviction(StorageType type, | 289 void DidGetGlobalUsageForEviction(StorageType type, |
| 288 int64 usage, | 290 int64 usage, |
| 289 int64 unlimited_usage); | 291 int64 unlimited_usage); |
| 290 | 292 |
| 291 void ReportHistogram(); | 293 void ReportHistogram(); |
| 292 void DidGetTemporaryGlobalUsageForHistogram(StorageType type, | 294 void DidGetTemporaryGlobalUsageForHistogram(StorageType type, |
| 293 int64 usage, | 295 int64 usage, |
| 294 int64 unlimited_usage); | 296 int64 unlimited_usage); |
| 295 void DidGetPersistentGlobalUsageForHistogram(StorageType type, | 297 void DidGetPersistentGlobalUsageForHistogram(StorageType type, |
| 296 int64 usage, | 298 int64 usage, |
| 297 int64 unlimited_usage); | 299 int64 unlimited_usage); |
| 298 | 300 |
| 299 // QuotaEvictionHandler. | 301 // QuotaEvictionHandler. |
| 300 virtual void GetLRUOrigin( | 302 virtual void GetLRUOrigin( |
| 301 StorageType type, | 303 StorageType type, |
| 302 GetLRUOriginCallback* callback) OVERRIDE; | 304 GetLRUOriginCallback callback) OVERRIDE; |
| 303 virtual void EvictOriginData( | 305 virtual void EvictOriginData( |
| 304 const GURL& origin, | 306 const GURL& origin, |
| 305 StorageType type, | 307 StorageType type, |
| 306 EvictOriginDataCallback* callback) OVERRIDE; | 308 EvictOriginDataCallback callback) OVERRIDE; |
| 307 virtual void GetUsageAndQuotaForEviction( | 309 virtual void GetUsageAndQuotaForEviction( |
| 308 GetUsageAndQuotaForEvictionCallback* callback) OVERRIDE; | 310 GetUsageAndQuotaForEvictionCallback callback) OVERRIDE; |
| 309 | 311 |
| 310 void DidInitializeTemporaryGlobalQuota(int64 quota); | 312 void DidInitializeTemporaryGlobalQuota(int64 quota); |
| 311 void DidRunInitialGetTemporaryGlobalUsage(StorageType type, int64 usage, | 313 void DidRunInitialGetTemporaryGlobalUsage(StorageType type, int64 usage, |
| 312 int64 unlimited_usage); | 314 int64 unlimited_usage); |
| 313 void DidGetDatabaseLRUOrigin(const GURL& origin); | 315 void DidGetDatabaseLRUOrigin(const GURL& origin); |
| 314 | 316 |
| 315 void DeleteOnCorrectThread() const; | 317 void DeleteOnCorrectThread() const; |
| 316 | 318 |
| 317 const bool is_incognito_; | 319 const bool is_incognito_; |
| 318 const FilePath profile_path_; | 320 const FilePath profile_path_; |
| 319 | 321 |
| 320 scoped_refptr<QuotaManagerProxy> proxy_; | 322 scoped_refptr<QuotaManagerProxy> proxy_; |
| 321 bool db_disabled_; | 323 bool db_disabled_; |
| 322 bool eviction_disabled_; | 324 bool eviction_disabled_; |
| 323 scoped_refptr<base::MessageLoopProxy> io_thread_; | 325 scoped_refptr<base::MessageLoopProxy> io_thread_; |
| 324 scoped_refptr<base::MessageLoopProxy> db_thread_; | 326 scoped_refptr<base::MessageLoopProxy> db_thread_; |
| 325 mutable scoped_ptr<QuotaDatabase> database_; | 327 mutable scoped_ptr<QuotaDatabase> database_; |
| 326 | 328 |
| 327 bool need_initialize_origins_; | 329 bool need_initialize_origins_; |
| 328 scoped_ptr<GetLRUOriginCallback> lru_origin_callback_; | 330 GetLRUOriginCallback lru_origin_callback_; |
| 329 std::set<GURL> access_notified_origins_; | 331 std::set<GURL> access_notified_origins_; |
| 330 | 332 |
| 331 QuotaClientList clients_; | 333 QuotaClientList clients_; |
| 332 | 334 |
| 333 scoped_ptr<UsageTracker> temporary_usage_tracker_; | 335 scoped_ptr<UsageTracker> temporary_usage_tracker_; |
| 334 scoped_ptr<UsageTracker> persistent_usage_tracker_; | 336 scoped_ptr<UsageTracker> persistent_usage_tracker_; |
| 335 // TODO(michaeln): Need a way to clear the cache, drop and | 337 // TODO(michaeln): Need a way to clear the cache, drop and |
| 336 // reinstantiate the trackers when they're not handling requests. | 338 // reinstantiate the trackers when they're not handling requests. |
| 337 | 339 |
| 338 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; | 340 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; |
| 339 EvictionContext eviction_context_; | 341 EvictionContext eviction_context_; |
| 340 | 342 |
| 341 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; | 343 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; |
| 342 | 344 |
| 343 int64 temporary_global_quota_; | 345 int64 temporary_global_quota_; |
| 344 QuotaCallbackQueue temporary_global_quota_callbacks_; | 346 QuotaCallbackQueue temporary_global_quota_callbacks_; |
| 345 | 347 |
| 346 // Map from origin to count. | 348 // Map from origin to count. |
| 347 std::map<GURL, int> origins_in_use_; | 349 std::map<GURL, int> origins_in_use_; |
| 348 // Map from origin to error count. | 350 // Map from origin to error count. |
| 349 std::map<GURL, int> origins_in_error_; | 351 std::map<GURL, int> origins_in_error_; |
| 350 | 352 |
| 351 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 353 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
| 352 | 354 |
| 353 base::ScopedCallbackFactory<QuotaManager> callback_factory_; | 355 base::WeakPtrFactory<QuotaManager> weak_factory_; |
| 354 base::RepeatingTimer<QuotaManager> histogram_timer_; | 356 base::RepeatingTimer<QuotaManager> histogram_timer_; |
| 355 | 357 |
| 356 DISALLOW_COPY_AND_ASSIGN(QuotaManager); | 358 DISALLOW_COPY_AND_ASSIGN(QuotaManager); |
| 357 }; | 359 }; |
| 358 | 360 |
| 359 struct QuotaManagerDeleter { | 361 struct QuotaManagerDeleter { |
| 360 static void Destruct(const QuotaManager* manager) { | 362 static void Destruct(const QuotaManager* manager) { |
| 361 manager->DeleteOnCorrectThread(); | 363 manager->DeleteOnCorrectThread(); |
| 362 } | 364 } |
| 363 }; | 365 }; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 390 | 392 |
| 391 QuotaManager* manager_; // only accessed on the io thread | 393 QuotaManager* manager_; // only accessed on the io thread |
| 392 scoped_refptr<base::MessageLoopProxy> io_thread_; | 394 scoped_refptr<base::MessageLoopProxy> io_thread_; |
| 393 | 395 |
| 394 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 396 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
| 395 }; | 397 }; |
| 396 | 398 |
| 397 } // namespace quota | 399 } // namespace quota |
| 398 | 400 |
| 399 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 401 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |