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

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

Issue 10823125: Drive: add a method to clear all local cache. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_system_service.cc b/chrome/browser/chromeos/gdata/gdata_system_service.cc
index cdf10bf572e98391cd9ebc0e212f36965206f5d5..cdd1b899479069255fc0acc043271e34bfbc6b48 100644
--- a/chrome/browser/chromeos/gdata/gdata_system_service.cc
+++ b/chrome/browser/chromeos/gdata/gdata_system_service.cc
@@ -103,6 +103,21 @@ void GDataSystemService::Shutdown() {
documents_service_.reset();
}
+void GDataSystemService::ClearCacheAndResetOnUIThread() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ RemoveDriveMountPoint();
+ docs_service()->CancelAll();
+ cache_->ClearAllOnUIThread(base::Bind(&GDataSystemService::ClearCacheAndReset,
+ base::Unretained(this)
satorux1 2012/08/01 20:50:31 please use weak_ptr.
yoshiki 2012/08/01 21:44:59 Done.
+ ));
+}
+
+void GDataSystemService::ClearCacheAndReset(
satorux1 2012/08/01 20:50:31 The function name doesn't seem to match with what
yoshiki 2012/08/01 21:44:59 Done.
+ GDataFileError error, const FilePath& file_path) {
satorux1 2012/08/01 20:50:31 shouldn't we check |error|?
yoshiki 2012/08/01 21:44:59 Done.
yoshiki 2012/08/01 23:07:58 I was wrong in the patchset #2 and |error| is not
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ AddDriveMountPoint();
+}
+
void GDataSystemService::AddDriveMountPoint() {
if (!gdata::util::IsGDataAvailable(profile_))
return;

Powered by Google App Engine
This is Rietveld 408576698