Chromium Code Reviews| Index: webkit/quota/mock_quota_manager.cc |
| diff --git a/webkit/quota/mock_quota_manager.cc b/webkit/quota/mock_quota_manager.cc |
| index 52d27351e60015b0483889370e9e2827c657a1c3..b76b75461a630a109a97bae9a80f21c620973c7a 100644 |
| --- a/webkit/quota/mock_quota_manager.cc |
| +++ b/webkit/quota/mock_quota_manager.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -75,9 +75,11 @@ class MockQuotaManager::DeleteOriginDataTask : public QuotaThreadTask { |
| MockQuotaManager::OriginInfo::OriginInfo( |
| const GURL& origin, |
| StorageType type, |
| + int quota_client_mask, |
| base::Time modified) |
| : origin(origin), |
| type(type), |
| + quota_client_mask(quota_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->quota_client_mask & quota_client) |
|
kinuko
2012/01/22 18:35:31
style-nit: to improve readability can we put each
Mike West
2012/01/22 20:54:38
Done.
|
| return true; |
| } |
| return false; |
| @@ -126,12 +129,15 @@ void MockQuotaManager::GetOriginsModifiedSince( |
| } |
| void MockQuotaManager::DeleteOriginData(const GURL& origin, StorageType type, |
|
kinuko
2012/01/22 18:35:31
style-nit: please break the line after '(' and ali
Mike West
2012/01/22 20:54:38
Done.
|
| - const StatusCallback& callback) { |
| + int quota_client_mask, const 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 mask: if it's 0 after "deletion", remove the origin. |
| + current->quota_client_mask &= ~quota_client_mask; |
| + if (current->quota_client_mask == 0) |
| + origins_.erase(current); |
| break; |
| } |
| } |