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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 const GetFileCallback& callback) = 0; | 320 const GetFileCallback& callback) = 0; |
321 | 321 |
322 // Gets a file by the given |resource_id| from the gdata server. Used for | 322 // Gets a file by the given |resource_id| from the gdata server. Used for |
323 // fetching pinned-but-not-fetched files. | 323 // fetching pinned-but-not-fetched files. |
324 // | 324 // |
325 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 325 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
326 virtual void GetFileByResourceId( | 326 virtual void GetFileByResourceId( |
327 const std::string& resource_id, | 327 const std::string& resource_id, |
328 const GetFileCallback& callback) = 0; | 328 const GetFileCallback& callback) = 0; |
329 | 329 |
330 // Gets a file pointed by |gdata_file_path| from the cache. | |
331 // Upon completion, |callback| is invoked on the same thread where this method | |
332 // was called, with path if it exists and is accessible or empty FilePath | |
333 // otherwise. | |
334 virtual void GetFileFromCacheByPath( | |
335 const FilePath& gdata_file_path, | |
336 const GetFileFromCacheCallback& callback) = 0; | |
337 | |
338 // Obtains the list of currently active operations. | 330 // Obtains the list of currently active operations. |
339 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 331 virtual std::vector<GDataOperationRegistry::ProgressStatus> |
340 GetProgressStatusList() = 0; | 332 GetProgressStatusList() = 0; |
341 | 333 |
342 // Cancels ongoing operation for a given |file_path|. Returns true if | 334 // Cancels ongoing operation for a given |file_path|. Returns true if |
343 // the operation was found and canceled. | 335 // the operation was found and canceled. |
344 virtual bool CancelOperation(const FilePath& file_path) = 0; | 336 virtual bool CancelOperation(const FilePath& file_path) = 0; |
345 | 337 |
346 // Add operation observer. | 338 // Add operation observer. |
347 virtual void AddOperationObserver( | 339 virtual void AddOperationObserver( |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 const FileOperationCallback& callback) OVERRIDE; | 437 const FileOperationCallback& callback) OVERRIDE; |
446 virtual void CreateDirectory(const FilePath& directory_path, | 438 virtual void CreateDirectory(const FilePath& directory_path, |
447 bool is_exclusive, | 439 bool is_exclusive, |
448 bool is_recursive, | 440 bool is_recursive, |
449 const FileOperationCallback& callback) OVERRIDE; | 441 const FileOperationCallback& callback) OVERRIDE; |
450 virtual void GetFileByPath(const FilePath& file_path, | 442 virtual void GetFileByPath(const FilePath& file_path, |
451 const GetFileCallback& callback) OVERRIDE; | 443 const GetFileCallback& callback) OVERRIDE; |
452 virtual void GetFileByResourceId( | 444 virtual void GetFileByResourceId( |
453 const std::string& resource_id, | 445 const std::string& resource_id, |
454 const GetFileCallback& callback) OVERRIDE; | 446 const GetFileCallback& callback) OVERRIDE; |
455 virtual void GetFileFromCacheByPath( | |
456 const FilePath& gdata_file_path, | |
457 const GetFileFromCacheCallback& callback) OVERRIDE; | |
458 virtual std::vector<GDataOperationRegistry::ProgressStatus> | 447 virtual std::vector<GDataOperationRegistry::ProgressStatus> |
459 GetProgressStatusList() OVERRIDE; | 448 GetProgressStatusList() OVERRIDE; |
460 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; | 449 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; |
461 virtual void AddOperationObserver( | 450 virtual void AddOperationObserver( |
462 GDataOperationRegistry::Observer* observer) OVERRIDE; | 451 GDataOperationRegistry::Observer* observer) OVERRIDE; |
463 virtual void RemoveOperationObserver( | 452 virtual void RemoveOperationObserver( |
464 GDataOperationRegistry::Observer* observer) OVERRIDE; | 453 GDataOperationRegistry::Observer* observer) OVERRIDE; |
465 virtual void GetCacheState(const std::string& resource_id, | 454 virtual void GetCacheState(const std::string& resource_id, |
466 const std::string& md5, | 455 const std::string& md5, |
467 const GetCacheStateCallback& callback) OVERRIDE; | 456 const GetCacheStateCallback& callback) OVERRIDE; |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 }; | 1357 }; |
1369 | 1358 |
1370 // Sets the free disk space getter for testing. | 1359 // Sets the free disk space getter for testing. |
1371 // The existing getter is deleted. | 1360 // The existing getter is deleted. |
1372 void SetFreeDiskSpaceGetterForTesting( | 1361 void SetFreeDiskSpaceGetterForTesting( |
1373 FreeDiskSpaceGetterInterface* getter); | 1362 FreeDiskSpaceGetterInterface* getter); |
1374 | 1363 |
1375 } // namespace gdata | 1364 } // namespace gdata |
1376 | 1365 |
1377 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1366 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |