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

Unified Diff: mount.h

Issue 6598074: DoAutomaticFreeDiskSpaceControl() introduced (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cryptohome.git@master
Patch Set: Created 9 years, 10 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 | « mock_platform.h ('k') | mount.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mount.h
diff --git a/mount.h b/mount.h
index 294834097a4f392186d3c44c11cb6a32f323f245..4c5b887e3753a80bde99e7c8298ea46e4d302630 100644
--- a/mount.h
+++ b/mount.h
@@ -40,6 +40,9 @@ extern const std::string kIncognitoUser;
extern const char* kCacheDir;
extern const char* kDownloadsDir;
+// Minimum free disk space on stateful_partition not to begin the cleanup
+const int64 kMinFreeSpace = 500 * 1LL << 20; // 500M bytes
+
// The Mount class handles mounting/unmounting of the user's cryptohome
// directory as well as offline verification of the user's credentials against
@@ -144,6 +147,10 @@ class Mount : public EntropySource {
// Cleans (removes) content from unmounted tracked subdirectories
virtual void CleanUnmountedTrackedSubdirectories() const;
+ // Checks free disk space and if it falls below minimum
+ // (kMinFreeSpace), performs cleanup
+ virtual void DoAutomaticFreeDiskSpaceControl() const;
+
// Tests if the given credentials would decrypt the user's cryptohome key
//
// Parameters
@@ -372,6 +379,13 @@ class Mount : public EntropySource {
std::string GetUserVaultPath(const Credentials& credentials) const;
private:
+ // Invokes given callback for every unmounted cryptohome
+ //
+ // Parameters
+ // callback - routine to invoke.
+ typedef void (*CryptohomeCallback)(const FilePath&);
+ void DoForEveryUnmountedCryptohome(CryptohomeCallback callback) const;
+
// Same as MountCryptohome but specifies if the cryptohome directory should be
// recreated on a fatal error
//
« no previous file with comments | « mock_platform.h ('k') | mount.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698