| 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 COMPONENTS_SYNC_SESSIONS_IMPL_STATUS_CONTROLLER_H_ | 17 #ifndef COMPONENTS_SYNC_SESSIONS_IMPL_STATUS_CONTROLLER_H_ |
| 18 #define COMPONENTS_SYNC_SESSIONS_IMPL_STATUS_CONTROLLER_H_ | 18 #define COMPONENTS_SYNC_SESSIONS_IMPL_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/macros.h" |
| 25 #include "base/stl_util.h" | 25 #include "base/stl_util.h" |
| 26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 27 #include "components/sync/base/sync_export.h" | |
| 28 #include "components/sync/engine/model_safe_worker.h" | 27 #include "components/sync/engine/model_safe_worker.h" |
| 29 #include "components/sync/sessions/model_neutral_state.h" | 28 #include "components/sync/sessions/model_neutral_state.h" |
| 30 | 29 |
| 31 namespace syncer { | 30 namespace syncer { |
| 32 namespace sessions { | 31 namespace sessions { |
| 33 | 32 |
| 34 class SYNC_EXPORT StatusController { | 33 class StatusController { |
| 35 public: | 34 public: |
| 36 StatusController(); | 35 StatusController(); |
| 37 ~StatusController(); | 36 ~StatusController(); |
| 38 | 37 |
| 39 // The types included in the get updates and commit client to server requests. | 38 // The types included in the get updates and commit client to server requests. |
| 40 const ModelTypeSet get_updates_request_types() const; | 39 const ModelTypeSet get_updates_request_types() const; |
| 41 void set_get_updates_request_types(ModelTypeSet value); | 40 void set_get_updates_request_types(ModelTypeSet value); |
| 42 const ModelTypeSet commit_request_types() const; | 41 const ModelTypeSet commit_request_types() const; |
| 43 void set_commit_request_types(ModelTypeSet value); | 42 void set_commit_request_types(ModelTypeSet value); |
| 44 | 43 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // performed. | 104 // performed. |
| 106 base::Time poll_finish_time_; | 105 base::Time poll_finish_time_; |
| 107 | 106 |
| 108 DISALLOW_COPY_AND_ASSIGN(StatusController); | 107 DISALLOW_COPY_AND_ASSIGN(StatusController); |
| 109 }; | 108 }; |
| 110 | 109 |
| 111 } // namespace sessions | 110 } // namespace sessions |
| 112 } // namespace syncer | 111 } // namespace syncer |
| 113 | 112 |
| 114 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_STATUS_CONTROLLER_H_ | 113 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_STATUS_CONTROLLER_H_ |
| OLD | NEW |