diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 19:40:27 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 19:40:27 +0000 |
commit | 72f40864f540e393c941ceeea770d34f141c68d6 (patch) | |
tree | 3e40f159c9ec5977d968907b078bec713e21185e /webkit/quota/mock_quota_manager.h | |
parent | 138c6ec7f5ddaccb176a50e0cc4fbcfbadb34e45 (diff) | |
download | chromium_src-72f40864f540e393c941ceeea770d34f141c68d6.zip chromium_src-72f40864f540e393c941ceeea770d34f141c68d6.tar.gz chromium_src-72f40864f540e393c941ceeea770d34f141c68d6.tar.bz2 |
QuotaManager::DeleteOriginData allows deletion of specific QuotaClients
To enable a more fine-grained extension API that would allow removal of specific data types, this CL changes the QuotaClient::ID enum values to bitmasky flags, and adds a bitmask parameter to QuotaManager::DeleteOriginData and QuotaManager::DeleteHostData to filter the clients that are deleted for each origin.
BUG=94334
TEST=test_shell_tests,unit_tests
Review URL: http://codereview.chromium.org/7839029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota/mock_quota_manager.h')
-rw-r--r-- | webkit/quota/mock_quota_manager.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/webkit/quota/mock_quota_manager.h b/webkit/quota/mock_quota_manager.h index 1f6fb0b..317c476 100644 --- a/webkit/quota/mock_quota_manager.h +++ b/webkit/quota/mock_quota_manager.h @@ -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. @@ -31,11 +31,13 @@ class MockQuotaManager : public QuotaManager { struct OriginInfo { OriginInfo(const GURL& origin, StorageType type, + int quota_client_mask, base::Time modified); ~OriginInfo(); GURL origin; StorageType type; + int quota_client_mask; base::Time modified; }; @@ -48,13 +50,20 @@ class MockQuotaManager : public QuotaManager { virtual ~MockQuotaManager(); // Adds an origin to the canned list that will be searched through via - // GetOriginsModifiedSince. - bool AddOrigin(const GURL& origin, StorageType type, base::Time modified); + // GetOriginsModifiedSince. The caller must provide |quota_client_mask| + // which specifies the types of QuotaClients this canned origin contains + // as a bitmask built from QuotaClient::IDs. + bool AddOrigin(const GURL& origin, + StorageType type, + int quota_client_mask, + base::Time modified); // Checks an origin and type against the origins that have been added via // AddOrigin and removed via DeleteOriginData. If the origin exists in the - // canned list with the proper StorageType, returns true. - bool OriginHasData(const GURL& origin, StorageType type) const; + // canned list with the proper StorageType and client, returns true. + bool OriginHasData(const GURL& origin, + StorageType type, + QuotaClient::ID quota_client) const; // Overrides QuotaManager's implementation with a canned implementation that // allows clients to set up the origin database that should be queried. This @@ -65,9 +74,14 @@ class MockQuotaManager : public QuotaManager { const GetOriginsCallback& callback) OVERRIDE; // Removes an origin from the canned list of origins, but doesn't touch - // anything on disk. + // anything on disk. The caller must provide |quota_client_mask| which + // specifies the types of QuotaClients which should be removed from this + // origin as a bitmask built from QuotaClient::IDs. Setting the mask to + // QuotaClient::kAllClientsMask will remove all clients from the origin, + // regardless of type. virtual void DeleteOriginData(const GURL& origin, StorageType type, + int quota_client_mask, const StatusCallback& callback) OVERRIDE; private: |