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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 const std::string& resource_id, | 468 const std::string& resource_id, |
469 const std::string& md5, | 469 const std::string& md5, |
470 const CacheOperationCallback& callback); | 470 const CacheOperationCallback& callback); |
471 | 471 |
472 // Helper function to implement GetCacheEntryOnUIThread(). | 472 // Helper function to implement GetCacheEntryOnUIThread(). |
473 void GetCacheEntryHelper(const std::string& resource_id, | 473 void GetCacheEntryHelper(const std::string& resource_id, |
474 const std::string& md5, | 474 const std::string& md5, |
475 bool* success, | 475 bool* success, |
476 GDataCache::CacheEntry* cache_entry); | 476 GDataCache::CacheEntry* cache_entry); |
477 | 477 |
478 // Wrapper around GDataCacheMetadata::UpdateCache(). This function takes | |
479 // |sub_dir_type| and updates the cache per |cache_entry| and |sub_dir_type|. | |
480 void UpdateCacheWithSubDirectoryType( | |
481 const std::string& resource_id, | |
482 CacheSubDirectoryType sub_dir_type, | |
483 const CacheEntry& cache_entry); | |
484 | |
485 // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1). | 478 // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1). |
486 const FilePath cache_root_path_; | 479 const FilePath cache_root_path_; |
487 // Paths for all subdirectories of GCache, one for each | 480 // Paths for all subdirectories of GCache, one for each |
488 // GDataCache::CacheSubDirectoryType enum. | 481 // GDataCache::CacheSubDirectoryType enum. |
489 const std::vector<FilePath> cache_paths_; | 482 const std::vector<FilePath> cache_paths_; |
490 base::SequencedWorkerPool* pool_; | 483 base::SequencedWorkerPool* pool_; |
491 const base::SequencedWorkerPool::SequenceToken sequence_token_; | 484 const base::SequencedWorkerPool::SequenceToken sequence_token_; |
492 | 485 |
493 // The cache state data. This member must be access only on the blocking pool. | 486 // The cache state data. This member must be access only on the blocking pool. |
494 scoped_ptr<GDataCacheMetadata> metadata_; | 487 scoped_ptr<GDataCacheMetadata> metadata_; |
(...skipping 25 matching lines...) Expand all Loading... |
520 }; | 513 }; |
521 | 514 |
522 // Sets the free disk space getter for testing. | 515 // Sets the free disk space getter for testing. |
523 // The existing getter is deleted. | 516 // The existing getter is deleted. |
524 void SetFreeDiskSpaceGetterForTesting( | 517 void SetFreeDiskSpaceGetterForTesting( |
525 FreeDiskSpaceGetterInterface* getter); | 518 FreeDiskSpaceGetterInterface* getter); |
526 | 519 |
527 } // namespace gdata | 520 } // namespace gdata |
528 | 521 |
529 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 522 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
OLD | NEW |