Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 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 #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> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 | 141 |
| 142 // Used to avoid evicting origins with open pages. | 142 // Used to avoid evicting origins with open pages. |
| 143 // A call to NotifyOriginInUse must be balanced by a later call | 143 // A call to NotifyOriginInUse must be balanced by a later call |
| 144 // to NotifyOriginNoLongerInUse. | 144 // to NotifyOriginNoLongerInUse. |
| 145 void NotifyOriginInUse(const GURL& origin); | 145 void NotifyOriginInUse(const GURL& origin); |
| 146 void NotifyOriginNoLongerInUse(const GURL& origin); | 146 void NotifyOriginNoLongerInUse(const GURL& origin); |
| 147 bool IsOriginInUse(const GURL& origin) const { | 147 bool IsOriginInUse(const GURL& origin) const { |
| 148 return origins_in_use_.find(origin) != origins_in_use_.end(); | 148 return origins_in_use_.find(origin) != origins_in_use_.end(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Called by UI. | 151 // DeleteOriginData and DeleteHostData (surprisingly enough) delete data of a |
| 152 // particular StorageType associated with either a specific origin or set of | |
| 153 // origins. Each method additionally requires a quota_client_mask which | |
| 154 // specifies the types of QuotaClients to delete from the origin. This is | |
| 155 // specified as a bitmask built from QuotaClient::IDs. | |
|
kinuko
2012/01/22 18:35:31
It might be helpful to note that the caller specif
Mike West
2012/01/22 20:54:38
Good call. Done, both here and in MockQuotaManager
| |
| 156 // | |
| 157 // Both methods must be called on the UI thread. | |
| 152 virtual void DeleteOriginData(const GURL& origin, | 158 virtual void DeleteOriginData(const GURL& origin, |
| 153 StorageType type, | 159 StorageType type, |
| 160 int quota_client_mask, | |
| 154 const StatusCallback& callback); | 161 const StatusCallback& callback); |
| 155 void DeleteHostData(const std::string& host, | 162 void DeleteHostData(const std::string& host, |
| 156 StorageType type, | 163 StorageType type, |
| 164 int quota_client_mask, | |
| 157 const StatusCallback& callback); | 165 const StatusCallback& callback); |
| 158 | 166 |
| 159 // Called by UI and internal modules. | 167 // Called by UI and internal modules. |
| 160 void GetAvailableSpace(const AvailableSpaceCallback& callback); | 168 void GetAvailableSpace(const AvailableSpaceCallback& callback); |
| 161 void GetTemporaryGlobalQuota(const QuotaCallback& callback); | 169 void GetTemporaryGlobalQuota(const QuotaCallback& callback); |
| 162 | 170 |
| 163 // Ok to call with NULL callback. | 171 // Ok to call with NULL callback. |
| 164 void SetTemporaryGlobalOverrideQuota(int64 new_quota, | 172 void SetTemporaryGlobalOverrideQuota(int64 new_quota, |
| 165 const QuotaCallback& callback); | 173 const QuotaCallback& callback); |
| 166 | 174 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 | 420 |
| 413 QuotaManager* manager_; // only accessed on the io thread | 421 QuotaManager* manager_; // only accessed on the io thread |
| 414 scoped_refptr<base::MessageLoopProxy> io_thread_; | 422 scoped_refptr<base::MessageLoopProxy> io_thread_; |
| 415 | 423 |
| 416 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 424 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
| 417 }; | 425 }; |
| 418 | 426 |
| 419 } // namespace quota | 427 } // namespace quota |
| 420 | 428 |
| 421 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 429 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
| OLD | NEW |