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

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

Issue 10546093: gdata: Move ownership of GDataCache to GDataSystemService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO Created 8 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_system_service.h ('k') | chrome/browser/chromeos/gdata/gdata_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0ddc049c715c6cb39994fded4ffa4aa5ebd25c01 100644
--- a/chrome/browser/chromeos/gdata/gdata_system_service.cc
+++ b/chrome/browser/chromeos/gdata/gdata_system_service.cc
@@ -28,17 +28,30 @@ namespace gdata {
//===================== GDataSystemService ====================================
GDataSystemService::GDataSystemService(Profile* profile)
: profile_(profile),
+ sequence_token_(BrowserThread::GetBlockingPool()->GetSequenceToken()),
+ // TODO(hashimoto): Create cache_ on the blocking pool. crbug.com/131756
+ cache_(
+ 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 +68,7 @@ void GDataSystemService::Initialize() {
download_observer_->Initialize(
uploader_.get(),
download_manager,
- file_system_->GetCacheDirectoryPath(
+ cache_->GetCacheDirectoryPath(
GDataCache::CACHE_TYPE_TMP_DOWNLOADS));
}
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_system_service.h ('k') | chrome/browser/chromeos/gdata/gdata_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698