| 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 #ifndef CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // is created for each datatype and lives on the datatype's thread. It then | 25 // is created for each datatype and lives on the datatype's thread. It then |
| 26 // handles all interaction with the sync api, both translating pushes from the | 26 // handles all interaction with the sync api, both translating pushes from the |
| 27 // local service into transactions and receiving changes from the sync model, | 27 // local service into transactions and receiving changes from the sync model, |
| 28 // which then get converted into SyncChange's and sent to the local service. | 28 // which then get converted into SyncChange's and sent to the local service. |
| 29 class GenericChangeProcessor : public ChangeProcessor, | 29 class GenericChangeProcessor : public ChangeProcessor, |
| 30 public SyncChangeProcessor { | 30 public SyncChangeProcessor { |
| 31 public: | 31 public: |
| 32 GenericChangeProcessor(SyncableService* local_service, | 32 GenericChangeProcessor(SyncableService* local_service, |
| 33 UnrecoverableErrorHandler* error_handler, | 33 UnrecoverableErrorHandler* error_handler, |
| 34 sync_api::UserShare* user_share); | 34 sync_api::UserShare* user_share); |
| 35 ~GenericChangeProcessor(); | 35 virtual ~GenericChangeProcessor(); |
| 36 | 36 |
| 37 // ChangeProcessor interface. | 37 // ChangeProcessor interface. |
| 38 // Build and store a list of all changes into |syncer_changes_|. | 38 // Build and store a list of all changes into |syncer_changes_|. |
| 39 virtual void ApplyChangesFromSyncModel( | 39 virtual void ApplyChangesFromSyncModel( |
| 40 const sync_api::BaseTransaction* trans, | 40 const sync_api::BaseTransaction* trans, |
| 41 const sync_api::SyncManager::ChangeRecord* changes, | 41 const sync_api::SyncManager::ChangeRecord* changes, |
| 42 int change_count) OVERRIDE; | 42 int change_count) OVERRIDE; |
| 43 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto | 43 // Passes |syncer_changes_|, built in ApplyChangesFromSyncModel, onto |
| 44 // |local_service_| by way of it's ProcessSyncChanges method. | 44 // |local_service_| by way of it's ProcessSyncChanges method. |
| 45 virtual void CommitChangesFromSyncModel() OVERRIDE; | 45 virtual void CommitChangesFromSyncModel() OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 75 // be able to access the sync model before the change processor begins | 75 // be able to access the sync model before the change processor begins |
| 76 // listening to changes (the local_service_ will be interacting with us | 76 // listening to changes (the local_service_ will be interacting with us |
| 77 // when it starts up). As such we can't wait until Start(_) has been called, | 77 // when it starts up). As such we can't wait until Start(_) has been called, |
| 78 // and have to keep a local pointer to the user_share. | 78 // and have to keep a local pointer to the user_share. |
| 79 sync_api::UserShare* user_share_; | 79 sync_api::UserShare* user_share_; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace browser_sync | 82 } // namespace browser_sync |
| 83 | 83 |
| 84 #endif // CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ | 84 #endif // CHROME_BROWSER_SYNC_GLUE_GENERIC_CHANGE_PROCESSOR_H_ |
| OLD | NEW |