Index: chrome/browser/chromeos/drive/change_list_loader.cc |
diff --git a/chrome/browser/chromeos/drive/change_list_loader.cc b/chrome/browser/chromeos/drive/change_list_loader.cc |
index 3a92b5b100347d716e989300d1dba7ad7d9a71ad..7dad6b45d877a9bf32233d9968a138342bde61b8 100644 |
--- a/chrome/browser/chromeos/drive/change_list_loader.cc |
+++ b/chrome/browser/chromeos/drive/change_list_loader.cc |
@@ -33,8 +33,6 @@ namespace { |
const base::FilePath::CharType kFilesystemProtoFile[] = |
FILE_PATH_LITERAL("file_system.pb"); |
-const base::FilePath::CharType kResourceMetadataDBFile[] = |
- FILE_PATH_LITERAL("resource_metadata.db"); |
// Update the fetch progress UI per every this number of feeds. |
const int kFetchUiUpdateStep = 10; |
@@ -107,11 +105,6 @@ void SaveProtoOnBlockingPool(const base::FilePath& path, |
} |
} |
-bool UseLevelDB() { |
- // TODO(achuith): Re-enable this. |
- return false; |
-} |
- |
// Parses a google_apis::ResourceList from |data|. |
scoped_ptr<google_apis::ResourceList> ParseFeedOnBlockingPool( |
scoped_ptr<base::Value> data) { |
@@ -617,25 +610,16 @@ void ChangeListLoader::LoadFromCache(const FileOperationCallback& callback) { |
LoadRootFeedParams* params = new LoadRootFeedParams(callback); |
base::FilePath path = |
- cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META); |
- if (UseLevelDB()) { |
- path = path.Append(kResourceMetadataDBFile); |
- resource_metadata_->InitFromDB(path, blocking_task_runner_, |
- base::Bind( |
- &ChangeListLoader::ContinueWithInitializedResourceMetadata, |
- weak_ptr_factory_.GetWeakPtr(), |
- base::Owned(params))); |
- } else { |
- path = path.Append(kFilesystemProtoFile); |
- base::PostTaskAndReplyWithResult( |
- BrowserThread::GetBlockingPool(), |
- FROM_HERE, |
- base::Bind(&LoadProtoOnBlockingPool, |
- path, ¶ms->last_modified, ¶ms->proto), |
- base::Bind(&ChangeListLoader::OnProtoLoaded, |
- weak_ptr_factory_.GetWeakPtr(), |
- base::Owned(params))); |
- } |
+ cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META).Append( |
+ kFilesystemProtoFile); |
+ base::PostTaskAndReplyWithResult( |
+ BrowserThread::GetBlockingPool(), |
+ FROM_HERE, |
+ base::Bind(&LoadProtoOnBlockingPool, |
+ path, ¶ms->last_modified, ¶ms->proto), |
+ base::Bind(&ChangeListLoader::OnProtoLoaded, |
+ weak_ptr_factory_.GetWeakPtr(), |
+ base::Owned(params))); |
} |
void ChangeListLoader::OnProtoLoaded(LoadRootFeedParams* params, |
@@ -681,21 +665,17 @@ void ChangeListLoader::SaveFileSystem() { |
return; |
} |
- if (UseLevelDB()) { |
- resource_metadata_->SaveToDB(); |
- } else { |
- const base::FilePath path = |
- cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META).Append( |
- kFilesystemProtoFile); |
- scoped_ptr<std::string> serialized_proto(new std::string()); |
- resource_metadata_->SerializeToString(serialized_proto.get()); |
- resource_metadata_->set_last_serialized(base::Time::Now()); |
- resource_metadata_->set_serialized_size(serialized_proto->size()); |
- blocking_task_runner_->PostTask( |
- FROM_HERE, |
- base::Bind(&SaveProtoOnBlockingPool, path, |
- base::Passed(&serialized_proto))); |
- } |
+ const base::FilePath path = |
+ cache_->GetCacheDirectoryPath(DriveCache::CACHE_TYPE_META).Append( |
+ kFilesystemProtoFile); |
+ scoped_ptr<std::string> serialized_proto(new std::string()); |
+ resource_metadata_->SerializeToString(serialized_proto.get()); |
+ resource_metadata_->set_last_serialized(base::Time::Now()); |
+ resource_metadata_->set_serialized_size(serialized_proto->size()); |
+ blocking_task_runner_->PostTask( |
+ FROM_HERE, |
+ base::Bind(&SaveProtoOnBlockingPool, path, |
+ base::Passed(&serialized_proto))); |
} |
void ChangeListLoader::UpdateFromFeed( |