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

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

Issue 10800092: Database support for GDataDirectoryService. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
Index: chrome/browser/chromeos/gdata/gdata_file_system.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_file_system.cc (revision 148059)
+++ chrome/browser/chromeos/gdata/gdata_file_system.cc (working copy)
@@ -772,12 +772,14 @@
GDataFileSystem::GDataFileSystem(
Profile* profile,
GDataCache* cache,
+ GDataDirectoryService* directory_service,
DocumentsServiceInterface* documents_service,
GDataUploaderInterface* uploader,
DriveWebAppsRegistryInterface* webapps_registry,
base::SequencedTaskRunner* blocking_task_runner)
: profile_(profile),
cache_(cache),
+ directory_service_(directory_service),
uploader_(uploader),
documents_service_(documents_service),
webapps_registry_(webapps_registry),
@@ -795,8 +797,6 @@
documents_service_->Initialize(profile_);
- directory_service_.reset(new GDataDirectoryService);
-
PrefService* pref_service = profile_->GetPrefs();
hide_hosted_docs_ = pref_service->GetBoolean(prefs::kDisableGDataHostedFiles);
@@ -2139,7 +2139,7 @@
if (doc_entry.get()) {
fresh_entry.reset(
GDataEntry::FromDocumentEntry(NULL, doc_entry.get(),
- directory_service_.get()));
+ directory_service_));
}
if (!fresh_entry.get() || !fresh_entry->AsGDataFile()) {
LOG(ERROR) << "Got invalid entry from server for " << params.resource_id;
@@ -2675,7 +2675,7 @@
for (size_t i = 0; i < feed->entries().size(); ++i) {
DocumentEntry* doc = const_cast<DocumentEntry*>(feed->entries()[i]);
scoped_ptr<GDataEntry> entry(
- GDataEntry::FromDocumentEntry(NULL, doc, directory_service_.get()));
+ GDataEntry::FromDocumentEntry(NULL, doc, directory_service_));
if (!entry.get())
continue;
@@ -2992,7 +2992,7 @@
}
GDataEntry* entry = GDataEntry::FromDocumentEntry(
- directory_service_->root(), doc_entry.get(), directory_service_.get());
+ directory_service_->root(), doc_entry.get(), directory_service_);
if (!entry) {
if (!callback.is_null())
callback.Run(GDATA_FILE_ERROR_FAILED);
@@ -3493,7 +3493,7 @@
iter != feed->entries().end(); ++iter) {
DocumentEntry* doc = *iter;
GDataEntry* entry = GDataEntry::FromDocumentEntry(
- NULL, doc, directory_service_.get());
+ NULL, doc, directory_service_);
// Some document entries don't map into files (i.e. sites).
if (!entry)
continue;
@@ -3591,7 +3591,7 @@
return GDATA_FILE_ERROR_FAILED;
GDataEntry* new_entry = GDataEntry::FromDocumentEntry(
- parent_dir, doc_entry.get(), directory_service_.get());
+ parent_dir, doc_entry.get(), directory_service_);
if (!new_entry)
return GDATA_FILE_ERROR_FAILED;
@@ -3716,7 +3716,7 @@
scoped_ptr<GDataEntry> new_entry(
GDataEntry::FromDocumentEntry(
- parent_dir, entry.get(), directory_service_.get()));
+ parent_dir, entry.get(), directory_service_));
if (!new_entry.get()) {
callback.Run();
return;

Powered by Google App Engine
This is Rietveld 408576698