Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: sync/sessions/nudge_tracker.h

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Fix Mac compile. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 SYNC_SESSIONS_NUDGE_TRACKER_H_ 7 #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_
8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ 8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_
9 9
10 #include <list> 10 #include <list>
11 #include <map> 11 #include <map>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/containers/scoped_ptr_map.h"
14 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
15 #include "base/time/time.h" 16 #include "base/time/time.h"
16 #include "sync/base/sync_export.h" 17 #include "sync/base/sync_export.h"
17 #include "sync/internal_api/public/base/invalidation_interface.h" 18 #include "sync/internal_api/public/base/invalidation_interface.h"
18 #include "sync/internal_api/public/base/model_type.h" 19 #include "sync/internal_api/public/base/model_type.h"
19 #include "sync/protocol/sync.pb.h" 20 #include "sync/protocol/sync.pb.h"
20 #include "sync/sessions/data_type_tracker.h" 21 #include "sync/sessions/data_type_tracker.h"
21 22
22 namespace syncer { 23 namespace syncer {
23 24
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void SetNextRetryTime(base::TimeTicks next_retry_time); 152 void SetNextRetryTime(base::TimeTicks next_retry_time);
152 153
153 // Update the per-datatype local change nudge delays. 154 // Update the per-datatype local change nudge delays.
154 void OnReceivedCustomNudgeDelays( 155 void OnReceivedCustomNudgeDelays(
155 const std::map<ModelType, base::TimeDelta>& delay_map); 156 const std::map<ModelType, base::TimeDelta>& delay_map);
156 157
157 // Update the default nudge delay. 158 // Update the default nudge delay.
158 void SetDefaultNudgeDelay(base::TimeDelta nudge_delay); 159 void SetDefaultNudgeDelay(base::TimeDelta nudge_delay);
159 160
160 private: 161 private:
161 typedef std::map<ModelType, DataTypeTracker*> TypeTrackerMap; 162 typedef ScopedPtrMap<ModelType, scoped_ptr<DataTypeTracker>> TypeTrackerMap;
162 163
163 TypeTrackerMap type_trackers_; 164 TypeTrackerMap type_trackers_;
164 STLValueDeleter<TypeTrackerMap> type_tracker_deleter_;
165 165
166 // Tracks whether or not invalidations are currently enabled. 166 // Tracks whether or not invalidations are currently enabled.
167 bool invalidations_enabled_; 167 bool invalidations_enabled_;
168 168
169 // This flag is set if suspect that some technical malfunction or known bug 169 // This flag is set if suspect that some technical malfunction or known bug
170 // may have left us with some unserviced invalidations. 170 // may have left us with some unserviced invalidations.
171 // 171 //
172 // Keeps track of whether or not we're fully in sync with the invalidation 172 // Keeps track of whether or not we're fully in sync with the invalidation
173 // server. This can be false even if invalidations are enabled and working 173 // server. This can be false even if invalidations are enabled and working
174 // correctly. For example, until we get ack-tracking working properly, we 174 // correctly. For example, until we get ack-tracking working properly, we
(...skipping 26 matching lines...) Expand all
201 base::TimeDelta local_refresh_nudge_delay_; 201 base::TimeDelta local_refresh_nudge_delay_;
202 base::TimeDelta remote_invalidation_nudge_delay_; 202 base::TimeDelta remote_invalidation_nudge_delay_;
203 203
204 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); 204 DISALLOW_COPY_AND_ASSIGN(NudgeTracker);
205 }; 205 };
206 206
207 } // namespace sessions 207 } // namespace sessions
208 } // namespace syncer 208 } // namespace syncer
209 209
210 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ 210 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698