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

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

Issue 558603002: [SyncFS] Make MetadataDatabase operations synchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_create
Patch Set: +TODO Created 6 years, 3 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/sync_file_system/drive_backend/sync_worker.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
index 7af5cf0741cd8c7a6fde793de132a50a01d12b16..416bfa2820f56bdda7b73a0f0c454477689294f9 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc
@@ -339,22 +339,26 @@ void SyncWorker::DoDisableApp(const std::string& app_id,
const SyncStatusCallback& callback) {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());
- if (GetMetadataDatabase()) {
- GetMetadataDatabase()->DisableApp(app_id, callback);
- } else {
+ if (!GetMetadataDatabase()) {
callback.Run(SYNC_STATUS_OK);
+ return;
}
+
+ SyncStatusCode status = GetMetadataDatabase()->DisableApp(app_id);
+ callback.Run(status);
}
void SyncWorker::DoEnableApp(const std::string& app_id,
const SyncStatusCallback& callback) {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());
- if (GetMetadataDatabase()) {
- GetMetadataDatabase()->EnableApp(app_id, callback);
- } else {
+ if (!GetMetadataDatabase()) {
callback.Run(SYNC_STATUS_OK);
+ return;
}
+
+ SyncStatusCode status = GetMetadataDatabase()->EnableApp(app_id);
+ callback.Run(status);
}
void SyncWorker::PostInitializeTask() {

Powered by Google App Engine
This is Rietveld 408576698