Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_cache_metadata.h

Issue 10830181: Implement initialization for GDataCache to use in-memory metadata for tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 'ForTesting' versions. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 IterateCallback; 27 IterateCallback;
28 28
29 // A map table of cache file's resource id to its CacheEntry* entry. 29 // A map table of cache file's resource id to its CacheEntry* entry.
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
achuithb 2012/08/08 05:07:31 Is this comment still valid?
Haruki Sato 2012/08/08 05:57:38 Seems like it's no longer valid. Replaced.
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);
41 41
42 static scoped_ptr<GDataCacheMetadata> CreateGDataCacheMetadataForTesting(
achuithb 2012/08/08 05:07:31 Add a function comment please.
Haruki Sato 2012/08/08 05:57:38 Done. Thanks!
43 base::SequencedTaskRunner* blocking_task_runner);
44
42 // Initialize the cache metadata store. 45 // Initialize the cache metadata store.
43 virtual void Initialize(const std::vector<FilePath>& cache_paths) = 0; 46 virtual void Initialize(const std::vector<FilePath>& cache_paths) = 0;
44 // Adds a new cache entry corresponding to |resource_id| if it doesn't 47 // Adds a new cache entry corresponding to |resource_id| if it doesn't
45 // exist, otherwise update the existing entry. 48 // exist, otherwise update the existing entry.
46 virtual void AddOrUpdateCacheEntry(const std::string& resource_id, 49 virtual void AddOrUpdateCacheEntry(const std::string& resource_id,
47 const GDataCacheEntry& cache_entry) = 0; 50 const GDataCacheEntry& cache_entry) = 0;
48 51
49 // Removes entry corresponding to |resource_id| from cache map. 52 // Removes entry corresponding to |resource_id| from cache map.
50 virtual void RemoveCacheEntry(const std::string& resource_id) = 0; 53 virtual void RemoveCacheEntry(const std::string& resource_id) = 0;
51 54
(...skipping 26 matching lines...) Expand all
78 81
79 private: 82 private:
80 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 83 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
81 84
82 DISALLOW_COPY_AND_ASSIGN(GDataCacheMetadata); 85 DISALLOW_COPY_AND_ASSIGN(GDataCacheMetadata);
83 }; 86 };
84 87
85 } // namespace gdata 88 } // namespace gdata
86 89
87 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_ 90 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_METADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698