| 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 per-type scheduling data. | 5 // A class to track the per-type scheduling data. |
| 6 #ifndef SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ | 6 #ifndef SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ |
| 7 #define SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ | 7 #define SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "sync/protocol/sync.pb.h" | 14 #include "sync/protocol/sync.pb.h" |
| 15 | 15 |
| 16 namespace syncer { | 16 namespace syncer { |
| 17 |
| 18 class Invalidation; |
| 19 class OrderedInvalidationList; |
| 20 |
| 17 namespace sessions { | 21 namespace sessions { |
| 18 | 22 |
| 19 typedef std::deque<std::string> PayloadList; | 23 typedef std::deque<std::string> PayloadList; |
| 20 | 24 |
| 21 class DataTypeTracker { | 25 class DataTypeTracker { |
| 22 public: | 26 public: |
| 23 DataTypeTracker(); | 27 DataTypeTracker(); |
| 24 ~DataTypeTracker(); | 28 ~DataTypeTracker(); |
| 25 | 29 |
| 26 // For STL compatibility, we do not forbid the creation of a default copy | 30 // For STL compatibility, we do not forbid the creation of a default copy |
| 27 // constructor and assignment operator. | 31 // constructor and assignment operator. |
| 28 | 32 |
| 29 // Tracks that a local change has been made to this type. | 33 // Tracks that a local change has been made to this type. |
| 30 void RecordLocalChange(); | 34 void RecordLocalChange(); |
| 31 | 35 |
| 32 // Tracks that a local refresh request has been made for this type. | 36 // Tracks that a local refresh request has been made for this type. |
| 33 void RecordLocalRefreshRequest(); | 37 void RecordLocalRefreshRequest(); |
| 34 | 38 |
| 35 // Tracks that we received an invalidation notification for this type. | 39 // Tracks that we received invalidation notifications for this type. |
| 36 void RecordRemoteInvalidation(const std::string& payload); | 40 void RecordRemoteInvalidations(const OrderedInvalidationList& invalidations); |
| 37 | 41 |
| 38 // Records that a sync cycle has been performed successfully. | 42 // Records that a sync cycle has been performed successfully. |
| 39 // Generally, this means that all local changes have been committed and all | 43 // Generally, this means that all local changes have been committed and all |
| 40 // remote changes have been downloaded, so we can clear any flags related to | 44 // remote changes have been downloaded, so we can clear any flags related to |
| 41 // pending work. | 45 // pending work. |
| 42 void RecordSuccessfulSyncCycle(); | 46 void RecordSuccessfulSyncCycle(); |
| 43 | 47 |
| 44 // Updates the size of the invalidations payload buffer. | 48 // Updates the size of the invalidations payload buffer. |
| 45 void UpdatePayloadBufferSize(size_t new_size); | 49 void UpdatePayloadBufferSize(size_t new_size); |
| 46 | 50 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 116 |
| 113 // If !unthrottle_time_.is_null(), this type is throttled and may not download | 117 // If !unthrottle_time_.is_null(), this type is throttled and may not download |
| 114 // or commit data until the specified time. | 118 // or commit data until the specified time. |
| 115 base::TimeTicks unthrottle_time_; | 119 base::TimeTicks unthrottle_time_; |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 } // namespace syncer | 122 } // namespace syncer |
| 119 } // namespace sessions | 123 } // namespace sessions |
| 120 | 124 |
| 121 #endif // SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ | 125 #endif // SYNC_SESSIONS_DATA_TYPE_TRACKER_H_ |
| OLD | NEW |