| 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 COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ |
| 6 #define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ | 6 #define COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 MarkMountedCallback; | 141 MarkMountedCallback; |
| 142 | 142 |
| 143 // Used to get file path. | 143 // Used to get file path. |
| 144 typedef base::Callback<void(FileError error, const base::FilePath& file_path)> | 144 typedef base::Callback<void(FileError error, const base::FilePath& file_path)> |
| 145 GetFilePathCallback; | 145 GetFilePathCallback; |
| 146 | 146 |
| 147 // Used to free space. | 147 // Used to free space. |
| 148 typedef base::Callback<void(bool)> FreeDiskSpaceCallback; | 148 typedef base::Callback<void(bool)> FreeDiskSpaceCallback; |
| 149 | 149 |
| 150 // Used for returning result of calculated cache size. | 150 // Used for returning result of calculated cache size. |
| 151 typedef base::Callback<void(uint64_t)> EvictableCacheSizeCallback; | 151 typedef base::Callback<void(int64_t)> CacheSizeCallback; |
| 152 | 152 |
| 153 // The mode of opening a file. | 153 // The mode of opening a file. |
| 154 enum OpenMode { | 154 enum OpenMode { |
| 155 // Open the file if exists. If not, failed. | 155 // Open the file if exists. If not, failed. |
| 156 OPEN_FILE, | 156 OPEN_FILE, |
| 157 | 157 |
| 158 // Create a new file if not exists, and then open it. If exists, failed. | 158 // Create a new file if not exists, and then open it. If exists, failed. |
| 159 CREATE_FILE, | 159 CREATE_FILE, |
| 160 | 160 |
| 161 // Open the file if exists. If not, create a new file and then open it. | 161 // Open the file if exists. If not, create a new file and then open it. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // Finds a path of an entry (a file or a directory) by |resource_id|. | 461 // Finds a path of an entry (a file or a directory) by |resource_id|. |
| 462 virtual void GetPathFromResourceId(const std::string& resource_id, | 462 virtual void GetPathFromResourceId(const std::string& resource_id, |
| 463 const GetFilePathCallback& callback) = 0; | 463 const GetFilePathCallback& callback) = 0; |
| 464 | 464 |
| 465 // Free drive caches if needed to secure given available spaces. |callback| | 465 // Free drive caches if needed to secure given available spaces. |callback| |
| 466 // takes whether given bytes are available or not. | 466 // takes whether given bytes are available or not. |
| 467 virtual void FreeDiskSpaceIfNeededFor( | 467 virtual void FreeDiskSpaceIfNeededFor( |
| 468 int64_t num_bytes, | 468 int64_t num_bytes, |
| 469 const FreeDiskSpaceCallback& callback) = 0; | 469 const FreeDiskSpaceCallback& callback) = 0; |
| 470 | 470 |
| 471 // Calculates total cache size. |
| 472 // |callback| must not be null. |
| 473 virtual void CalculateCacheSize(const CacheSizeCallback& callback) = 0; |
| 474 |
| 471 // Calculates evictable cache size. | 475 // Calculates evictable cache size. |
| 472 // |callback| must not be null. | 476 // |callback| must not be null. |
| 473 virtual void CalculateEvictableCacheSize( | 477 virtual void CalculateEvictableCacheSize( |
| 474 const EvictableCacheSizeCallback& callback) = 0; | 478 const CacheSizeCallback& callback) = 0; |
| 475 }; | 479 }; |
| 476 | 480 |
| 477 } // namespace drive | 481 } // namespace drive |
| 478 | 482 |
| 479 #endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ | 483 #endif // COMPONENTS_DRIVE_CHROMEOS_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |