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

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

Issue 10832241: Drive: Removes unused cache files after the initial feed fetch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding scoped_ptr<StaleCacheFilesRemover> to GDataFileSystem 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/stale_cache_files_remover.h
diff --git a/chrome/browser/chromeos/gdata/stale_cache_files_remover.h b/chrome/browser/chromeos/gdata/stale_cache_files_remover.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed8d2df3455eb357139b5fccec923adc2292a7d2
--- /dev/null
+++ b/chrome/browser/chromeos/gdata/stale_cache_files_remover.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_GDATA_STALE_CACHE_FILE_REMOVER_H_
+#define CHROME_BROWSER_CHROMEOS_GDATA_STALE_CACHE_FILE_REMOVER_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h"
+
+namespace gdata{
+
+class GDataCache;
+class GDataFileSystem;
+
+// This class removes slace cache files, which are existed as file but are no
satorux1 2012/08/14 17:19:37 maybe // This class removes stale cache files, w
yoshiki 2012/08/16 07:39:56 Done.
+// longer used. Such files are happened when the file has been deleted on the
+// other client.
+class StaleCacheFilesRemover {
+ public:
+ StaleCacheFilesRemover(GDataFileSystemInterface* file_system,
+ GDataCache* cache);
+ virtual ~StaleCacheFilesRemover();
+
+ // Removes slate cache files. The execution is delayed so the actual removal
satorux1 2012/08/14 17:19:37 stale
yoshiki 2012/08/16 07:39:56 Done.
+ // starts several (|kDelaySeconds| in slate_cache_file_remover.cc) seconds
satorux1 2012/08/14 17:19:37 Let's remove the delay. I think it's simpler not t
yoshiki 2012/08/16 07:39:56 Done.
+ // after this method is called.
+ void Start();
+
+ private:
+ void RemoveSlateCacheFiles();
satorux1 2012/08/14 17:19:37 stale
yoshiki 2012/08/16 07:39:56 Done.
+ void OnGetResourceIdsOfAllFiles(const std::vector<std::string>& resource_ids);
satorux1 2012/08/14 17:19:37 function comments missing.
yoshiki 2012/08/16 07:39:56 Done.
+
+ GDataFileSystemInterface* file_system_;
satorux1 2012/08/14 17:19:37 GDataFileSystemInterface* file_system_; // Not ow
yoshiki 2012/08/16 07:39:56 Done.
+ GDataCache* cache_;
satorux1 2012/08/14 17:19:37 ditto.
yoshiki 2012/08/16 07:39:56 Done.
+
+ base::WeakPtrFactory<StaleCacheFilesRemover> weak_ptr_factory_;
satorux1 2012/08/14 17:19:37 please add // Note: This should remain the las
yoshiki 2012/08/16 07:39:56 Done.
+ DISALLOW_COPY_AND_ASSIGN(StaleCacheFilesRemover);
+};
+
+} // namespace gdata
+
+#endif // CHROME_BROWSER_CHROMEOS_GDATA_STALE_CACHE_FILE_REMOVER_H_

Powered by Google App Engine
This is Rietveld 408576698