| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // Calculates MD5 of the cache file and updates the stored value. | 108 // Calculates MD5 of the cache file and updates the stored value. |
| 109 FileError UpdateMd5(const std::string& id); | 109 FileError UpdateMd5(const std::string& id); |
| 110 | 110 |
| 111 // Clears dirty state of the specified entry. | 111 // Clears dirty state of the specified entry. |
| 112 FileError ClearDirty(const std::string& id); | 112 FileError ClearDirty(const std::string& id); |
| 113 | 113 |
| 114 // Removes the specified cache entry and delete cache files if available. | 114 // Removes the specified cache entry and delete cache files if available. |
| 115 FileError Remove(const std::string& id); | 115 FileError Remove(const std::string& id); |
| 116 | 116 |
| 117 // Removes all the files in the cache directory and cache entries in DB. | 117 // Removes all the files in the cache directory. |
| 118 bool ClearAll(); | 118 bool ClearAll(); |
| 119 | 119 |
| 120 // Initializes the cache. Returns true on success. | 120 // Initializes the cache. Returns true on success. |
| 121 bool Initialize(); | 121 bool Initialize(); |
| 122 | 122 |
| 123 // Destroys this cache. This function posts a task to the blocking task | 123 // Destroys this cache. This function posts a task to the blocking task |
| 124 // runner to safely delete the object. | 124 // runner to safely delete the object. |
| 125 // Must be called on the UI thread. | 125 // Must be called on the UI thread. |
| 126 void Destroy(); | 126 void Destroy(); |
| 127 | 127 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // invalidate its weak pointers before any other members are destroyed. | 181 // invalidate its weak pointers before any other members are destroyed. |
| 182 // This object should be accessed only on |blocking_task_runner_|. | 182 // This object should be accessed only on |blocking_task_runner_|. |
| 183 base::WeakPtrFactory<FileCache> weak_ptr_factory_; | 183 base::WeakPtrFactory<FileCache> weak_ptr_factory_; |
| 184 DISALLOW_COPY_AND_ASSIGN(FileCache); | 184 DISALLOW_COPY_AND_ASSIGN(FileCache); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 } // namespace internal | 187 } // namespace internal |
| 188 } // namespace drive | 188 } // namespace drive |
| 189 | 189 |
| 190 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ | 190 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ |
| OLD | NEW |