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_CACHE_METADATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 typedef std::map<std::string, GDataCacheEntry> CacheMap; | 30 typedef std::map<std::string, GDataCacheEntry> CacheMap; |
| 31 | 31 |
| 32 virtual ~GDataCacheMetadata(); | 32 virtual ~GDataCacheMetadata(); |
| 33 | 33 |
| 34 // |pool| and |sequence_token| are used to assert that the functions are | 34 // |pool| and |sequence_token| are used to assert that the functions are |
| 35 // called on the right sequenced worker pool with the right sequence token. | 35 // called on the right sequenced worker pool with the right sequence token. |
| 36 // | 36 // |
| 37 // For testing, the thread assertion can be disabled by passing NULL and | 37 // For testing, the thread assertion can be disabled by passing NULL and |
| 38 // the default value of SequenceToken. | 38 // the default value of SequenceToken. |
| 39 static scoped_ptr<GDataCacheMetadata> CreateGDataCacheMetadata( | 39 static scoped_ptr<GDataCacheMetadata> CreateGDataCacheMetadata( |
| 40 base::SequencedTaskRunner* blocking_task_runner); | 40 base::SequencedTaskRunner* blocking_task_runner, bool use_map); |
|
kochi
2012/08/06 09:02:17
We prefer enum to boolean for function arguments.
Haruki Sato
2012/08/08 05:00:42
Thank you for the advice.
Removed the argument and
| |
| 41 | 41 |
| 42 // Initialize the cache metadata store. | 42 // Initialize the cache metadata store. |
| 43 virtual void Initialize(const std::vector<FilePath>& cache_paths) = 0; | 43 virtual void Initialize(const std::vector<FilePath>& cache_paths) = 0; |
| 44 // Adds a new cache entry corresponding to |resource_id| if it doesn't | 44 // Adds a new cache entry corresponding to |resource_id| if it doesn't |
| 45 // exist, otherwise update the existing entry. | 45 // exist, otherwise update the existing entry. |
| 46 virtual void AddOrUpdateCacheEntry(const std::string& resource_id, | 46 virtual void AddOrUpdateCacheEntry(const std::string& resource_id, |
| 47 const GDataCacheEntry& cache_entry) = 0; | 47 const GDataCacheEntry& cache_entry) = 0; |
| 48 | 48 |
| 49 // Removes entry corresponding to |resource_id| from cache map. | 49 // Removes entry corresponding to |resource_id| from cache map. |
| 50 virtual void RemoveCacheEntry(const std::string& resource_id) = 0; | 50 virtual void RemoveCacheEntry(const std::string& resource_id) = 0; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 80 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(GDataCacheMetadata); | 82 DISALLOW_COPY_AND_ASSIGN(GDataCacheMetadata); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace gdata | 85 } // namespace gdata |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ | 87 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ |
| OLD | NEW |