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

Unified Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 9348036: Trim code from sync's ServerConnectionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after Fred's patch Created 8 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
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 1f6042d8a0c0a36e726a73b6459d2258a542e438..d58ddaaf94184b0a50d9baaec2497622cc4106a5 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -279,12 +279,6 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
SignalStateCompleteWithNextState(FULLY_SYNCED);
break;
}
- if (!GetStatus().server_reachable) {
- // The client cannot reach the sync server because the network is
- // disabled. There is no need to wait anymore.
- SignalStateCompleteWithNextState(SERVER_UNREACHABLE);
- break;
- }
break;
}
case WAITING_FOR_DATA_SYNC: {
@@ -335,12 +329,6 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
SignalStateCompleteWithNextState(FULLY_SYNCED);
break;
}
- if (!GetStatus().server_reachable) {
- // The client cannot reach the sync server because the network is
- // disabled. There is no need to wait anymore.
- SignalStateCompleteWithNextState(SERVER_UNREACHABLE);
- break;
- }
break;
}
case WAITING_FOR_SYNC_CONFIGURATION: {
@@ -398,15 +386,6 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
}
break;
}
- case SERVER_UNREACHABLE: {
- DVLOG(1) << GetClientInfoString("SERVER_UNREACHABLE");
- if (GetStatus().server_reachable) {
- // The client was offline due to the network being disabled, but is now
- // back online. Wait for the pending sync cycle to complete.
- SignalStateCompleteWithNextState(WAITING_FOR_FULL_SYNC);
- }
- break;
- }
case SET_PASSPHRASE_FAILED: {
// A passphrase is required for decryption. There is nothing the sync
// client can do until SetPassphrase() is called.
@@ -537,7 +516,6 @@ bool ProfileSyncServiceHarness::AwaitDataSyncCompletion(
CHECK(service()->sync_initialized());
CHECK_NE(wait_state_, SYNC_DISABLED);
- CHECK_NE(wait_state_, SERVER_UNREACHABLE);
if (IsDataSynced()) {
// Client is already synced; don't wait.
@@ -568,23 +546,12 @@ bool ProfileSyncServiceHarness::AwaitFullSyncCompletion(
return true;
}
- if (wait_state_ == SERVER_UNREACHABLE) {
- // Client was offline; wait for it to go online, and then wait for sync.
- AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, reason);
- DCHECK_EQ(wait_state_, WAITING_FOR_FULL_SYNC);
- return AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, reason);
- }
-
DCHECK(service()->sync_initialized());
wait_state_ = WAITING_FOR_FULL_SYNC;
AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, reason);
if (wait_state_ == FULLY_SYNCED) {
// Client is online; sync was successful.
return true;
- } else if (wait_state_ == SERVER_UNREACHABLE) {
- // Client is offline; sync was unsuccessful.
- LOG(ERROR) << "Client went offline after waiting for sync to finish";
- return false;
} else {
LOG(ERROR) << "Invalid wait state: " << wait_state_;
return false;
« no previous file with comments | « chrome/browser/sync/internal_api/syncapi_server_connection_manager_unittest.cc ('k') | chrome/browser/sync/retry_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698