Index: webkit/quota/mock_quota_manager.cc |
diff --git a/webkit/quota/mock_quota_manager.cc b/webkit/quota/mock_quota_manager.cc |
index 67f1ee3ebf9d4ad91de3aaf4c5448aada155a41e..b022272e87bc290aa928ab24a4b85d9f5761ca59 100644 |
--- a/webkit/quota/mock_quota_manager.cc |
+++ b/webkit/quota/mock_quota_manager.cc |
@@ -75,9 +75,11 @@ class MockQuotaManager::DeleteOriginDataTask : public QuotaThreadTask { |
MockQuotaManager::OriginInfo::OriginInfo( |
const GURL& origin, |
StorageType type, |
+ int client_mask, |
jochen (gone - plz use gerrit)
2011/09/12 11:23:00
in the header this is quota_client_mask
|
base::Time modified) |
: origin(origin), |
type(type), |
+ mask(client_mask), |
modified(modified) { |
} |
@@ -94,17 +96,18 @@ MockQuotaManager::MockQuotaManager(bool is_incognito, |
MockQuotaManager::~MockQuotaManager() {} |
bool MockQuotaManager::AddOrigin(const GURL& origin, StorageType type, |
- base::Time modified) { |
- origins_.push_back(OriginInfo(origin, type, modified)); |
+ int quota_client_mask, base::Time modified) { |
+ origins_.push_back(OriginInfo(origin, type, quota_client_mask, modified)); |
return true; |
} |
bool MockQuotaManager::OriginHasData(const GURL& origin, |
- StorageType type) const { |
+ StorageType type, QuotaClient::ID quota_client) const { |
for (std::vector<OriginInfo>::const_iterator current = origins_.begin(); |
current != origins_.end(); |
++current) { |
- if (current->origin == origin && current->type == type) |
+ if (current->origin == origin && current->type == type && |
+ (current->mask & quota_client)) |
return true; |
} |
return false; |
@@ -124,12 +127,16 @@ void MockQuotaManager::GetOriginsModifiedSince(StorageType type, |
} |
void MockQuotaManager::DeleteOriginData(const GURL& origin, StorageType type, |
- StatusCallback* callback) { |
+ int quota_client_mask, StatusCallback* callback) { |
for (std::vector<OriginInfo>::iterator current = origins_.begin(); |
current != origins_.end(); |
++current) { |
if (current->origin == origin && current->type == type) { |
- origins_.erase(current); |
+ // Modify the current bitmask, and if it's 0 after "deletion", remove the |
+ // origin entirely. |
+ current->mask &= ~quota_client_mask; |
+ if (current->mask == 0) |
+ origins_.erase(current); |
break; |
} |
} |