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 19f962a74ffb53341b82f68492447d7fc4f83388..b04339c4974b7de9ff4b3ad06e07d087c21bdab7 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_system_service.cc |
| +++ b/chrome/browser/chromeos/gdata/gdata_system_service.cc |
| @@ -28,17 +28,29 @@ namespace gdata { |
| //===================== GDataSystemService ==================================== |
| GDataSystemService::GDataSystemService(Profile* profile) |
| : profile_(profile), |
| + sequence_token_(BrowserThread::GetBlockingPool()->GetSequenceToken()), |
| + cache_( |
|
achuithb
2012/06/12 08:17:43
I think GDataCache creation needs to happen on the
hashimoto
2012/06/12 08:22:55
Current code creates GDataCache on the UI thread,
achuithb
2012/06/12 08:36:54
Yea - can we add back the comment and TODO then?
hashimoto
2012/06/12 08:40:51
Done.
|
| + GDataCache::CreateGDataCache(GDataCache::GetCacheRootPath(profile_), |
| + BrowserThread::GetBlockingPool(), |
| + sequence_token_)), |
| documents_service_(new DocumentsService), |
| - file_system_(new GDataFileSystem(profile, docs_service())), |
| + file_system_(new GDataFileSystem(profile, |
| + cache(), |
| + docs_service(), |
| + sequence_token_)), |
| uploader_(new GDataUploader(file_system(), docs_service())), |
| download_observer_(new GDataDownloadObserver), |
| - sync_client_(new GDataSyncClient(profile, file_system())), |
| + sync_client_(new GDataSyncClient(profile, file_system(), cache())), |
| webapps_registry_(new DriveWebAppsRegistry) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| } |
| GDataSystemService::~GDataSystemService() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(sequence_token_) |
| + ->PostTask( |
| + FROM_HERE, |
| + base::Bind(&base::DeletePointer<GDataCache>, cache_.release())); |
| } |
| void GDataSystemService::Initialize() { |
| @@ -55,7 +67,7 @@ void GDataSystemService::Initialize() { |
| download_observer_->Initialize( |
| uploader_.get(), |
| download_manager, |
| - file_system_->GetCacheDirectoryPath( |
| + cache_->GetCacheDirectoryPath( |
| GDataCache::CACHE_TYPE_TMP_DOWNLOADS)); |
| } |