summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/drive/file_cache.h
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 09:06:02 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 09:06:02 +0000
commit8e37b9b1a7310c4f391e600376e832dd7cf44b3e (patch)
tree827b1b9733736571ae8036f0f1f4fa0398c5e40e /chrome/browser/chromeos/drive/file_cache.h
parent86df47895aec42edfb8062d93c55a7b3f8b1f8f9 (diff)
downloadchromium_src-8e37b9b1a7310c4f391e600376e832dd7cf44b3e.zip
chromium_src-8e37b9b1a7310c4f391e600376e832dd7cf44b3e.tar.gz
chromium_src-8e37b9b1a7310c4f391e600376e832dd7cf44b3e.tar.bz2
Remove legacy from drive::internal::FileCache.
- Remove XXXOnUIThread methods. - Merge StoreInternal method to Store. BUG=231221 Review URL: https://codereview.chromium.org/108873005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/drive/file_cache.h')
-rw-r--r--chrome/browser/chromeos/drive/file_cache.h55
1 files changed, 7 insertions, 48 deletions
diff --git a/chrome/browser/chromeos/drive/file_cache.h b/chrome/browser/chromeos/drive/file_cache.h
index cc59537..c3210cb 100644
--- a/chrome/browser/chromeos/drive/file_cache.h
+++ b/chrome/browser/chromeos/drive/file_cache.h
@@ -7,9 +7,7 @@
#include <set>
#include <string>
-#include <vector>
-#include "base/callback_forward.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -26,11 +24,6 @@ class FileCacheEntry;
namespace internal {
-// Callback for GetFileFromCache.
-typedef base::Callback<void(FileError error,
- const base::FilePath& cache_file_path)>
- GetFileFromCacheCallback;
-
// Interface class used for getting the free disk space. Tests can inject an
// implementation that reports fake free disk space.
class FreeDiskSpaceGetterInterface {
@@ -55,8 +48,9 @@ class FileCache {
// |cache_file_directory| stores cached files.
//
- // |blocking_task_runner| is used to post a task to the blocking worker
- // pool for file operations. Must not be null.
+ // |blocking_task_runner| indicates the blocking worker pool for cache
+ // operations. All operations on this FileCache must be run on this runner.
+ // Must not be null.
//
// |free_disk_space_getter| is used to inject a custom free disk space
// getter for testing. NULL must be passed for production code.
@@ -98,42 +92,18 @@ class FileCache {
const base::FilePath& source_path,
FileOperationType file_operation_type);
- // Runs Pin() on |blocking_task_runner_|, and calls |callback| with the result
- // asynchronously.
- // |callback| must not be null.
- // Must be called on the UI thread.
- void PinOnUIThread(const std::string& id,
- const FileOperationCallback& callback);
-
// Pins the specified entry.
FileError Pin(const std::string& id);
- // Runs Unpin() on |blocking_task_runner_|, and calls |callback| with the
- // result asynchronously.
- // |callback| must not be null.
- // Must be called on the UI thread.
- void UnpinOnUIThread(const std::string& id,
- const FileOperationCallback& callback);
-
// Unpins the specified entry.
FileError Unpin(const std::string& id);
- // Runs MarkAsMounted() on |blocking_task_runner_|, and calls |callback| with
- // the result asynchronously.
- // |callback| must not be null.
- // Must be called on the UI thread.
- void MarkAsMountedOnUIThread(const std::string& id,
- const GetFileFromCacheCallback& callback);
-
// Sets the state of the cache entry corresponding to |id| as mounted.
FileError MarkAsMounted(const std::string& id,
base::FilePath* cache_file_path);
- // Set the state of the cache entry corresponding to file_path as unmounted.
- // |callback| must not be null.
- // Must be called on the UI thread.
- void MarkAsUnmountedOnUIThread(const base::FilePath& file_path,
- const FileOperationCallback& callback);
+ // Sets the state of the cache entry corresponding to file_path as unmounted.
+ FileError MarkAsUnmounted(const base::FilePath& file_path);
// Marks the specified entry dirty.
FileError MarkDirty(const std::string& id);
@@ -155,7 +125,7 @@ class FileCache {
// Must be called on the UI thread.
void Destroy();
- // Moves files in the cache directory which are not manged by FileCache to
+ // Moves files in the cache directory which are not managed by FileCache to
// |dest_directory|.
// |recovered_cache_info| should contain cache info recovered from the trashed
// metadata DB. It is used to ignore non-dirty files.
@@ -182,17 +152,6 @@ class FileCache {
// Destroys the cache on the blocking pool.
void DestroyOnBlockingPool();
- // Used to implement Store and StoreLocallyModifiedOnUIThread.
- // TODO(hidehiko): Merge this method with Store(), after
- // StoreLocallyModifiedOnUIThread is removed.
- FileError StoreInternal(const std::string& id,
- const std::string& md5,
- const base::FilePath& source_path,
- FileOperationType file_operation_type);
-
- // Used to implement MarkAsUnmountedOnUIThread.
- FileError MarkAsUnmounted(const base::FilePath& file_path);
-
// Returns true if we have sufficient space to store the given number of
// bytes, while keeping kMinFreeSpace bytes on the disk.
bool HasEnoughSpaceFor(int64 num_bytes, const base::FilePath& path);
@@ -223,7 +182,7 @@ class FileCache {
// this value.
//
// Copied from cryptohome/homedirs.h.
-// TODO(satorux): Share the constant.
+// TODO(hashimoto): Share the constant.
const int64 kMinFreeSpace = 512 * 1LL << 20;
} // namespace internal