Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 scoped_refptr<base::MessageLoopProxy> file_message_loop, | 36 scoped_refptr<base::MessageLoopProxy> file_message_loop, |
| 37 FileSystemContext* file_system_context, | 37 FileSystemContext* file_system_context, |
| 38 bool is_incognito); | 38 bool is_incognito); |
| 39 virtual ~FileSystemQuotaClient(); | 39 virtual ~FileSystemQuotaClient(); |
| 40 | 40 |
| 41 // QuotaClient methods. | 41 // QuotaClient methods. |
| 42 virtual quota::QuotaClient::ID id() const OVERRIDE; | 42 virtual quota::QuotaClient::ID id() const OVERRIDE; |
| 43 virtual void OnQuotaManagerDestroyed() OVERRIDE; | 43 virtual void OnQuotaManagerDestroyed() OVERRIDE; |
| 44 virtual void GetOriginUsage(const GURL& origin_url, | 44 virtual void GetOriginUsage(const GURL& origin_url, |
| 45 quota::StorageType type, | 45 quota::StorageType type, |
| 46 GetUsageCallback* callback) OVERRIDE; | 46 GetUsageCallback callback) OVERRIDE; |
|
awong
2011/09/29 18:05:15
const &.
tzik
2011/10/11 04:53:57
Done.
| |
| 47 virtual void GetOriginsForType(quota::StorageType type, | 47 virtual void GetOriginsForType(quota::StorageType type, |
| 48 GetOriginsCallback* callback) OVERRIDE; | 48 GetOriginsCallback callback) OVERRIDE; |
|
awong
2011/09/29 18:05:15
const &.
tzik
2011/10/11 04:53:57
Done.
| |
| 49 virtual void GetOriginsForHost(quota::StorageType type, | 49 virtual void GetOriginsForHost(quota::StorageType type, |
| 50 const std::string& host, | 50 const std::string& host, |
| 51 GetOriginsCallback* callback) OVERRIDE; | 51 GetOriginsCallback callback) OVERRIDE; |
|
awong
2011/09/29 18:05:15
const &.
tzik
2011/10/11 04:53:57
Done.
| |
| 52 virtual void DeleteOriginData(const GURL& origin, | 52 virtual void DeleteOriginData(const GURL& origin, |
| 53 quota::StorageType type, | 53 quota::StorageType type, |
| 54 DeletionCallback* callback) OVERRIDE; | 54 DeletionCallback callback) OVERRIDE; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 class GetOriginUsageTask; | 57 class GetOriginUsageTask; |
| 58 class GetOriginsTaskBase; | 58 class GetOriginsTaskBase; |
| 59 class GetOriginsForTypeTask; | 59 class GetOriginsForTypeTask; |
| 60 class GetOriginsForHostTask; | 60 class GetOriginsForHostTask; |
| 61 class DeleteOriginTask; | 61 class DeleteOriginTask; |
| 62 | 62 |
| 63 typedef std::pair<fileapi::FileSystemType, std::string> TypeAndHostOrOrigin; | 63 typedef std::pair<fileapi::FileSystemType, std::string> TypeAndHostOrOrigin; |
| 64 typedef quota::CallbackQueueMap1<GetUsageCallback*, | 64 typedef quota::CallbackQueueMap1<GetUsageCallback, |
| 65 TypeAndHostOrOrigin, | 65 TypeAndHostOrOrigin, |
| 66 int64 | 66 int64 |
| 67 > UsageCallbackMap; | 67 > UsageCallbackMap; |
| 68 typedef quota::CallbackQueueMap2<GetOriginsCallback*, | 68 typedef quota::CallbackQueueMap2<GetOriginsCallback, |
| 69 fileapi::FileSystemType, | 69 fileapi::FileSystemType, |
| 70 const std::set<GURL>&, | 70 const std::set<GURL>&, |
| 71 quota::StorageType | 71 quota::StorageType |
| 72 > OriginsForTypeCallbackMap; | 72 > OriginsForTypeCallbackMap; |
| 73 typedef quota::CallbackQueueMap2<GetOriginsCallback*, | 73 typedef quota::CallbackQueueMap2<GetOriginsCallback, |
| 74 TypeAndHostOrOrigin, | 74 TypeAndHostOrOrigin, |
| 75 const std::set<GURL>&, | 75 const std::set<GURL>&, |
| 76 quota::StorageType | 76 quota::StorageType |
| 77 > OriginsForHostCallbackMap; | 77 > OriginsForHostCallbackMap; |
| 78 | 78 |
| 79 void DidGetOriginUsage(fileapi::FileSystemType type, | 79 void DidGetOriginUsage(fileapi::FileSystemType type, |
| 80 const GURL& origin, int64 usage); | 80 const GURL& origin, int64 usage); |
| 81 void DidGetOriginsForType(fileapi::FileSystemType type, | 81 void DidGetOriginsForType(fileapi::FileSystemType type, |
| 82 const std::set<GURL>& origins); | 82 const std::set<GURL>& origins); |
| 83 void DidGetOriginsForHost(const TypeAndHostOrOrigin& type_and_host, | 83 void DidGetOriginsForHost(const TypeAndHostOrOrigin& type_and_host, |
| 84 const std::set<GURL>& origins); | 84 const std::set<GURL>& origins); |
| 85 | 85 |
| 86 scoped_refptr<base::MessageLoopProxy> file_message_loop_; | 86 scoped_refptr<base::MessageLoopProxy> file_message_loop_; |
| 87 scoped_refptr<FileSystemContext> file_system_context_; | 87 scoped_refptr<FileSystemContext> file_system_context_; |
| 88 | 88 |
| 89 bool is_incognito_; | 89 bool is_incognito_; |
| 90 | 90 |
| 91 // Pending callbacks. | 91 // Pending callbacks. |
| 92 UsageCallbackMap pending_usage_callbacks_; | 92 UsageCallbackMap pending_usage_callbacks_; |
| 93 OriginsForTypeCallbackMap pending_origins_for_type_callbacks_; | 93 OriginsForTypeCallbackMap pending_origins_for_type_callbacks_; |
| 94 OriginsForHostCallbackMap pending_origins_for_host_callbacks_; | 94 OriginsForHostCallbackMap pending_origins_for_host_callbacks_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient); | 96 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace fileapi | 99 } // namespace fileapi |
| 100 | 100 |
| 101 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 101 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
| OLD | NEW |