| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // SyncerSession holds the entire state of a single sync cycle; GetUpdates, | 5 // SyncerSession holds the entire state of a single sync cycle; GetUpdates, |
| 6 // Commit, and Conflict Resolution. After said cycle, the Session may contain | 6 // Commit, and Conflict Resolution. After said cycle, the Session may contain |
| 7 // items that were unable to be processed because of errors. | 7 // items that were unable to be processed because of errors. |
| 8 // | 8 // |
| 9 // THIS CLASS PROVIDES NO SYNCHRONIZATION GUARANTEES. | 9 // THIS CLASS PROVIDES NO SYNCHRONIZATION GUARANTEES. |
| 10 | 10 |
| 11 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ | 11 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ |
| 12 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ | 12 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ |
| 13 | 13 |
| 14 #include <utility> | 14 #include <utility> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 18 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
| 19 #include "chrome/browser/sync/engine/sync_cycle_state.h" | 19 #include "chrome/browser/sync/engine/sync_cycle_state.h" |
| 20 #include "chrome/browser/sync/engine/sync_process_state.h" | 20 #include "chrome/browser/sync/engine/sync_process_state.h" |
| 21 #include "chrome/browser/sync/engine/syncer_status.h" | 21 #include "chrome/browser/sync/engine/syncer_status.h" |
| 22 #include "chrome/browser/sync/engine/syncer_types.h" | 22 #include "chrome/browser/sync/engine/syncer_types.h" |
| 23 #include "chrome/browser/sync/engine/syncproto.h" | 23 #include "chrome/browser/sync/engine/syncproto.h" |
| 24 #include "chrome/browser/sync/util/event_sys.h" | 24 #include "chrome/browser/sync/util/event_sys.h" |
| 25 #include "chrome/browser/sync/util/extensions_activity_monitor.h" |
| 25 #include "chrome/browser/sync/util/sync_types.h" | 26 #include "chrome/browser/sync/util/sync_types.h" |
| 26 #include "testing/gtest/include/gtest/gtest_prod.h" // For FRIEND_TEST | 27 #include "testing/gtest/include/gtest/gtest_prod.h" // For FRIEND_TEST |
| 27 | 28 |
| 28 namespace browser_sync { | 29 namespace browser_sync { |
| 29 | 30 |
| 30 class ConflictResolver; | 31 class ConflictResolver; |
| 31 class ModelSafeWorker; | 32 class ModelSafeWorker; |
| 32 class ServerConnectionManager; | 33 class ServerConnectionManager; |
| 33 class SyncerStatus; | 34 class SyncerStatus; |
| 34 struct SyncerEvent; | 35 struct SyncerEvent; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE old_source = | 301 sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE old_source = |
| 301 source_; | 302 source_; |
| 302 set_source(sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION); | 303 set_source(sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION); |
| 303 return old_source; | 304 return old_source; |
| 304 } | 305 } |
| 305 | 306 |
| 306 void set_source(sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE source) { | 307 void set_source(sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE source) { |
| 307 source_ = source; | 308 source_ = source; |
| 308 } | 309 } |
| 309 | 310 |
| 311 const ExtensionsActivityMonitor::Records& extensions_activity() const { |
| 312 return extensions_activity_; |
| 313 } |
| 314 |
| 315 ExtensionsActivityMonitor::Records* mutable_extensions_activity() { |
| 316 return &extensions_activity_; |
| 317 } |
| 318 |
| 310 bool notifications_enabled() const { | 319 bool notifications_enabled() const { |
| 311 return notifications_enabled_; | 320 return notifications_enabled_; |
| 312 } | 321 } |
| 313 | 322 |
| 314 void set_notifications_enabled(const bool state) { | 323 void set_notifications_enabled(const bool state) { |
| 315 notifications_enabled_ = state; | 324 notifications_enabled_ = state; |
| 316 } | 325 } |
| 317 | 326 |
| 318 void set_timestamp_dirty() { | 327 void set_timestamp_dirty() { |
| 319 sync_cycle_state_->set_timestamp_dirty(); | 328 sync_cycle_state_->set_timestamp_dirty(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 348 void ClearWriteTransaction() { | 357 void ClearWriteTransaction() { |
| 349 sync_cycle_state_->ClearWriteTransaction(); | 358 sync_cycle_state_->ClearWriteTransaction(); |
| 350 } | 359 } |
| 351 | 360 |
| 352 SyncProcessState* sync_process_state_; | 361 SyncProcessState* sync_process_state_; |
| 353 SyncCycleState* sync_cycle_state_; | 362 SyncCycleState* sync_cycle_state_; |
| 354 | 363 |
| 355 // The source for initiating this syncer session. | 364 // The source for initiating this syncer session. |
| 356 sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE source_; | 365 sync_pb::GetUpdatesCallerInfo::GET_UPDATES_SOURCE source_; |
| 357 | 366 |
| 367 // Information about extensions activity since the last successful commit. |
| 368 ExtensionsActivityMonitor::Records extensions_activity_; |
| 369 |
| 358 // True if notifications are enabled when this session was created. | 370 // True if notifications are enabled when this session was created. |
| 359 bool notifications_enabled_; | 371 bool notifications_enabled_; |
| 360 | 372 |
| 361 FRIEND_TEST(SyncerTest, TestCommitListOrderingCounterexample); | 373 FRIEND_TEST(SyncerTest, TestCommitListOrderingCounterexample); |
| 362 DISALLOW_COPY_AND_ASSIGN(SyncerSession); | 374 DISALLOW_COPY_AND_ASSIGN(SyncerSession); |
| 363 }; | 375 }; |
| 364 | 376 |
| 365 } // namespace browser_sync | 377 } // namespace browser_sync |
| 366 | 378 |
| 367 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ | 379 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_SESSION_H_ |
| OLD | NEW |