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

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache.h

Issue 10698135: Revert 145933 - gdata: Remove sub_dir_type from CacheEntry for simplicity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_cache.h
===================================================================
--- chrome/browser/chromeos/gdata/gdata_cache.h (revision 145940)
+++ chrome/browser/chromeos/gdata/gdata_cache.h (working copy)
@@ -80,12 +80,11 @@
// This is used as a bitmask for the cache state.
enum CacheState {
- CACHE_STATE_NONE = 0x0,
- CACHE_STATE_PINNED = 0x1 << 0,
- CACHE_STATE_PRESENT = 0x1 << 1,
- CACHE_STATE_DIRTY = 0x1 << 2,
- CACHE_STATE_MOUNTED = 0x1 << 3,
- CACHE_STATE_PERSISTENT = 0x1 << 4,
+ CACHE_STATE_NONE = 0x0,
+ CACHE_STATE_PINNED = 0x1 << 0,
+ CACHE_STATE_PRESENT = 0x1 << 1,
+ CACHE_STATE_DIRTY = 0x1 << 2,
+ CACHE_STATE_MOUNTED = 0x1 << 3,
};
// Enum defining origin of a cached file.
@@ -121,29 +120,27 @@
// Structure to store information of an existing cache file.
struct CacheEntry {
- CacheEntry() : cache_state(0) {}
+ CacheEntry() : sub_dir_type(CACHE_TYPE_META),
+ cache_state(0) {}
CacheEntry(const std::string& md5,
+ CacheSubDirectoryType sub_dir_type,
int cache_state)
: md5(md5),
+ sub_dir_type(sub_dir_type),
cache_state(cache_state) {
}
bool IsPresent() const { return IsCachePresent(cache_state); }
bool IsPinned() const { return IsCachePinned(cache_state); }
bool IsDirty() const { return IsCacheDirty(cache_state); }
- bool IsMounted() const { return IsCacheMounted(cache_state); }
- bool IsPersistent() const { return IsCachePersistent(cache_state); }
+ bool IsMounted() const { return IsCacheMounted(cache_state); }
- // Returns the type of the sub directory where the cache file is stored.
- CacheSubDirectoryType GetSubDirectoryType() const {
- return IsPersistent() ? CACHE_TYPE_PERSISTENT : CACHE_TYPE_TMP;
- }
-
// For debugging purposes.
std::string ToString() const;
std::string md5;
+ CacheSubDirectoryType sub_dir_type;
int cache_state;
};
@@ -169,9 +166,6 @@
static bool IsCacheMounted(int cache_state) {
return cache_state & CACHE_STATE_MOUNTED;
}
- static bool IsCachePersistent(int cache_state) {
- return cache_state & CACHE_STATE_PERSISTENT;
- }
static int SetCachePresent(int cache_state) {
return cache_state |= CACHE_STATE_PRESENT;
}
@@ -184,9 +178,6 @@
static int SetCacheMounted(int cache_state) {
return cache_state |= CACHE_STATE_MOUNTED;
}
- static int SetCachePersistent(int cache_state) {
- return cache_state |= CACHE_STATE_PERSISTENT;
- }
static int ClearCachePresent(int cache_state) {
return cache_state &= ~CACHE_STATE_PRESENT;
}
@@ -199,9 +190,6 @@
static int ClearCacheMounted(int cache_state) {
return cache_state &= ~CACHE_STATE_MOUNTED;
}
- static int ClearCachePersistent(int cache_state) {
- return cache_state &= ~CACHE_STATE_PERSISTENT;
- }
// Returns the sub-directory under gdata cache directory for the given sub
// directory type. Example: <user_profile_dir>/GCache/v1/tmp
@@ -480,13 +468,6 @@
bool* success,
GDataCache::CacheEntry* cache_entry);
- // Wrapper around GDataCacheMetadata::UpdateCache(). This function takes
- // |sub_dir_type| and modifies |cache_state| per the sub directory type.
- void UpdateCacheWithSubDirectoryType(const std::string& resource_id,
- const std::string& md5,
- CacheSubDirectoryType sub_dir_type,
- int cache_state);
-
// The root directory of the cache (i.e. <user_profile_dir>/GCache/v1).
const FilePath cache_root_path_;
// Paths for all subdirectories of GCache, one for each
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698