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

Issue 10823125: Drive: add a method to clear all local cache. (Closed)

Created:
8 years, 4 months ago by yoshiki
Modified:
8 years, 4 months ago
Reviewers:
satorux1
CC:
chromium-reviews, achuith+watch_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Drive: add a method to clear all local cache. Mainly, this cl add the two methods to clear cache. 1) GDataCache::ClearAllOnUIThread(): - remove all the files in the cache directory. - re-create the |metadata_| instance. 2) GDataSystemService::ClearCacheAndReset(): - unmount Drive - cancel all the running tasks. - call GDataCache::ClearAllOnUIThread() - re-mount Drive BUG=135197 TEST=out/Debug/unit_tests:GData* and out/Debug/browser_tests:GData* passes. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=149914

Patch Set 1 #

Total comments: 17

Patch Set 2 : review fix #

Total comments: 14

Patch Set 3 : Fix reviews and remove back the DCHECK in AddBackDrivemountPoint(). #

Total comments: 6

Patch Set 4 : review fix #

Patch Set 5 : rebase #

Patch Set 6 : Fix wrong condition. #

Total comments: 4

Patch Set 7 : review fix (comment #12) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -30 lines) Patch
M chrome/browser/chromeos/extensions/file_browser_event_router.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/gdata/gdata_cache.h View 1 2 3 4 4 chunks +12 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_cache.cc View 1 2 3 4 5 6 5 chunks +32 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_cache_unittest.cc View 1 4 chunks +65 lines, -19 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_system_service.h View 1 2 3 4 5 6 4 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/gdata/gdata_system_service.cc View 1 2 3 4 5 6 2 chunks +26 lines, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
yoshiki
satorux: could you take a look? This CL is one of 4 patches (maybe) to ...
8 years, 4 months ago (2012-08-01 20:28:51 UTC) #1
yoshiki
satorux: could you take a look? This CL is one of 4 patches (maybe) to ...
8 years, 4 months ago (2012-08-01 20:28:51 UTC) #2
satorux1
thank you for working on this! http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_cache.h File chrome/browser/chromeos/gdata/gdata_cache.h (right): http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_cache.h#newcode269 chrome/browser/chromeos/gdata/gdata_cache.h:269: void ClearAllOnUIThread(const SetMountedStateCallback& ...
8 years, 4 months ago (2012-08-01 20:50:30 UTC) #3
yoshiki
Thanks, PTAL? http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_cache.h File chrome/browser/chromeos/gdata/gdata_cache.h (right): http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_cache.h#newcode269 chrome/browser/chromeos/gdata/gdata_cache.h:269: void ClearAllOnUIThread(const SetMountedStateCallback& callback); On 2012/08/01 20:50:31, ...
8 years, 4 months ago (2012-08-01 21:44:59 UTC) #4
yoshiki
Thanks, PTAL?
8 years, 4 months ago (2012-08-01 21:44:59 UTC) #5
satorux1
https://chromiumcodereview.appspot.com/10823125/diff/12003/chrome/browser/chromeos/gdata/gdata_cache.cc File chrome/browser/chromeos/gdata/gdata_cache.cc (right): https://chromiumcodereview.appspot.com/10823125/diff/12003/chrome/browser/chromeos/gdata/gdata_cache.cc#newcode242 chrome/browser/chromeos/gdata/gdata_cache.cc:242: void RunSetMountedStateCallback(const ChangeCacheStateCallback& callback, Please rename this function. please ...
8 years, 4 months ago (2012-08-01 21:56:30 UTC) #6
yoshiki
PTAL. http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_system_service.cc File chrome/browser/chromeos/gdata/gdata_system_service.cc (right): http://codereview.chromium.org/10823125/diff/1/chrome/browser/chromeos/gdata/gdata_system_service.cc#newcode116 chrome/browser/chromeos/gdata/gdata_system_service.cc:116: GDataFileError error, const FilePath& file_path) { On 2012/08/01 ...
8 years, 4 months ago (2012-08-01 23:07:58 UTC) #7
satorux1
http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc File chrome/browser/chromeos/gdata/gdata_cache.cc (right): http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc#newcode1456 chrome/browser/chromeos/gdata/gdata_cache.cc:1456: DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); Add this instead: AssertOnSequencedWorkerPool(); http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_system_service.cc File chrome/browser/chromeos/gdata/gdata_system_service.cc (right): ...
8 years, 4 months ago (2012-08-02 01:03:20 UTC) #8
satorux1
http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc File chrome/browser/chromeos/gdata/gdata_cache.cc (right): http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc#newcode1459 chrome/browser/chromeos/gdata/gdata_cache.cc:1459: file_util::Delete(cache_root_path_, true); Check the return value?
8 years, 4 months ago (2012-08-02 01:04:23 UTC) #9
yoshiki
http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc File chrome/browser/chromeos/gdata/gdata_cache.cc (right): http://codereview.chromium.org/10823125/diff/14002/chrome/browser/chromeos/gdata/gdata_cache.cc#newcode1456 chrome/browser/chromeos/gdata/gdata_cache.cc:1456: DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); On 2012/08/02 01:03:21, satorux1 wrote: > Add this ...
8 years, 4 months ago (2012-08-02 07:12:11 UTC) #10
yoshiki
PTAL
8 years, 4 months ago (2012-08-03 07:15:24 UTC) #11
satorux1
LGTM with nits http://codereview.chromium.org/10823125/diff/6011/chrome/browser/chromeos/gdata/gdata_cache.cc File chrome/browser/chromeos/gdata/gdata_cache.cc (right): http://codereview.chromium.org/10823125/diff/6011/chrome/browser/chromeos/gdata/gdata_cache.cc#newcode1462 chrome/browser/chromeos/gdata/gdata_cache.cc:1462: *error = GDATA_FILE_OK; *error = success ...
8 years, 4 months ago (2012-08-03 17:17:31 UTC) #12
yoshiki
8 years, 4 months ago (2012-08-03 18:23:15 UTC) #13
Thanks! I'm going to check-in this after trybots success.

https://chromiumcodereview.appspot.com/10823125/diff/6011/chrome/browser/chro...
File chrome/browser/chromeos/gdata/gdata_cache.cc (right):

https://chromiumcodereview.appspot.com/10823125/diff/6011/chrome/browser/chro...
chrome/browser/chromeos/gdata/gdata_cache.cc:1462: *error = GDATA_FILE_OK;
On 2012/08/03 17:17:31, satorux1 wrote:
> *error = success ? GDATA_FILE_OK : GDATA_FILE_ERROR_FAILED

Done.

https://chromiumcodereview.appspot.com/10823125/diff/6011/chrome/browser/chro...
File chrome/browser/chromeos/gdata/gdata_system_service.h (right):

https://chromiumcodereview.appspot.com/10823125/diff/6011/chrome/browser/chro...
chrome/browser/chromeos/gdata/gdata_system_service.h:48: void ClearCache(const
base::Callback<void(bool)>& callback);
On 2012/08/03 17:17:31, satorux1 wrote:
> I changed my mind. I think we should give it a more descriptive name.
> 
> // Clears all the local cache files and in-memory data, and remounts
> // the file system.
> ClearCacheAndRemountFileSystem()

Done.

Powered by Google App Engine
This is Rietveld 408576698