diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-05 08:39:54 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-05 08:39:54 +0000 |
commit | 4ac23ad25a6467cc360cc10bd05946a0936cac5c (patch) | |
tree | 6a9fd5641ce5143ddb891a3ca16bf558afb4736f /webkit/fileapi | |
parent | 90a47480a17322e3c095b9cc7eefd5498224f1a4 (diff) | |
download | chromium_src-4ac23ad25a6467cc360cc10bd05946a0936cac5c.zip chromium_src-4ac23ad25a6467cc360cc10bd05946a0936cac5c.tar.gz chromium_src-4ac23ad25a6467cc360cc10bd05946a0936cac5c.tar.bz2 |
Quota: Add quota::StorageType to the GetOriginsCallback definition.
BUG=90996
TEST=test_shell_tests
Review URL: http://codereview.chromium.org/7533013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95591 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/file_system_quota_client.cc | 10 | ||||
-rw-r--r-- | webkit/fileapi/file_system_quota_client.h | 10 | ||||
-rw-r--r-- | webkit/fileapi/file_system_quota_client_unittest.cc | 5 |
3 files changed, 16 insertions, 9 deletions
diff --git a/webkit/fileapi/file_system_quota_client.cc b/webkit/fileapi/file_system_quota_client.cc index f3fec60..3f8e2e5 100644 --- a/webkit/fileapi/file_system_quota_client.cc +++ b/webkit/fileapi/file_system_quota_client.cc @@ -220,7 +220,7 @@ void FileSystemQuotaClient::GetOriginsForType( scoped_ptr<GetOriginsCallback> callback(callback_ptr); if (is_incognito_) { // We don't support FileSystem in incognito mode yet. - callback->Run(origins); + callback->Run(origins, storage_type); return; } @@ -242,7 +242,7 @@ void FileSystemQuotaClient::GetOriginsForHost( scoped_ptr<GetOriginsCallback> callback(callback_ptr); if (is_incognito_) { // We don't support FileSystem in incognito mode yet. - callback->Run(origins); + callback->Run(origins, storage_type); return; } @@ -280,13 +280,15 @@ void FileSystemQuotaClient::DidGetOriginUsage( void FileSystemQuotaClient::DidGetOriginsForType( FileSystemType type, const std::set<GURL>& origins) { DCHECK(pending_origins_for_type_callbacks_.HasCallbacks(type)); - pending_origins_for_type_callbacks_.Run(type, origins); + pending_origins_for_type_callbacks_.Run(type, origins, + FileSystemTypeToQuotaStorageType(type)); } void FileSystemQuotaClient::DidGetOriginsForHost( const TypeAndHostOrOrigin& type_and_host, const std::set<GURL>& origins) { DCHECK(pending_origins_for_host_callbacks_.HasCallbacks(type_and_host)); - pending_origins_for_host_callbacks_.Run(type_and_host, origins); + pending_origins_for_host_callbacks_.Run(type_and_host, origins, + FileSystemTypeToQuotaStorageType(type_and_host.first)); } } // namespace fileapi diff --git a/webkit/fileapi/file_system_quota_client.h b/webkit/fileapi/file_system_quota_client.h index fb553c9..4045628 100644 --- a/webkit/fileapi/file_system_quota_client.h +++ b/webkit/fileapi/file_system_quota_client.h @@ -65,13 +65,15 @@ class FileSystemQuotaClient : public quota::QuotaClient, TypeAndHostOrOrigin, int64 > UsageCallbackMap; - typedef quota::CallbackQueueMap1<GetOriginsCallback*, + typedef quota::CallbackQueueMap2<GetOriginsCallback*, fileapi::FileSystemType, - const std::set<GURL>& + const std::set<GURL>&, + quota::StorageType > OriginsForTypeCallbackMap; - typedef quota::CallbackQueueMap1<GetOriginsCallback*, + typedef quota::CallbackQueueMap2<GetOriginsCallback*, TypeAndHostOrOrigin, - const std::set<GURL>& + const std::set<GURL>&, + quota::StorageType > OriginsForHostCallbackMap; void DidGetOriginUsage(fileapi::FileSystemType type, diff --git a/webkit/fileapi/file_system_quota_client_unittest.cc b/webkit/fileapi/file_system_quota_client_unittest.cc index cbc3d75..2254f51 100644 --- a/webkit/fileapi/file_system_quota_client_unittest.cc +++ b/webkit/fileapi/file_system_quota_client_unittest.cc @@ -246,8 +246,10 @@ class FileSystemQuotaClientTest : public testing::Test { usage_ = usage; } - void OnGetOrigins(const std::set<GURL>& origins) { + void OnGetOrigins(const std::set<GURL>& origins, + quota::StorageType type) { origins_ = origins; + type_ = type; } void OnGetAdditionalUsage(int64 usage_unused) { @@ -264,6 +266,7 @@ class FileSystemQuotaClientTest : public testing::Test { int64 usage_; int additional_callback_count_; std::set<GURL> origins_; + quota::StorageType type_; quota::QuotaStatusCode deletion_status_; DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClientTest); |