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

Unified Diff: components/drive/chromeos/file_system.cc

Issue 2048993002: Add an API to get total size of Drive cache including non-evictable ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an unnecessary parameter. Created 4 years, 6 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
« no previous file with comments | « components/drive/chromeos/file_system.h ('k') | components/drive/chromeos/file_system_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/drive/chromeos/file_system.cc
diff --git a/components/drive/chromeos/file_system.cc b/components/drive/chromeos/file_system.cc
index 4900c5f5d53ca33d17a8bf26547d0ca8ea058cfa..0ec7d38fb35cf7cd90df29754866a5e13720cbb5 100644
--- a/components/drive/chromeos/file_system.cc
+++ b/components/drive/chromeos/file_system.cc
@@ -210,7 +210,11 @@ bool FreeDiskSpaceIfNeededForOnBlockingPool(internal::FileCache* cache,
return cache->FreeDiskSpaceIfNeededFor(num_bytes);
}
-uint64_t CalculateEvictableCacheSizeOnBlockingPool(internal::FileCache* cache) {
+int64_t CalculateCacheSizeOnBlockingPool(internal::FileCache* cache) {
+ return cache->CalculateCacheSize();
+}
+
+int64_t CalculateEvictableCacheSizeOnBlockingPool(internal::FileCache* cache) {
return cache->CalculateEvictableCacheSize();
}
@@ -1051,8 +1055,16 @@ void FileSystem::FreeDiskSpaceIfNeededFor(
callback);
}
+void FileSystem::CalculateCacheSize(const CacheSizeCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!callback.is_null());
+ base::PostTaskAndReplyWithResult(
+ blocking_task_runner_.get(), FROM_HERE,
+ base::Bind(&CalculateCacheSizeOnBlockingPool, cache_), callback);
+}
+
void FileSystem::CalculateEvictableCacheSize(
- const EvictableCacheSizeCallback& callback) {
+ const CacheSizeCallback& callback) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!callback.is_null());
base::PostTaskAndReplyWithResult(
« no previous file with comments | « components/drive/chromeos/file_system.h ('k') | components/drive/chromeos/file_system_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698