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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 166153002: [SyncFS] Check MetadataDatabase availability before database operation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/sync_engine.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
index 6f687d76f5b779538a527f9f2898e853b478ab20..f6f7e98bacda7a8662062267a21b1106c0d6b812 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -290,7 +290,8 @@ void SyncEngine::DownloadRemoteVersion(
}
void SyncEngine::PromoteDemotedChanges() {
- metadata_database_->PromoteLowerPriorityTrackersToNormal();
+ if (metadata_database_)
+ metadata_database_->PromoteLowerPriorityTrackersToNormal();
}
void SyncEngine::ApplyLocalChange(
@@ -428,12 +429,18 @@ SyncEngine::SyncEngine(
void SyncEngine::DoDisableApp(const std::string& app_id,
const SyncStatusCallback& callback) {
- metadata_database_->DisableApp(app_id, callback);
+ if (metadata_database_)
+ metadata_database_->DisableApp(app_id, callback);
+ else
+ callback.Run(SYNC_STATUS_OK);
}
void SyncEngine::DoEnableApp(const std::string& app_id,
const SyncStatusCallback& callback) {
- metadata_database_->EnableApp(app_id, callback);
+ if (metadata_database_)
+ metadata_database_->EnableApp(app_id, callback);
+ else
+ callback.Run(SYNC_STATUS_OK);
}
void SyncEngine::PostInitializeTask() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698