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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.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: Fix the memory leak. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_file_system.h
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h
index 0c82a6b385be193206198156d03090aa445120f3..cd4c4efe86bde1d01aa58803ce2597cbb93022c4 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.h
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.h
@@ -34,6 +34,7 @@ class DocumentsServiceInterface;
class DriveWebAppsRegistryInterface;
class GDataUploaderInterface;
class GDataWapiFeedLoader;
+class StaleCacheFilesRemover;
struct UploadFileInfo;
// The production implementation of GDataFileSystemInterface.
@@ -809,10 +810,6 @@ class GDataFileSystem : public GDataFileSystemInterface,
base::PlatformFileInfo* file_info,
bool* get_file_info_result);
- // All members should be accessed only on UI thread. Do not post tasks to
- // other threads with base::Unretained(this).
- scoped_ptr<GDataDirectoryService> directory_service_;
-
// The profile hosts the GDataFileSystem via GDataSystemService.
Profile* profile_;
@@ -837,12 +834,22 @@ class GDataFileSystem : public GDataFileSystemInterface,
// The set of paths opened by OpenFile but not yet closed by CloseFile.
std::set<FilePath> open_files_;
+ // Note: |observers_| should be placed before all the objects this class owns,
+ // because some of them may add themselves into the observers, so this should
+ // be constructed before them and be destructed after them.
satorux1 2012/08/21 20:57:06 Wow, that's subtle. If so, why don't you move this
satorux1 2012/08/21 21:29:06 Sorry, I misunderstood. So the observer list has t
+ ObserverList<GDataFileSystemInterface::Observer> observers_;
+
+ // All members should be accessed only on UI thread. Do not post tasks to
+ // other threads with base::Unretained(this).
+ scoped_ptr<GDataDirectoryService> directory_service_;
+
scoped_ptr<PrefChangeRegistrar> pref_registrar_;
// The loader is used to load the feeds.
scoped_ptr<GDataWapiFeedLoader> feed_loader_;
- ObserverList<GDataFileSystemInterface::Observer> observers_;
+ // The remover is used to remove stale cache files.
+ scoped_ptr<StaleCacheFilesRemover> stale_cache_files_remover_;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698