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_CACHE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 const std::string& md5, | 475 const std::string& md5, |
476 const CacheOperationCallback& callback); | 476 const CacheOperationCallback& callback); |
477 | 477 |
478 // Helper function to implement GetCacheEntryOnUIThread(). | 478 // Helper function to implement GetCacheEntryOnUIThread(). |
479 void GetCacheEntryHelper(const std::string& resource_id, | 479 void GetCacheEntryHelper(const std::string& resource_id, |
480 const std::string& md5, | 480 const std::string& md5, |
481 bool* success, | 481 bool* success, |
482 GDataCache::CacheEntry* cache_entry); | 482 GDataCache::CacheEntry* cache_entry); |
483 | 483 |
484 // Wrapper around GDataCacheMetadata::UpdateCache(). This function takes | 484 // Wrapper around GDataCacheMetadata::UpdateCache(). This function takes |
485 // |sub_dir_type| and modifies |cache_state| per the sub directory type. | 485 // |sub_dir_type| and updates the cache per |cache_entry| and |sub_dir_type|. |
486 void UpdateCacheWithSubDirectoryType(const std::string& resource_id, | 486 void UpdateCacheWithSubDirectoryType( |
487 const std::string& md5, | 487 const std::string& resource_id, |
488 CacheSubDirectoryType sub_dir_type, | 488 CacheSubDirectoryType sub_dir_type, |
489 int cache_state); | 489 const CacheEntry& cache_entry); |
490 | 490 |
491 // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1). | 491 // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1). |
492 const FilePath cache_root_path_; | 492 const FilePath cache_root_path_; |
493 // Paths for all subdirectories of GCache, one for each | 493 // Paths for all subdirectories of GCache, one for each |
494 // GDataCache::CacheSubDirectoryType enum. | 494 // GDataCache::CacheSubDirectoryType enum. |
495 const std::vector<FilePath> cache_paths_; | 495 const std::vector<FilePath> cache_paths_; |
496 base::SequencedWorkerPool* pool_; | 496 base::SequencedWorkerPool* pool_; |
497 const base::SequencedWorkerPool::SequenceToken sequence_token_; | 497 const base::SequencedWorkerPool::SequenceToken sequence_token_; |
498 | 498 |
499 // The cache state data. This member must be access only on the blocking pool. | 499 // The cache state data. This member must be access only on the blocking pool. |
(...skipping 26 matching lines...) Expand all Loading... |
526 }; | 526 }; |
527 | 527 |
528 // Sets the free disk space getter for testing. | 528 // Sets the free disk space getter for testing. |
529 // The existing getter is deleted. | 529 // The existing getter is deleted. |
530 void SetFreeDiskSpaceGetterForTesting( | 530 void SetFreeDiskSpaceGetterForTesting( |
531 FreeDiskSpaceGetterInterface* getter); | 531 FreeDiskSpaceGetterInterface* getter); |
532 | 532 |
533 } // namespace gdata | 533 } // namespace gdata |
534 | 534 |
535 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 535 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
OLD | NEW |