OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
591 // we want UI to update itself and no longer allow the user to press "clear" | 591 // we want UI to update itself and no longer allow the user to press "clear" |
592 if (clear_server_data_state_ != CLEAR_SUCCEEDED) { | 592 if (clear_server_data_state_ != CLEAR_SUCCEEDED) { |
593 clear_server_data_state_ = CLEAR_SUCCEEDED; | 593 clear_server_data_state_ = CLEAR_SUCCEEDED; |
594 NotifyObservers(); | 594 NotifyObservers(); |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
598 void ProfileSyncService::OnPassphraseRequired(bool for_decryption) { | 598 void ProfileSyncService::OnPassphraseRequired(bool for_decryption) { |
599 DCHECK(backend_.get()); | 599 DCHECK(backend_.get()); |
600 DCHECK(backend_->IsNigoriEnabled()); | 600 DCHECK(backend_->IsNigoriEnabled()); |
601 if (unrecoverable_error_detected_) { | |
602 // When unrecoverable error is detected we post a task to shutdown the | |
tim (not reviewing)
2011/04/18 16:11:47
I don't quite understand a) how or if this arose a
lipalani1
2011/04/18 20:36:41
This arose because of this patch and how the threa
| |
603 // backend. The task might not have executed yet. | |
604 return; | |
605 } | |
601 observed_passphrase_required_ = true; | 606 observed_passphrase_required_ = true; |
602 passphrase_required_for_decryption_ = for_decryption; | 607 passphrase_required_for_decryption_ = for_decryption; |
603 | 608 |
604 if (!cached_passphrase_.value.empty()) { | 609 if (!cached_passphrase_.value.empty()) { |
605 SetPassphrase(cached_passphrase_.value, | 610 SetPassphrase(cached_passphrase_.value, |
606 cached_passphrase_.is_explicit, | 611 cached_passphrase_.is_explicit, |
607 cached_passphrase_.is_creation); | 612 cached_passphrase_.is_creation); |
608 cached_passphrase_ = CachedPassphrase(); | 613 cached_passphrase_ = CachedPassphrase(); |
609 return; | 614 return; |
610 } | 615 } |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1260 // is initialized, all enabled data types are consistent with one | 1265 // is initialized, all enabled data types are consistent with one |
1261 // another, and no unrecoverable error has transpired. | 1266 // another, and no unrecoverable error has transpired. |
1262 if (unrecoverable_error_detected_) | 1267 if (unrecoverable_error_detected_) |
1263 return false; | 1268 return false; |
1264 | 1269 |
1265 if (!data_type_manager_.get()) | 1270 if (!data_type_manager_.get()) |
1266 return false; | 1271 return false; |
1267 | 1272 |
1268 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1273 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
1269 } | 1274 } |
OLD | NEW |