Chromium Code Reviews| 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_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 | 10 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 const GetFileCallback& callback) = 0; | 319 const GetFileCallback& callback) = 0; |
| 320 | 320 |
| 321 // Gets a file by the given |resource_id| from the gdata server. Used for | 321 // Gets a file by the given |resource_id| from the gdata server. Used for |
| 322 // fetching pinned-but-not-fetched files. | 322 // fetching pinned-but-not-fetched files. |
| 323 // | 323 // |
| 324 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 324 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
| 325 virtual void GetFileByResourceId( | 325 virtual void GetFileByResourceId( |
| 326 const std::string& resource_id, | 326 const std::string& resource_id, |
| 327 const GetFileCallback& callback) = 0; | 327 const GetFileCallback& callback) = 0; |
| 328 | 328 |
| 329 // Obtains the list of currently active operations. | 329 // Gets the operation registry that manage all operations performed through |
|
achuithb
2012/04/24 00:16:22
manages
satorux1
2012/04/24 06:15:25
Done.
| |
| 330 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 330 // the GDataFileSystem object. |
| 331 GetProgressStatusList() = 0; | 331 virtual GDataOperationRegistry* GetOperationRegistry() = 0; |
| 332 | |
| 333 // Cancels ongoing operation for a given |file_path|. Returns true if | |
| 334 // the operation was found and canceled. | |
| 335 virtual bool CancelOperation(const FilePath& file_path) = 0; | |
| 336 | |
| 337 // Add operation observer. | |
| 338 virtual void AddOperationObserver( | |
| 339 GDataOperationRegistry::Observer* observer) = 0; | |
| 340 | |
| 341 // Remove operation observer. | |
| 342 virtual void RemoveOperationObserver( | |
| 343 GDataOperationRegistry::Observer* observer) = 0; | |
| 344 | 332 |
| 345 // Gets the cache state of file corresponding to |resource_id| and |md5| if it | 333 // Gets the cache state of file corresponding to |resource_id| and |md5| if it |
| 346 // exists on disk. | 334 // exists on disk. |
| 347 // Initializes cache if it has not been initialized. | 335 // Initializes cache if it has not been initialized. |
| 348 // Upon completion, |callback| is invoked on the thread where this method was | 336 // Upon completion, |callback| is invoked on the thread where this method was |
| 349 // called with the cache state if file exists in cache or CACHE_STATE_NONE | 337 // called with the cache state if file exists in cache or CACHE_STATE_NONE |
| 350 // otherwise. | 338 // otherwise. |
| 351 virtual void GetCacheState(const std::string& resource_id, | 339 virtual void GetCacheState(const std::string& resource_id, |
| 352 const std::string& md5, | 340 const std::string& md5, |
| 353 const GetCacheStateCallback& callback) = 0; | 341 const GetCacheStateCallback& callback) = 0; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 const FileOperationCallback& callback) OVERRIDE; | 409 const FileOperationCallback& callback) OVERRIDE; |
| 422 virtual void CreateDirectory(const FilePath& directory_path, | 410 virtual void CreateDirectory(const FilePath& directory_path, |
| 423 bool is_exclusive, | 411 bool is_exclusive, |
| 424 bool is_recursive, | 412 bool is_recursive, |
| 425 const FileOperationCallback& callback) OVERRIDE; | 413 const FileOperationCallback& callback) OVERRIDE; |
| 426 virtual void GetFileByPath(const FilePath& file_path, | 414 virtual void GetFileByPath(const FilePath& file_path, |
| 427 const GetFileCallback& callback) OVERRIDE; | 415 const GetFileCallback& callback) OVERRIDE; |
| 428 virtual void GetFileByResourceId( | 416 virtual void GetFileByResourceId( |
| 429 const std::string& resource_id, | 417 const std::string& resource_id, |
| 430 const GetFileCallback& callback) OVERRIDE; | 418 const GetFileCallback& callback) OVERRIDE; |
| 431 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 419 virtual GDataOperationRegistry* GetOperationRegistry() OVERRIDE; |
| 432 GetProgressStatusList() OVERRIDE; | |
| 433 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; | |
| 434 virtual void AddOperationObserver( | |
| 435 GDataOperationRegistry::Observer* observer) OVERRIDE; | |
| 436 virtual void RemoveOperationObserver( | |
| 437 GDataOperationRegistry::Observer* observer) OVERRIDE; | |
| 438 virtual void GetCacheState(const std::string& resource_id, | 420 virtual void GetCacheState(const std::string& resource_id, |
| 439 const std::string& md5, | 421 const std::string& md5, |
| 440 const GetCacheStateCallback& callback) OVERRIDE; | 422 const GetCacheStateCallback& callback) OVERRIDE; |
| 441 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, | 423 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, |
| 442 GDataFileProperties* properties) OVERRIDE; | 424 GDataFileProperties* properties) OVERRIDE; |
| 443 virtual FilePath GetCacheDirectoryPath( | 425 virtual FilePath GetCacheDirectoryPath( |
| 444 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; | 426 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; |
| 445 virtual FilePath GetCacheFilePath( | 427 virtual FilePath GetCacheFilePath( |
| 446 const std::string& resource_id, | 428 const std::string& resource_id, |
| 447 const std::string& md5, | 429 const std::string& md5, |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1328 }; | 1310 }; |
| 1329 | 1311 |
| 1330 // Sets the free disk space getter for testing. | 1312 // Sets the free disk space getter for testing. |
| 1331 // The existing getter is deleted. | 1313 // The existing getter is deleted. |
| 1332 void SetFreeDiskSpaceGetterForTesting( | 1314 void SetFreeDiskSpaceGetterForTesting( |
| 1333 FreeDiskSpaceGetterInterface* getter); | 1315 FreeDiskSpaceGetterInterface* getter); |
| 1334 | 1316 |
| 1335 } // namespace gdata | 1317 } // namespace gdata |
| 1336 | 1318 |
| 1337 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1319 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |