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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 11316270: SyncFileSystem: Register origin only after the local-side initialization finishes successfully (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | 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/sync_file_system_service.cc
diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc
index 2c2d7df6c9fbb0098524eb68258e1913095b5f62..7ace29836c9550ec99b3ea3e40fd18bba881ff12 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.cc
+++ b/chrome/browser/sync_file_system/sync_file_system_service.cc
@@ -158,17 +158,10 @@ void SyncFileSystemService::InitializeForApp(
return;
}
- scoped_refptr<SharedCallbackRunner> callback_runner(
- new SharedCallbackRunner(callback));
-
local_file_service_->MaybeInitializeFileSystemContext(
app_origin, service_name, file_system_context,
- callback_runner->CreateCallback());
- remote_file_service_->RegisterOriginForTrackingChanges(
- app_origin,
- base::Bind(&SyncFileSystemService::DidRegisterOrigin,
- AsWeakPtr(), app_origin,
- callback_runner->CreateCallback()));
+ base::Bind(&SyncFileSystemService::DidInitializeFileSystem,
+ AsWeakPtr(), app_origin, callback));
}
void SyncFileSystemService::GetConflictFiles(
@@ -270,6 +263,25 @@ void SyncFileSystemService::DidGetConflictFileInfo(
callback.Run(status, info);
}
+void SyncFileSystemService::DidInitializeFileSystem(
+ const GURL& app_origin,
+ const fileapi::SyncStatusCallback& callback,
+ fileapi::SyncStatusCode status) {
+ DVLOG(1) << "DidInitializeFileSystem: " << app_origin.spec() << " " << status;
+
+ if (status != fileapi::SYNC_STATUS_OK) {
+ callback.Run(status);
+ return;
+ }
+
+ // Local side of initialization for the app is done.
+ // Continue on initializing the remote side.
+ remote_file_service_->RegisterOriginForTrackingChanges(
+ app_origin,
+ base::Bind(&SyncFileSystemService::DidRegisterOrigin,
+ AsWeakPtr(), app_origin, callback));
+}
+
void SyncFileSystemService::DidRegisterOrigin(
const GURL& app_origin,
const fileapi::SyncStatusCallback& callback,
« no previous file with comments | « chrome/browser/sync_file_system/sync_file_system_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698