| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/sync/engine/syncapi.h" | 9 #include "chrome/browser/sync/engine/syncapi.h" |
| 10 #include "chrome/browser/sync/glue/sync_backend_host.h" | 10 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Call when the processor should accept changes from either provided model | 27 // Call when the processor should accept changes from either provided model |
| 28 // and apply them to the other. Both the chrome model and sync_api are | 28 // and apply them to the other. Both the chrome model and sync_api are |
| 29 // expected to be initialized and loaded. You must have set a valid | 29 // expected to be initialized and loaded. You must have set a valid |
| 30 // ModelAssociator and UnrecoverableErrorHandler before using this method, | 30 // ModelAssociator and UnrecoverableErrorHandler before using this method, |
| 31 // and the two models should be associated w.r.t the ModelAssociator provided. | 31 // and the two models should be associated w.r.t the ModelAssociator provided. |
| 32 // It is safe to call Start again after previously Stop()ing the processor. | 32 // It is safe to call Start again after previously Stop()ing the processor. |
| 33 // Subclasses can extract their associated chrome model from |profile| in | 33 // Subclasses can extract their associated chrome model from |profile| in |
| 34 // |StartImpl|. | 34 // |StartImpl|. |
| 35 void Start(Profile* profile, sync_api::UserShare* share_handle); | 35 void Start(Profile* profile, sync_api::UserShare* share_handle); |
| 36 void Stop(); | 36 void Stop(); |
| 37 virtual bool IsRunning() const { return running_; } | 37 virtual bool IsRunning() const; |
| 38 | 38 |
| 39 // Changes have been applied to the backend model and are ready to be | 39 // Changes have been applied to the backend model and are ready to be |
| 40 // applied to the frontend model. See syncapi.h for detailed instructions on | 40 // applied to the frontend model. See syncapi.h for detailed instructions on |
| 41 // how to interpret and process |changes|. | 41 // how to interpret and process |changes|. |
| 42 virtual void ApplyChangesFromSyncModel( | 42 virtual void ApplyChangesFromSyncModel( |
| 43 const sync_api::BaseTransaction* trans, | 43 const sync_api::BaseTransaction* trans, |
| 44 const sync_api::SyncManager::ChangeRecord* changes, | 44 const sync_api::SyncManager::ChangeRecord* changes, |
| 45 int change_count) = 0; | 45 int change_count) = 0; |
| 46 | 46 |
| 47 // The changes found in ApplyChangesFromSyncModel may be too slow to be | 47 // The changes found in ApplyChangesFromSyncModel may be too slow to be |
| (...skipping 20 matching lines...) Expand all Loading... |
| 68 // The sync model we are processing changes from. Non-NULL when |running_| is | 68 // The sync model we are processing changes from. Non-NULL when |running_| is |
| 69 // true. | 69 // true. |
| 70 sync_api::UserShare* share_handle_; | 70 sync_api::UserShare* share_handle_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor); | 72 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace browser_sync | 75 } // namespace browser_sync |
| 76 | 76 |
| 77 #endif // CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ | 77 #endif // CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ |
| OLD | NEW |