| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <set> | 11 #include <set> |
| 10 #include <string> | 12 #include <string> |
| 11 #include <utility> | 13 #include <utility> |
| 12 | 14 |
| 13 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 16 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
| 17 #include "storage/common/quota/quota_types.h" | 20 #include "storage/common/quota/quota_types.h" |
| 18 | 21 |
| 19 class GURL; | 22 class GURL; |
| 20 | 23 |
| 21 namespace storage { | 24 namespace storage { |
| 22 class QuotaManager; | 25 class QuotaManager; |
| 23 } | 26 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 48 | 51 |
| 49 // Calls QuotaManager::GetHostUsage for each (origin, type) pair. | 52 // Calls QuotaManager::GetHostUsage for each (origin, type) pair. |
| 50 void OnGetOriginsComplete(const FetchResultCallback& callback, | 53 void OnGetOriginsComplete(const FetchResultCallback& callback, |
| 51 PendingHosts* pending_hosts); | 54 PendingHosts* pending_hosts); |
| 52 | 55 |
| 53 // Callback function for QuotaManager::GetHostUsage. | 56 // Callback function for QuotaManager::GetHostUsage. |
| 54 void GotHostUsage(QuotaInfoMap* quota_info, | 57 void GotHostUsage(QuotaInfoMap* quota_info, |
| 55 const base::Closure& completion, | 58 const base::Closure& completion, |
| 56 const std::string& host, | 59 const std::string& host, |
| 57 storage::StorageType type, | 60 storage::StorageType type, |
| 58 int64 usage); | 61 int64_t usage); |
| 59 | 62 |
| 60 // Called when all QuotaManager::GetHostUsage requests are complete. | 63 // Called when all QuotaManager::GetHostUsage requests are complete. |
| 61 void OnGetHostsUsageComplete(const FetchResultCallback& callback, | 64 void OnGetHostsUsageComplete(const FetchResultCallback& callback, |
| 62 QuotaInfoMap* quota_info); | 65 QuotaInfoMap* quota_info); |
| 63 | 66 |
| 64 void RevokeHostQuotaOnIOThread(const std::string& host); | 67 void RevokeHostQuotaOnIOThread(const std::string& host); |
| 65 void DidRevokeHostQuota(storage::QuotaStatusCode status, int64 quota); | 68 void DidRevokeHostQuota(storage::QuotaStatusCode status, int64_t quota); |
| 66 | 69 |
| 67 scoped_refptr<storage::QuotaManager> quota_manager_; | 70 scoped_refptr<storage::QuotaManager> quota_manager_; |
| 68 | 71 |
| 69 base::WeakPtrFactory<BrowsingDataQuotaHelperImpl> weak_factory_; | 72 base::WeakPtrFactory<BrowsingDataQuotaHelperImpl> weak_factory_; |
| 70 | 73 |
| 71 friend class BrowsingDataQuotaHelper; | 74 friend class BrowsingDataQuotaHelper; |
| 72 friend class BrowsingDataQuotaHelperTest; | 75 friend class BrowsingDataQuotaHelperTest; |
| 73 | 76 |
| 74 DISALLOW_COPY_AND_ASSIGN(BrowsingDataQuotaHelperImpl); | 77 DISALLOW_COPY_AND_ASSIGN(BrowsingDataQuotaHelperImpl); |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ | 80 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_IMPL_H_ |
| OLD | NEW |