| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 // Called by UI and internal modules. | 167 // Called by UI and internal modules. |
| 168 void GetAvailableSpace(const AvailableSpaceCallback& callback); | 168 void GetAvailableSpace(const AvailableSpaceCallback& callback); |
| 169 void GetTemporaryGlobalQuota(const QuotaCallback& callback); | 169 void GetTemporaryGlobalQuota(const QuotaCallback& callback); |
| 170 | 170 |
| 171 // Ok to call with NULL callback. | 171 // Ok to call with NULL callback. |
| 172 void SetTemporaryGlobalOverrideQuota(int64 new_quota, | 172 void SetTemporaryGlobalOverrideQuota(int64 new_quota, |
| 173 const QuotaCallback& callback); | 173 const QuotaCallback& callback); |
| 174 | 174 |
| 175 void GetPersistentHostQuota(const std::string& host, | 175 void GetPersistentHostQuota(const std::string& host, |
| 176 const HostQuotaCallback& callback); | 176 const QuotaCallback& callback); |
| 177 void SetPersistentHostQuota(const std::string& host, | 177 void SetPersistentHostQuota(const std::string& host, |
| 178 int64 new_quota, | 178 int64 new_quota, |
| 179 const HostQuotaCallback& callback); | 179 const QuotaCallback& callback); |
| 180 void GetGlobalUsage(StorageType type, const GlobalUsageCallback& callback); | 180 void GetGlobalUsage(StorageType type, const GlobalUsageCallback& callback); |
| 181 void GetHostUsage(const std::string& host, StorageType type, | 181 void GetHostUsage(const std::string& host, StorageType type, |
| 182 const UsageCallback& callback); | 182 const UsageCallback& callback); |
| 183 | 183 |
| 184 void GetStatistics(std::map<std::string, std::string>* statistics); | 184 void GetStatistics(std::map<std::string, std::string>* statistics); |
| 185 | 185 |
| 186 bool IsStorageUnlimited(const GURL& origin, StorageType type) const; | 186 bool IsStorageUnlimited(const GURL& origin, StorageType type) const; |
| 187 | 187 |
| 188 bool IsInstalledApp(const GURL& origin) const { | 188 bool IsInstalledApp(const GURL& origin) const { |
| 189 return special_storage_policy_.get() && | 189 return special_storage_policy_.get() && |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 virtual void EvictOriginData( | 327 virtual void EvictOriginData( |
| 328 const GURL& origin, | 328 const GURL& origin, |
| 329 StorageType type, | 329 StorageType type, |
| 330 const EvictOriginDataCallback& callback) OVERRIDE; | 330 const EvictOriginDataCallback& callback) OVERRIDE; |
| 331 virtual void GetUsageAndQuotaForEviction( | 331 virtual void GetUsageAndQuotaForEviction( |
| 332 const GetUsageAndQuotaForEvictionCallback& callback) OVERRIDE; | 332 const GetUsageAndQuotaForEvictionCallback& callback) OVERRIDE; |
| 333 | 333 |
| 334 void DidSetTemporaryGlobalOverrideQuota(const QuotaCallback& callback, | 334 void DidSetTemporaryGlobalOverrideQuota(const QuotaCallback& callback, |
| 335 const int64* new_quota, | 335 const int64* new_quota, |
| 336 bool success); | 336 bool success); |
| 337 void DidGetPersistentHostQuota(const HostQuotaCallback& callback, | 337 void DidGetPersistentHostQuota(const QuotaCallback& callback, |
| 338 const std::string& host, | 338 const std::string& host, |
| 339 const int64* quota, | 339 const int64* quota, |
| 340 bool success); | 340 bool success); |
| 341 void DidSetPersistentHostQuota(const std::string& host, | 341 void DidSetPersistentHostQuota(const std::string& host, |
| 342 const HostQuotaCallback& callback, | 342 const QuotaCallback& callback, |
| 343 const int64* new_quota, | 343 const int64* new_quota, |
| 344 bool success); | 344 bool success); |
| 345 void DidInitialize(int64* temporary_quota_override, | 345 void DidInitialize(int64* temporary_quota_override, |
| 346 int64* desired_available_space, | 346 int64* desired_available_space, |
| 347 bool success); | 347 bool success); |
| 348 void DidGetLRUOrigin(const GURL* origin, | 348 void DidGetLRUOrigin(const GURL* origin, |
| 349 bool success); | 349 bool success); |
| 350 void DidGetInitialTemporaryGlobalQuota(QuotaStatusCode status, | 350 void DidGetInitialTemporaryGlobalQuota(QuotaStatusCode status, |
| 351 StorageType type, | |
| 352 int64 quota_unused); | 351 int64 quota_unused); |
| 353 void DidInitializeTemporaryOriginsInfo(bool success); | 352 void DidInitializeTemporaryOriginsInfo(bool success); |
| 354 void DidGetAvailableSpace(const AvailableSpaceCallback& callback, | 353 void DidGetAvailableSpace(const AvailableSpaceCallback& callback, |
| 355 int64 space); | 354 int64 space); |
| 356 void DidDatabaseWork(bool success); | 355 void DidDatabaseWork(bool success); |
| 357 | 356 |
| 358 void DeleteOnCorrectThread() const; | 357 void DeleteOnCorrectThread() const; |
| 359 | 358 |
| 360 void PostTaskAndReplyWithResultForDBThread( | 359 void PostTaskAndReplyWithResultForDBThread( |
| 361 const tracked_objects::Location& from_here, | 360 const tracked_objects::Location& from_here, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 445 |
| 447 QuotaManager* manager_; // only accessed on the io thread | 446 QuotaManager* manager_; // only accessed on the io thread |
| 448 scoped_refptr<base::SingleThreadTaskRunner> io_thread_; | 447 scoped_refptr<base::SingleThreadTaskRunner> io_thread_; |
| 449 | 448 |
| 450 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 449 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
| 451 }; | 450 }; |
| 452 | 451 |
| 453 } // namespace quota | 452 } // namespace quota |
| 454 | 453 |
| 455 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 454 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |