| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 FreeDiskSpaceGetterInterface* free_disk_space_getter); | 63 FreeDiskSpaceGetterInterface* free_disk_space_getter); |
| 64 | 64 |
| 65 // Returns true if the given path is under drive cache directory, i.e. | 65 // Returns true if the given path is under drive cache directory, i.e. |
| 66 // <user_profile_dir>/GCache/v1 | 66 // <user_profile_dir>/GCache/v1 |
| 67 // | 67 // |
| 68 // Can be called on any thread. | 68 // Can be called on any thread. |
| 69 bool IsUnderFileCacheDirectory(const base::FilePath& path) const; | 69 bool IsUnderFileCacheDirectory(const base::FilePath& path) const; |
| 70 | 70 |
| 71 // Gets the cache entry for file corresponding to |id| and returns true if | 71 // Gets the cache entry for file corresponding to |id| and returns true if |
| 72 // entry exists in cache map. | 72 // entry exists in cache map. |
| 73 bool GetCacheEntry(const std::string& id, FileCacheEntry* entry); | 73 FileError GetCacheEntry(const std::string& id, FileCacheEntry* entry); |
| 74 | 74 |
| 75 // Returns an object to iterate over entries. | 75 // Returns an object to iterate over entries. |
| 76 scoped_ptr<Iterator> GetIterator(); | 76 scoped_ptr<Iterator> GetIterator(); |
| 77 | 77 |
| 78 // Frees up disk space to store a file with |num_bytes| size content, while | 78 // Frees up disk space to store a file with |num_bytes| size content, while |
| 79 // keeping cryptohome::kMinFreeSpaceInBytes bytes on the disk, if needed. | 79 // keeping cryptohome::kMinFreeSpaceInBytes bytes on the disk, if needed. |
| 80 // Returns true if we successfully manage to have enough space, otherwise | 80 // Returns true if we successfully manage to have enough space, otherwise |
| 81 // false. | 81 // false. |
| 82 bool FreeDiskSpaceIfNeededFor(int64 num_bytes); | 82 bool FreeDiskSpaceIfNeededFor(int64 num_bytes); |
| 83 | 83 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // invalidate its weak pointers before any other members are destroyed. | 192 // invalidate its weak pointers before any other members are destroyed. |
| 193 // This object should be accessed only on |blocking_task_runner_|. | 193 // This object should be accessed only on |blocking_task_runner_|. |
| 194 base::WeakPtrFactory<FileCache> weak_ptr_factory_; | 194 base::WeakPtrFactory<FileCache> weak_ptr_factory_; |
| 195 DISALLOW_COPY_AND_ASSIGN(FileCache); | 195 DISALLOW_COPY_AND_ASSIGN(FileCache); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace internal | 198 } // namespace internal |
| 199 } // namespace drive | 199 } // namespace drive |
| 200 | 200 |
| 201 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ | 201 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ |
| OLD | NEW |