| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_ENGINE_SYNCER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/lock.h" | |
| 16 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
| 16 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/sync/engine/conflict_resolver.h" | 17 #include "chrome/browser/sync/engine/conflict_resolver.h" |
| 18 #include "chrome/browser/sync/engine/syncer_types.h" | 18 #include "chrome/browser/sync/engine/syncer_types.h" |
| 19 #include "chrome/browser/sync/engine/syncproto.h" | 19 #include "chrome/browser/sync/engine/syncproto.h" |
| 20 #include "chrome/browser/sync/sessions/sync_session.h" | 20 #include "chrome/browser/sync/sessions/sync_session.h" |
| 21 #include "chrome/browser/sync/syncable/directory_event.h" | 21 #include "chrome/browser/sync/syncable/directory_event.h" |
| 22 #include "chrome/browser/sync/syncable/model_type.h" | 22 #include "chrome/browser/sync/syncable/model_type.h" |
| 23 #include "chrome/browser/sync/util/extensions_activity_monitor.h" | 23 #include "chrome/browser/sync/util/extensions_activity_monitor.h" |
| 24 #include "chrome/common/deprecated/event_sys.h" | 24 #include "chrome/common/deprecated/event_sys.h" |
| 25 #include "chrome/common/deprecated/event_sys-inl.h" | 25 #include "chrome/common/deprecated/event_sys-inl.h" |
| 26 | 26 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // This is the bottom-most SyncShare variant, and does not cause transient | 103 // This is the bottom-most SyncShare variant, and does not cause transient |
| 104 // state to be reset in session. | 104 // state to be reset in session. |
| 105 // Like SyncShare(), but |first_step| and |last_step| are provided to perform | 105 // Like SyncShare(), but |first_step| and |last_step| are provided to perform |
| 106 // a partial sync cycle, stopping after |last_step| is performed. | 106 // a partial sync cycle, stopping after |last_step| is performed. |
| 107 void SyncShare(sessions::SyncSession* session, | 107 void SyncShare(sessions::SyncSession* session, |
| 108 SyncerStep first_step, | 108 SyncerStep first_step, |
| 109 SyncerStep last_step); | 109 SyncerStep last_step); |
| 110 | 110 |
| 111 bool early_exit_requested_; | 111 bool early_exit_requested_; |
| 112 Lock early_exit_requested_lock_; | 112 base::Lock early_exit_requested_lock_; |
| 113 | 113 |
| 114 int32 max_commit_batch_size_; | 114 int32 max_commit_batch_size_; |
| 115 | 115 |
| 116 ConflictResolver resolver_; | 116 ConflictResolver resolver_; |
| 117 | 117 |
| 118 // A callback hook used in unittests to simulate changes between conflict set | 118 // A callback hook used in unittests to simulate changes between conflict set |
| 119 // building and conflict resolution. | 119 // building and conflict resolution. |
| 120 Callback0::Type* pre_conflict_resolution_closure_; | 120 Callback0::Type* pre_conflict_resolution_closure_; |
| 121 | 121 |
| 122 friend class SyncerTest; | 122 friend class SyncerTest; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 return false; | 168 return false; |
| 169 } | 169 } |
| 170 // Utility function declarations. | 170 // Utility function declarations. |
| 171 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); | 171 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); |
| 172 void ClearServerData(syncable::MutableEntry* entry); | 172 void ClearServerData(syncable::MutableEntry* entry); |
| 173 | 173 |
| 174 } // namespace browser_sync | 174 } // namespace browser_sync |
| 175 | 175 |
| 176 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 176 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| OLD | NEW |