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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 private: | 137 private: |
138 DISALLOW_COPY_AND_ASSIGN(SyncFrontend); | 138 DISALLOW_COPY_AND_ASSIGN(SyncFrontend); |
139 }; | 139 }; |
140 | 140 |
141 // A UI-thread safe API into the sync backend that "hosts" the top-level | 141 // A UI-thread safe API into the sync backend that "hosts" the top-level |
142 // syncapi element, the SyncManager, on its own thread. This class handles | 142 // syncapi element, the SyncManager, on its own thread. This class handles |
143 // dispatch of potentially blocking calls to appropriate threads and ensures | 143 // dispatch of potentially blocking calls to appropriate threads and ensures |
144 // that the SyncFrontend is only accessed on the UI loop. | 144 // that the SyncFrontend is only accessed on the UI loop. |
145 class SyncBackendHost : public BackendDataTypeConfigurer { | 145 class SyncBackendHost : public BackendDataTypeConfigurer { |
146 public: | 146 public: |
147 typedef sync_api::SyncManager::Status Status; | 147 typedef sync_api::SyncStatus Status; |
148 | 148 |
149 // Create a SyncBackendHost with a reference to the |frontend| that | 149 // Create a SyncBackendHost with a reference to the |frontend| that |
150 // it serves and communicates to via the SyncFrontend interface (on | 150 // it serves and communicates to via the SyncFrontend interface (on |
151 // the same thread it used to call the constructor). Must outlive | 151 // the same thread it used to call the constructor). Must outlive |
152 // |sync_prefs| and |invalidator_storage|. | 152 // |sync_prefs| and |invalidator_storage|. |
153 SyncBackendHost( | 153 SyncBackendHost( |
154 const std::string& name, | 154 const std::string& name, |
155 Profile* profile, | 155 Profile* profile, |
156 const base::WeakPtr<SyncPrefs>& sync_prefs, | 156 const base::WeakPtr<SyncPrefs>& sync_prefs, |
157 // TODO(tim): Temporary, remove when bug 124137 finished. | 157 // TODO(tim): Temporary, remove when bug 124137 finished. |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. | 525 // UI-thread cache of the last SyncSessionSnapshot received from syncapi. |
526 sessions::SyncSessionSnapshot last_snapshot_; | 526 sessions::SyncSessionSnapshot last_snapshot_; |
527 | 527 |
528 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); | 528 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
529 }; | 529 }; |
530 | 530 |
531 } // namespace browser_sync | 531 } // namespace browser_sync |
532 | 532 |
533 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ | 533 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ |
OLD | NEW |