Chromium Code Reviews| 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..f1a8e97c9cdfdfe34c8b9cdfecbe79e058fee3fe 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), |
| + weak_ptr_factory_(this) { |
|
satorux1
2012/08/01 21:56:31
ALLOW_THIS_IN_INITIALIZER_LISt
yoshiki
2012/08/01 23:07:59
Done.
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| base::SequencedWorkerPool* blocking_pool = BrowserThread::GetBlockingPool(); |
| blocking_task_runner_ = blocking_pool->GetSequencedTaskRunner( |
| @@ -103,6 +104,22 @@ void GDataSystemService::Shutdown() { |
| documents_service_.reset(); |
| } |
| +void GDataSystemService::ClearCacheAndResetOnUIThread() { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
|
satorux1
2012/08/01 21:56:31
add a blank like after DCHECK
yoshiki
2012/08/01 23:07:59
Done.
|
| + RemoveDriveMountPoint(); |
| + docs_service()->CancelAll(); |
| + cache_->ClearAllOnUIThread( |
| + base::Bind(&GDataSystemService::AddBackDrivemountPoint, |
| + weak_ptr_factory_.GetWeakPtr())); |
| +} |
| + |
| +void GDataSystemService::AddBackDrivemountPoint( |
| + GDataFileError error, const FilePath& file_path) { |
| + DCHECK(error); |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
|
satorux1
2012/08/01 21:56:31
please swap the order of DCHECKs, and add a blank
yoshiki
2012/08/01 23:07:59
Done.
|
| + AddDriveMountPoint(); |
| +} |
| + |
| void GDataSystemService::AddDriveMountPoint() { |
| if (!gdata::util::IsGDataAvailable(profile_)) |
| return; |