| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 // A UI-thread safe API into the sync backend that "hosts" the top-level | 139 // A UI-thread safe API into the sync backend that "hosts" the top-level |
| 140 // syncapi element, the SyncManager, on its own thread. This class handles | 140 // syncapi element, the SyncManager, on its own thread. This class handles |
| 141 // dispatch of potentially blocking calls to appropriate threads and ensures | 141 // dispatch of potentially blocking calls to appropriate threads and ensures |
| 142 // that the SyncFrontend is only accessed on the UI loop. | 142 // that the SyncFrontend is only accessed on the UI loop. |
| 143 class SyncBackendHost : public BackendDataTypeConfigurer { | 143 class SyncBackendHost : public BackendDataTypeConfigurer { |
| 144 public: | 144 public: |
| 145 typedef syncer::SyncStatus Status; | 145 typedef syncer::SyncStatus Status; |
| 146 | 146 |
| 147 // A static list of types to be downloaded between SyncManager init and |
| 148 // reporting to the frontend that initialization has completed. |
| 149 static syncer::ModelTypeSet EarlyDownloadTypes(); |
| 150 |
| 147 // Create a SyncBackendHost with a reference to the |frontend| that | 151 // Create a SyncBackendHost with a reference to the |frontend| that |
| 148 // it serves and communicates to via the SyncFrontend interface (on | 152 // it serves and communicates to via the SyncFrontend interface (on |
| 149 // the same thread it used to call the constructor). Must outlive | 153 // the same thread it used to call the constructor). Must outlive |
| 150 // |sync_prefs| and |invalidator_storage|. | 154 // |sync_prefs| and |invalidator_storage|. |
| 151 SyncBackendHost( | 155 SyncBackendHost( |
| 152 const std::string& name, | 156 const std::string& name, |
| 153 Profile* profile, | 157 Profile* profile, |
| 154 const base::WeakPtr<SyncPrefs>& sync_prefs, | 158 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| 155 // TODO(tim): Temporary, remove when bug 124137 finished. | 159 // TODO(tim): Temporary, remove when bug 124137 finished. |
| 156 const base::WeakPtr<InvalidatorStorage>& invalidator_storage); | 160 const base::WeakPtr<InvalidatorStorage>& invalidator_storage); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 // it via OnBackendInitialized in the final state of | 534 // it via OnBackendInitialized in the final state of |
| 531 // HandleInitializationCompletedOnFrontendLoop. | 535 // HandleInitializationCompletedOnFrontendLoop. |
| 532 syncer::WeakHandle<syncer::JsBackend> js_backend_; | 536 syncer::WeakHandle<syncer::JsBackend> js_backend_; |
| 533 | 537 |
| 534 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 538 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
| 535 }; | 539 }; |
| 536 | 540 |
| 537 } // namespace browser_sync | 541 } // namespace browser_sync |
| 538 | 542 |
| 539 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 543 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
| OLD | NEW |