| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 WARN_UNUSED_RESULT = 0; | 110 WARN_UNUSED_RESULT = 0; |
| 111 | 111 |
| 112 // Called on |frontend_loop_| to kick off shutdown procedure. Attempts to cut | 112 // Called on |frontend_loop_| to kick off shutdown procedure. Attempts to cut |
| 113 // short any long-lived or blocking sync thread tasks so that the shutdown on | 113 // short any long-lived or blocking sync thread tasks so that the shutdown on |
| 114 // sync thread task that we're about to post won't have to wait very long. | 114 // sync thread task that we're about to post won't have to wait very long. |
| 115 virtual void StopSyncingForShutdown() = 0; | 115 virtual void StopSyncingForShutdown() = 0; |
| 116 | 116 |
| 117 // Called on |frontend_loop_| to kick off shutdown. | 117 // Called on |frontend_loop_| to kick off shutdown. |
| 118 // See the implementation and Core::DoShutdown for details. | 118 // See the implementation and Core::DoShutdown for details. |
| 119 // Must be called *after* StopSyncingForShutdown. | 119 // Must be called *after* StopSyncingForShutdown. |
| 120 // For any reason other than BROWSER_SHUTDOWN, caller should claim sync | 120 // Transfers ownership of the sync thread to the caller which may reuse it |
| 121 // thread because: | 121 // with a different SyncBackendHost or join it immediately. |
| 122 // * during browser shutdown sync thread is not claimed to avoid blocking | |
| 123 // browser shutdown on sync shutdown. | |
| 124 // * otherwise sync thread is claimed so that if sync backend is recreated | |
| 125 // later, initialization of new backend is serialized on previous sync | |
| 126 // thread after cleanup of previous backend to avoid old/new backends | |
| 127 // interfere with each other. | |
| 128 virtual std::unique_ptr<base::Thread> Shutdown(ShutdownReason reason) = 0; | 122 virtual std::unique_ptr<base::Thread> Shutdown(ShutdownReason reason) = 0; |
| 129 | 123 |
| 130 // Removes all current registrations from the backend on the | 124 // Removes all current registrations from the backend on the |
| 131 // InvalidationService. | 125 // InvalidationService. |
| 132 virtual void UnregisterInvalidationIds() = 0; | 126 virtual void UnregisterInvalidationIds() = 0; |
| 133 | 127 |
| 134 // Changes the set of data types that are currently being synced. | 128 // Changes the set of data types that are currently being synced. |
| 135 // The ready_task will be run when configuration is done with the | 129 // The ready_task will be run when configuration is done with the |
| 136 // set of all types that failed configuration (i.e., if its argument | 130 // set of all types that failed configuration (i.e., if its argument |
| 137 // is non-empty, then an error was encountered). | 131 // is non-empty, then an error was encountered). |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // See SyncManager::OnCookieJarChanged. | 207 // See SyncManager::OnCookieJarChanged. |
| 214 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; | 208 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; |
| 215 | 209 |
| 216 private: | 210 private: |
| 217 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 211 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 218 }; | 212 }; |
| 219 | 213 |
| 220 } // namespace syncer | 214 } // namespace syncer |
| 221 | 215 |
| 222 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ | 216 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |