| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // false. | 81 // false. |
| 82 bool FreeDiskSpaceIfNeededFor(int64 num_bytes); | 82 bool FreeDiskSpaceIfNeededFor(int64 num_bytes); |
| 83 | 83 |
| 84 // Checks if file corresponding to |id| exists in cache, and returns | 84 // Checks if file corresponding to |id| exists in cache, and returns |
| 85 // FILE_ERROR_OK with |cache_file_path| storing the path to the file. | 85 // FILE_ERROR_OK with |cache_file_path| storing the path to the file. |
| 86 // |cache_file_path| must not be null. | 86 // |cache_file_path| must not be null. |
| 87 FileError GetFile(const std::string& id, base::FilePath* cache_file_path); | 87 FileError GetFile(const std::string& id, base::FilePath* cache_file_path); |
| 88 | 88 |
| 89 // Stores |source_path| as a cache of the remote content of the file | 89 // Stores |source_path| as a cache of the remote content of the file |
| 90 // with |id| and |md5|. | 90 // with |id| and |md5|. |
| 91 // Pass an empty string as MD5 to mark the entry as dirty. |
| 91 FileError Store(const std::string& id, | 92 FileError Store(const std::string& id, |
| 92 const std::string& md5, | 93 const std::string& md5, |
| 93 const base::FilePath& source_path, | 94 const base::FilePath& source_path, |
| 94 FileOperationType file_operation_type); | 95 FileOperationType file_operation_type); |
| 95 | 96 |
| 96 // Pins the specified entry. | 97 // Pins the specified entry. |
| 97 FileError Pin(const std::string& id); | 98 FileError Pin(const std::string& id); |
| 98 | 99 |
| 99 // Unpins the specified entry. | 100 // Unpins the specified entry. |
| 100 FileError Unpin(const std::string& id); | 101 FileError Unpin(const std::string& id); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // invalidate its weak pointers before any other members are destroyed. | 193 // invalidate its weak pointers before any other members are destroyed. |
| 193 // This object should be accessed only on |blocking_task_runner_|. | 194 // This object should be accessed only on |blocking_task_runner_|. |
| 194 base::WeakPtrFactory<FileCache> weak_ptr_factory_; | 195 base::WeakPtrFactory<FileCache> weak_ptr_factory_; |
| 195 DISALLOW_COPY_AND_ASSIGN(FileCache); | 196 DISALLOW_COPY_AND_ASSIGN(FileCache); |
| 196 }; | 197 }; |
| 197 | 198 |
| 198 } // namespace internal | 199 } // namespace internal |
| 199 } // namespace drive | 200 } // namespace drive |
| 200 | 201 |
| 201 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ | 202 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ |
| OLD | NEW |