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

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

Issue 10823125: Drive: add a method to clear all local cache. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review fix (comment #12) 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/gdata_system_service.h
diff --git a/chrome/browser/chromeos/gdata/gdata_system_service.h b/chrome/browser/chromeos/gdata/gdata_system_service.h
index 070fa7718f69a685734624768f5d04ef599ca758..3364f20fa6b5313c133bdc15801cbcb968532c4c 100644
--- a/chrome/browser/chromeos/gdata/gdata_system_service.h
+++ b/chrome/browser/chromeos/gdata/gdata_system_service.h
@@ -9,7 +9,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/chromeos/gdata/gdata_errorcode.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
@@ -41,6 +43,11 @@ class GDataSystemService : public ProfileKeyedService {
GDataContactsService* contacts_service() { return contacts_service_.get(); }
DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); }
+ // Clears all the local cache files and in-memory data, and remounts the file
+ // system.
+ void ClearCacheAndRemountFileSystem(
+ const base::Callback<void(bool)>& callback);
+
// ProfileKeyedService override:
virtual void Shutdown() OVERRIDE;
@@ -58,6 +65,11 @@ class GDataSystemService : public ProfileKeyedService {
// Unregisters drive mount point from File API.
void RemoveDriveMountPoint();
+ // Adds back the drive mount point. Used to implement ClearCache().
+ void AddBackDriveMountPoint(const base::Callback<void(bool)>& callback,
+ GDataFileError error,
+ const FilePath& file_path);
+
friend class GDataSystemServiceFactory;
Profile* profile_;
@@ -70,6 +82,7 @@ class GDataSystemService : public ProfileKeyedService {
scoped_ptr<GDataDownloadObserver> download_observer_;
scoped_ptr<GDataSyncClient> sync_client_;
scoped_ptr<GDataContactsService> contacts_service_;
+ base::WeakPtrFactory<GDataSystemService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(GDataSystemService);
};
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache_unittest.cc ('k') | chrome/browser/chromeos/gdata/gdata_system_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698