Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: content/browser/cache_storage/cache_storage_manager.cc

Issue 2607983002: avoid GCC content::CacheStorage::kSizeUnknown redeclaration error (Closed)
Patch Set: formatting Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/cache_storage/cache_storage_manager.cc
diff --git a/content/browser/cache_storage/cache_storage_manager.cc b/content/browser/cache_storage/cache_storage_manager.cc
index 362b8e923aa9647ed627835cf7e287fc9446da00..2b4ae3e75e776fe158a9f0b010942c912e87e7a0 100644
--- a/content/browser/cache_storage/cache_storage_manager.cc
+++ b/content/browser/cache_storage/cache_storage_manager.cc
@@ -51,14 +51,15 @@ void DeleteOriginDidDeleteDir(
: storage::kQuotaErrorAbort));
}
-// Calculate the sum of all cache sizes in this store, but only if all sizes are
-// known. If one or more sizes are not known then return kSizeUnknown.
+// Calculate the sum of all cache sizes in this store, but only if all
+// sizes are known. If one or more sizes are not known then return
+// kCacheStorageSizeUnknown.
int64_t GetCacheStorageSize(const proto::CacheStorageIndex& index) {
int64_t storage_size = 0;
for (int i = 0, max = index.cache_size(); i < max; ++i) {
const proto::CacheStorageIndex::Cache& cache = index.cache(i);
- if (!cache.has_size() || cache.size() == CacheStorage::kSizeUnknown)
- return CacheStorage::kSizeUnknown;
+ if (!cache.has_size() || cache.size() == kCacheStorageSizeUnknown)
+ return kCacheStorageSizeUnknown;
storage_size += cache.size();
}
return storage_size;
@@ -86,7 +87,7 @@ void ListOriginsAndLastModifiedOnTaskRunner(
if (index.ParseFromString(protobuf)) {
if (index.has_origin()) {
if (base::GetFileInfo(path, &file_info)) {
- int64_t storage_size = CacheStorage::kSizeUnknown;
+ int64_t storage_size = kCacheStorageSizeUnknown;
if (file_info.last_modified < index_last_modified)
storage_size = GetCacheStorageSize(index);
usages->push_back(CacheStorageUsageInfo(
@@ -137,7 +138,7 @@ void OneOriginSizeReported(const base::Closure& callback,
int64_t size) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- DCHECK_NE(size, CacheStorage::kSizeUnknown);
+ DCHECK_NE(size, kCacheStorageSizeUnknown);
usage->total_size_bytes = size;
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback);
}
@@ -297,7 +298,7 @@ void CacheStorageManager::GetAllOriginsUsageGetSizes(
callback));
for (CacheStorageUsageInfo& usage : *usages_ptr) {
- if (usage.total_size_bytes != CacheStorage::kSizeUnknown) {
+ if (usage.total_size_bytes != kCacheStorageSizeUnknown) {
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, barrier_closure);
continue;
}

Powered by Google App Engine
This is Rietveld 408576698