| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // StatusController handles all counter and status related number crunching and | 5 // StatusController handles all counter and status related number crunching and |
| 6 // state tracking on behalf of a SyncSession. | 6 // state tracking on behalf of a SyncSession. |
| 7 // | 7 // |
| 8 // This object may be accessed from many different threads. It will be accessed | 8 // This object may be accessed from many different threads. It will be accessed |
| 9 // most often from the syncer thread. However, when update application is in | 9 // most often from the syncer thread. However, when update application is in |
| 10 // progress it may also be accessed from the worker threads. This is safe | 10 // progress it may also be accessed from the worker threads. This is safe |
| 11 // because only one of them will run at a time, and the syncer thread will be | 11 // because only one of them will run at a time, and the syncer thread will be |
| 12 // blocked until update application completes. | 12 // blocked until update application completes. |
| 13 // | 13 // |
| 14 // This object contains only global state. None of its members are per model | 14 // This object contains only global state. None of its members are per model |
| 15 // type counters. | 15 // type counters. |
| 16 | 16 |
| 17 #ifndef SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 17 #ifndef SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| 18 #define SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 18 #define SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| 19 | 19 |
| 20 #include <map> | 20 #include <map> |
| 21 #include <vector> | 21 #include <vector> |
| 22 | 22 |
| 23 #include "base/logging.h" | 23 #include "base/logging.h" |
| 24 #include "base/macros.h" |
| 24 #include "base/stl_util.h" | 25 #include "base/stl_util.h" |
| 25 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 26 #include "sync/base/sync_export.h" | 27 #include "sync/base/sync_export.h" |
| 27 #include "sync/internal_api/public/engine/model_safe_worker.h" | 28 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 28 #include "sync/internal_api/public/sessions/model_neutral_state.h" | 29 #include "sync/internal_api/public/sessions/model_neutral_state.h" |
| 29 | 30 |
| 30 namespace syncer { | 31 namespace syncer { |
| 31 namespace sessions { | 32 namespace sessions { |
| 32 | 33 |
| 33 class SYNC_EXPORT StatusController { | 34 class SYNC_EXPORT StatusController { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // performed. | 111 // performed. |
| 111 base::Time poll_finish_time_; | 112 base::Time poll_finish_time_; |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(StatusController); | 114 DISALLOW_COPY_AND_ASSIGN(StatusController); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace sessions | 117 } // namespace sessions |
| 117 } // namespace syncer | 118 } // namespace syncer |
| 118 | 119 |
| 119 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ | 120 #endif // SYNC_SESSIONS_STATUS_CONTROLLER_H_ |
| OLD | NEW |