| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "storage/browser/quota/quota_manager.h" | 5 #include "storage/browser/quota/quota_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 StorageType type, | 840 StorageType type, |
| 841 const UsageAndQuotaCallback& callback) { | 841 const UsageAndQuotaCallback& callback) { |
| 842 DCHECK(origin == origin.GetOrigin()); | 842 DCHECK(origin == origin.GetOrigin()); |
| 843 if (!IsSupportedType(type) || | 843 if (!IsSupportedType(type) || |
| 844 (is_incognito_ && !IsSupportedIncognitoType(type))) { | 844 (is_incognito_ && !IsSupportedIncognitoType(type))) { |
| 845 callback.Run(kQuotaErrorNotSupported, 0, 0); | 845 callback.Run(kQuotaErrorNotSupported, 0, 0); |
| 846 return; | 846 return; |
| 847 } | 847 } |
| 848 LazyInitialize(); | 848 LazyInitialize(); |
| 849 | 849 |
| 850 bool is_session_only = special_storage_policy_ && | 850 bool is_session_only = type == kStorageTypeTemporary && |
| 851 special_storage_policy_ && |
| 851 special_storage_policy_->IsStorageSessionOnly(origin); | 852 special_storage_policy_->IsStorageSessionOnly(origin); |
| 852 UsageAndQuotaHelper* helper = new UsageAndQuotaHelper( | 853 UsageAndQuotaHelper* helper = new UsageAndQuotaHelper( |
| 853 this, origin, type, IsStorageUnlimited(origin, type), is_session_only, | 854 this, origin, type, IsStorageUnlimited(origin, type), is_session_only, |
| 854 is_incognito_, callback); | 855 is_incognito_, callback); |
| 855 helper->Start(); | 856 helper->Start(); |
| 856 } | 857 } |
| 857 | 858 |
| 858 void QuotaManager::GetUsageAndQuota(const GURL& origin, | 859 void QuotaManager::GetUsageAndQuota(const GURL& origin, |
| 859 StorageType type, | 860 StorageType type, |
| 860 const UsageAndQuotaCallback& callback) { | 861 const UsageAndQuotaCallback& callback) { |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 } | 1685 } |
| 1685 | 1686 |
| 1686 // static | 1687 // static |
| 1687 std::tuple<int64_t, int64_t> QuotaManager::GetVolumeInfo( | 1688 std::tuple<int64_t, int64_t> QuotaManager::GetVolumeInfo( |
| 1688 const base::FilePath& path) { | 1689 const base::FilePath& path) { |
| 1689 return std::make_tuple(base::SysInfo::AmountOfTotalDiskSpace(path), | 1690 return std::make_tuple(base::SysInfo::AmountOfTotalDiskSpace(path), |
| 1690 base::SysInfo::AmountOfFreeDiskSpace(path)); | 1691 base::SysInfo::AmountOfFreeDiskSpace(path)); |
| 1691 } | 1692 } |
| 1692 | 1693 |
| 1693 } // namespace storage | 1694 } // namespace storage |
| OLD | NEW |