| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // A class to track the outstanding work required to bring the client back into | 5 // A class to track the outstanding work required to bring the client back into |
| 6 // sync with the server. | 6 // sync with the server. |
| 7 #ifndef COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ | 7 #ifndef COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
| 8 #define COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ | 8 #define COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 | 11 |
| 12 #include <list> | 12 #include <list> |
| 13 #include <map> | 13 #include <map> |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "components/sync/base/invalidation_interface.h" | 19 #include "components/sync/base/invalidation_interface.h" |
| 20 #include "components/sync/base/model_type.h" | 20 #include "components/sync/base/model_type.h" |
| 21 #include "components/sync/base/sync_export.h" | |
| 22 #include "components/sync/protocol/sync.pb.h" | 21 #include "components/sync/protocol/sync.pb.h" |
| 23 #include "components/sync/sessions_impl/data_type_tracker.h" | 22 #include "components/sync/sessions_impl/data_type_tracker.h" |
| 24 | 23 |
| 25 namespace syncer { | 24 namespace syncer { |
| 26 | 25 |
| 27 class ObjectIdInvalidationMap; | 26 class ObjectIdInvalidationMap; |
| 28 | 27 |
| 29 namespace sessions { | 28 namespace sessions { |
| 30 | 29 |
| 31 class SYNC_EXPORT NudgeTracker { | 30 class NudgeTracker { |
| 32 public: | 31 public: |
| 33 static size_t kDefaultMaxPayloadsPerType; | 32 static size_t kDefaultMaxPayloadsPerType; |
| 34 | 33 |
| 35 NudgeTracker(); | 34 NudgeTracker(); |
| 36 ~NudgeTracker(); | 35 ~NudgeTracker(); |
| 37 | 36 |
| 38 // Returns true if there is a good reason for performing a sync cycle. | 37 // Returns true if there is a good reason for performing a sync cycle. |
| 39 // This does not take into account whether or not this is a good *time* to | 38 // This does not take into account whether or not this is a good *time* to |
| 40 // perform a sync cycle; that's the scheduler's job. | 39 // perform a sync cycle; that's the scheduler's job. |
| 41 bool IsSyncRequired() const; | 40 bool IsSyncRequired() const; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 base::TimeDelta local_refresh_nudge_delay_; | 200 base::TimeDelta local_refresh_nudge_delay_; |
| 202 base::TimeDelta remote_invalidation_nudge_delay_; | 201 base::TimeDelta remote_invalidation_nudge_delay_; |
| 203 | 202 |
| 204 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); | 203 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); |
| 205 }; | 204 }; |
| 206 | 205 |
| 207 } // namespace sessions | 206 } // namespace sessions |
| 208 } // namespace syncer | 207 } // namespace syncer |
| 209 | 208 |
| 210 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ | 209 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
| OLD | NEW |