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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 const GetFileCallback& callback) = 0; | 325 const GetFileCallback& callback) = 0; |
326 | 326 |
327 // Gets a file by the given |resource_id| from the gdata server. Used for | 327 // Gets a file by the given |resource_id| from the gdata server. Used for |
328 // fetching pinned-but-not-fetched files. | 328 // fetching pinned-but-not-fetched files. |
329 // | 329 // |
330 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 330 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
331 virtual void GetFileByResourceId( | 331 virtual void GetFileByResourceId( |
332 const std::string& resource_id, | 332 const std::string& resource_id, |
333 const GetFileCallback& callback) = 0; | 333 const GetFileCallback& callback) = 0; |
334 | 334 |
335 // Obtains the list of currently active operations. | 335 // Gets the operation registry that manages all operations performed through |
336 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 336 // the GDataFileSystem object. |
337 GetProgressStatusList() = 0; | 337 virtual GDataOperationRegistry* GetOperationRegistry() = 0; |
338 | |
339 // Cancels ongoing operation for a given |file_path|. Returns true if | |
340 // the operation was found and canceled. | |
341 virtual bool CancelOperation(const FilePath& file_path) = 0; | |
342 | |
343 // Add operation observer. | |
344 virtual void AddOperationObserver( | |
345 GDataOperationRegistry::Observer* observer) = 0; | |
346 | |
347 // Remove operation observer. | |
348 virtual void RemoveOperationObserver( | |
349 GDataOperationRegistry::Observer* observer) = 0; | |
350 | 338 |
351 // Gets the cache state of file corresponding to |resource_id| and |md5| if it | 339 // Gets the cache state of file corresponding to |resource_id| and |md5| if it |
352 // exists on disk. | 340 // exists on disk. |
353 // Initializes cache if it has not been initialized. | 341 // Initializes cache if it has not been initialized. |
354 // Upon completion, |callback| is invoked on the thread where this method was | 342 // Upon completion, |callback| is invoked on the thread where this method was |
355 // called with the cache state if file exists in cache or CACHE_STATE_NONE | 343 // called with the cache state if file exists in cache or CACHE_STATE_NONE |
356 // otherwise. | 344 // otherwise. |
357 virtual void GetCacheState(const std::string& resource_id, | 345 virtual void GetCacheState(const std::string& resource_id, |
358 const std::string& md5, | 346 const std::string& md5, |
359 const GetCacheStateCallback& callback) = 0; | 347 const GetCacheStateCallback& callback) = 0; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 const FileOperationCallback& callback) OVERRIDE; | 425 const FileOperationCallback& callback) OVERRIDE; |
438 virtual void CreateDirectory(const FilePath& directory_path, | 426 virtual void CreateDirectory(const FilePath& directory_path, |
439 bool is_exclusive, | 427 bool is_exclusive, |
440 bool is_recursive, | 428 bool is_recursive, |
441 const FileOperationCallback& callback) OVERRIDE; | 429 const FileOperationCallback& callback) OVERRIDE; |
442 virtual void GetFileByPath(const FilePath& file_path, | 430 virtual void GetFileByPath(const FilePath& file_path, |
443 const GetFileCallback& callback) OVERRIDE; | 431 const GetFileCallback& callback) OVERRIDE; |
444 virtual void GetFileByResourceId( | 432 virtual void GetFileByResourceId( |
445 const std::string& resource_id, | 433 const std::string& resource_id, |
446 const GetFileCallback& callback) OVERRIDE; | 434 const GetFileCallback& callback) OVERRIDE; |
447 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 435 virtual GDataOperationRegistry* GetOperationRegistry() OVERRIDE; |
448 GetProgressStatusList() OVERRIDE; | |
449 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; | |
450 virtual void AddOperationObserver( | |
451 GDataOperationRegistry::Observer* observer) OVERRIDE; | |
452 virtual void RemoveOperationObserver( | |
453 GDataOperationRegistry::Observer* observer) OVERRIDE; | |
454 virtual void GetCacheState(const std::string& resource_id, | 436 virtual void GetCacheState(const std::string& resource_id, |
455 const std::string& md5, | 437 const std::string& md5, |
456 const GetCacheStateCallback& callback) OVERRIDE; | 438 const GetCacheStateCallback& callback) OVERRIDE; |
457 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, | 439 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, |
458 GDataFileProperties* properties) OVERRIDE; | 440 GDataFileProperties* properties) OVERRIDE; |
459 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; | 441 virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; |
460 virtual FilePath GetCacheDirectoryPath( | 442 virtual FilePath GetCacheDirectoryPath( |
461 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; | 443 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; |
462 virtual FilePath GetCacheFilePath( | 444 virtual FilePath GetCacheFilePath( |
463 const std::string& resource_id, | 445 const std::string& resource_id, |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 }; | 1344 }; |
1363 | 1345 |
1364 // Sets the free disk space getter for testing. | 1346 // Sets the free disk space getter for testing. |
1365 // The existing getter is deleted. | 1347 // The existing getter is deleted. |
1366 void SetFreeDiskSpaceGetterForTesting( | 1348 void SetFreeDiskSpaceGetterForTesting( |
1367 FreeDiskSpaceGetterInterface* getter); | 1349 FreeDiskSpaceGetterInterface* getter); |
1368 | 1350 |
1369 } // namespace gdata | 1351 } // namespace gdata |
1370 | 1352 |
1371 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1353 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |