Chromium Code Reviews| 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/engine/syncapi.h" | 5 #include "chrome/browser/sync/engine/syncapi.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <bitset> | 8 #include <bitset> |
| 9 #include <iomanip> | 9 #include <iomanip> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1876 ObserverList<SyncManager::Observer> temp_obs_list; | 1876 ObserverList<SyncManager::Observer> temp_obs_list; |
| 1877 CopyObservers(&temp_obs_list); | 1877 CopyObservers(&temp_obs_list); |
| 1878 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, | 1878 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, |
| 1879 OnPassphraseRequired(sync_api::REASON_DECRYPTION)); | 1879 OnPassphraseRequired(sync_api::REASON_DECRYPTION)); |
| 1880 } | 1880 } |
| 1881 | 1881 |
| 1882 return cryptographer->is_ready(); | 1882 return cryptographer->is_ready(); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 void SyncManager::SyncInternal::StartSyncingNormally() { | 1885 void SyncManager::SyncInternal::StartSyncingNormally() { |
| 1886 // Start the sync scheduler. This won't actually result in any | 1886 // NULL during certain unittests. |
| 1887 // syncing until at least the DirectoryManager broadcasts the OPENED | 1887 if (scheduler()) { |
| 1888 // event, and a valid server connection is detected. | 1888 // Start the sync scheduler. This won't actually result in any |
| 1889 if (scheduler()) // NULL during certain unittests. | 1889 // syncing until at least the DirectoryManager broadcasts the |
| 1890 // OPENED event, and a valid server connection is detected. | |
| 1890 scheduler()->Start(SyncScheduler::NORMAL_MODE, NULL); | 1891 scheduler()->Start(SyncScheduler::NORMAL_MODE, NULL); |
| 1892 // Cleanup any types disabled since the last time we synced. | |
| 1893 scheduler()->ScheduleDisabledTypesCleanup(); | |
|
tim (not reviewing)
2011/06/29 22:50:52
It does seem weird to always do this at this layer
| |
| 1894 } | |
| 1891 } | 1895 } |
| 1892 | 1896 |
| 1893 bool SyncManager::SyncInternal::OpenDirectory() { | 1897 bool SyncManager::SyncInternal::OpenDirectory() { |
| 1894 DCHECK(!initialized_) << "Should only happen once"; | 1898 DCHECK(!initialized_) << "Should only happen once"; |
| 1895 | 1899 |
| 1896 bool share_opened = dir_manager()->Open(username_for_share(), this); | 1900 bool share_opened = dir_manager()->Open(username_for_share(), this); |
| 1897 DCHECK(share_opened); | 1901 DCHECK(share_opened); |
| 1898 if (!share_opened) { | 1902 if (!share_opened) { |
| 1899 ObserverList<SyncManager::Observer> temp_obs_list; | 1903 ObserverList<SyncManager::Observer> temp_obs_list; |
| 1900 CopyObservers(&temp_obs_list); | 1904 CopyObservers(&temp_obs_list); |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3054 void SyncManager::TriggerOnIncomingNotificationForTest( | 3058 void SyncManager::TriggerOnIncomingNotificationForTest( |
| 3055 const syncable::ModelTypeBitSet& model_types) { | 3059 const syncable::ModelTypeBitSet& model_types) { |
| 3056 syncable::ModelTypePayloadMap model_types_with_payloads = | 3060 syncable::ModelTypePayloadMap model_types_with_payloads = |
| 3057 syncable::ModelTypePayloadMapFromBitSet(model_types, | 3061 syncable::ModelTypePayloadMapFromBitSet(model_types, |
| 3058 std::string()); | 3062 std::string()); |
| 3059 | 3063 |
| 3060 data_->OnIncomingNotification(model_types_with_payloads); | 3064 data_->OnIncomingNotification(model_types_with_payloads); |
| 3061 } | 3065 } |
| 3062 | 3066 |
| 3063 } // namespace sync_api | 3067 } // namespace sync_api |
| OLD | NEW |