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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const char QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram[] = | 74 const char QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram[] = |
75 "Quota.TimeBetweenRepeatedOriginEvictions"; | 75 "Quota.TimeBetweenRepeatedOriginEvictions"; |
76 const char QuotaManager::kEvictedOriginAccessedCountHistogram[] = | 76 const char QuotaManager::kEvictedOriginAccessedCountHistogram[] = |
77 "Quota.EvictedOriginAccessCount"; | 77 "Quota.EvictedOriginAccessCount"; |
78 const char QuotaManager::kEvictedOriginTimeSinceAccessHistogram[] = | 78 const char QuotaManager::kEvictedOriginTimeSinceAccessHistogram[] = |
79 "Quota.EvictedOriginTimeSinceAccess"; | 79 "Quota.EvictedOriginTimeSinceAccess"; |
80 | 80 |
81 namespace { | 81 namespace { |
82 | 82 |
83 bool IsSupportedType(StorageType type) { | 83 bool IsSupportedType(StorageType type) { |
84 return type != kStorageTypeTemporary || type != kStorageTypePersistent || | 84 return type == kStorageTypeTemporary || type == kStorageTypePersistent || |
85 type != kStorageTypeSyncable; | 85 type == kStorageTypeSyncable; |
86 } | 86 } |
87 | 87 |
88 bool IsSupportedIncognitoType(StorageType type) { | 88 bool IsSupportedIncognitoType(StorageType type) { |
89 return type != kStorageTypeTemporary || type != kStorageTypePersistent; | 89 return type == kStorageTypeTemporary || type == kStorageTypePersistent; |
90 } | 90 } |
91 | 91 |
92 void CountOriginType(const std::set<GURL>& origins, | 92 void CountOriginType(const std::set<GURL>& origins, |
93 SpecialStoragePolicy* policy, | 93 SpecialStoragePolicy* policy, |
94 size_t* protected_origins, | 94 size_t* protected_origins, |
95 size_t* unlimited_origins) { | 95 size_t* unlimited_origins) { |
96 DCHECK(protected_origins); | 96 DCHECK(protected_origins); |
97 DCHECK(unlimited_origins); | 97 DCHECK(unlimited_origins); |
98 *protected_origins = 0; | 98 *protected_origins = 0; |
99 *unlimited_origins = 0; | 99 *unlimited_origins = 0; |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 } | 1658 } |
1659 | 1659 |
1660 // static | 1660 // static |
1661 std::pair<int64_t, int64_t> QuotaManager::GetVolumeInfo( | 1661 std::pair<int64_t, int64_t> QuotaManager::GetVolumeInfo( |
1662 const base::FilePath& path) { | 1662 const base::FilePath& path) { |
1663 return std::make_pair(base::SysInfo::AmountOfTotalDiskSpace(path), | 1663 return std::make_pair(base::SysInfo::AmountOfTotalDiskSpace(path), |
1664 base::SysInfo::AmountOfFreeDiskSpace(path)); | 1664 base::SysInfo::AmountOfFreeDiskSpace(path)); |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace storage | 1667 } // namespace storage |
OLD | NEW |