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

Unified Diff: chrome/browser/chromeos/drive/change_list_loader.cc

Issue 12673003: chromeos: Remove unused DB related code from DriveResourceMetadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « no previous file | chrome/browser/chromeos/drive/drive_resource_metadata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &params->last_modified, &params->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, &params->last_modified, &params->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(
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_resource_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698