| 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..a6ea60f3085694726c4b8b2438046812d9e2cc73 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_system_service.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_system_service.cc
|
| @@ -39,7 +39,8 @@ const std::string* g_test_cache_root = NULL;
|
|
|
| GDataSystemService::GDataSystemService(Profile* profile)
|
| : profile_(profile),
|
| - cache_(NULL) {
|
| + cache_(NULL),
|
| + ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| base::SequencedWorkerPool* blocking_pool = BrowserThread::GetBlockingPool();
|
| blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner(
|
| @@ -103,6 +104,30 @@ void GDataSystemService::Shutdown() {
|
| documents_service_.reset();
|
| }
|
|
|
| +void GDataSystemService::ClearCacheAndRemountFileSystem(
|
| + const base::Callback<void(bool)>& callback) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| +
|
| + RemoveDriveMountPoint();
|
| + docs_service()->CancelAll();
|
| + cache_->ClearAllOnUIThread(
|
| + base::Bind(&GDataSystemService::AddBackDriveMountPoint,
|
| + weak_ptr_factory_.GetWeakPtr(),
|
| + callback));
|
| +}
|
| +
|
| +void GDataSystemService::AddBackDriveMountPoint(
|
| + const base::Callback<void(bool)>& callback,
|
| + GDataFileError error,
|
| + const FilePath& file_path) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| +
|
| + AddDriveMountPoint();
|
| +
|
| + if (!callback.is_null())
|
| + callback.Run(error == GDATA_FILE_OK);
|
| +}
|
| +
|
| void GDataSystemService::AddDriveMountPoint() {
|
| if (!gdata::util::IsGDataAvailable(profile_))
|
| return;
|
|
|