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

Side by Side Diff: chrome/browser/chromeos/drive/file_cache.h

Issue 54223003: drive: Recover cache entries from trashed DB to filter out non-dirty cache files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
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_DRIVE_FILE_CACHE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Initializes the cache. Returns true on success. 150 // Initializes the cache. Returns true on success.
151 bool Initialize(); 151 bool Initialize();
152 152
153 // Destroys this cache. This function posts a task to the blocking task 153 // Destroys this cache. This function posts a task to the blocking task
154 // runner to safely delete the object. 154 // runner to safely delete the object.
155 // Must be called on the UI thread. 155 // Must be called on the UI thread.
156 void Destroy(); 156 void Destroy();
157 157
158 // Moves files in the cache directory which are not manged by FileCache to 158 // Moves files in the cache directory which are not manged by FileCache to
159 // |dest_directory|. 159 // |dest_directory|.
160 bool RecoverFilesFromCacheDirectory(const base::FilePath& dest_directory); 160 // |recovered_cache_entries| should contain cache entries recovered from the
161 // trashed metadata DB. It is used to ignore non-dirty files.
162 bool RecoverFilesFromCacheDirectory(
163 const base::FilePath& dest_directory,
164 const std::map<std::string, FileCacheEntry>& recovered_cache_entries);
161 165
162 private: 166 private:
163 friend class FileCacheTest; 167 friend class FileCacheTest;
164 friend class FileCacheTestOnUIThread; 168 friend class FileCacheTestOnUIThread;
165 169
166 ~FileCache(); 170 ~FileCache();
167 171
168 // Returns absolute path of the file if it were cached or to be cached. 172 // Returns absolute path of the file if it were cached or to be cached.
169 // 173 //
170 // Can be called on any thread. 174 // Can be called on any thread.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // this value. 222 // this value.
219 // 223 //
220 // Copied from cryptohome/homedirs.h. 224 // Copied from cryptohome/homedirs.h.
221 // TODO(satorux): Share the constant. 225 // TODO(satorux): Share the constant.
222 const int64 kMinFreeSpace = 512 * 1LL << 20; 226 const int64 kMinFreeSpace = 512 * 1LL << 20;
223 227
224 } // namespace internal 228 } // namespace internal
225 } // namespace drive 229 } // namespace drive
226 230
227 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_ 231 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/drive_integration_service.cc ('k') | chrome/browser/chromeos/drive/file_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698