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

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

Issue 110113003: SyncFS v2: Add re-initialization code for temporary service failure case (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 7 years 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 6e7822f93d9081209702b12e6379c1d6230f57b8..81bb8ab0270c714ac35e63246d127c966d27fa04 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -148,6 +148,9 @@ void SyncEngine::AddFileStatusObserver(FileStatusObserver* observer) {
void SyncEngine::RegisterOrigin(
const GURL& origin,
const SyncStatusCallback& callback) {
+ if (!metadata_database_ && drive_service_->HasRefreshToken())
+ PostInitializeTask();
+
task_manager_->ScheduleSyncTaskAtPriority(
scoped_ptr<SyncTask>(new RegisterAppTask(this, origin.host())),
SyncTaskManager::PRIORITY_HIGH,
@@ -330,6 +333,9 @@ void SyncEngine::NotifyLastOperationStatus(
}
void SyncEngine::OnNotificationReceived() {
+ if (service_state_ == REMOTE_SERVICE_TEMPORARY_UNAVAILABLE)
+ UpdateServiceState(REMOTE_SERVICE_OK, "Got push notification for Drive.");
+
should_check_remote_change_ = true;
MaybeScheduleNextTask();
}
@@ -437,8 +443,9 @@ void SyncEngine::PostInitializeTask() {
task_runner_.get(),
drive_service_.get(),
base_dir_.Append(kDatabaseName));
- task_manager_->ScheduleSyncTask(
+ task_manager_->ScheduleSyncTaskAtPriority(
scoped_ptr<SyncTask>(initializer),
+ SyncTaskManager::PRIORITY_HIGH,
base::Bind(&SyncEngine::DidInitialize, weak_ptr_factory_.GetWeakPtr(),
initializer));
}
« 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