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

Side by Side Diff: sync/engine/sync_scheduler_impl.h

Issue 26594002: Chrome sync: Put WeakPtrFactory members at the end (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge (see prior patch for try jobs) Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
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 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ 5 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_
6 #define SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ 6 #define SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void SendInitialSnapshot(); 232 void SendInitialSnapshot();
233 233
234 // This is used for histogramming and analysis of ScheduleNudge* APIs. 234 // This is used for histogramming and analysis of ScheduleNudge* APIs.
235 // SyncScheduler is the ultimate choke-point for all such invocations (with 235 // SyncScheduler is the ultimate choke-point for all such invocations (with
236 // and without InvalidationState variants, all NudgeSources, etc) and as such 236 // and without InvalidationState variants, all NudgeSources, etc) and as such
237 // is the most flexible place to do this bookkeeping. 237 // is the most flexible place to do this bookkeeping.
238 void UpdateNudgeTimeRecords(ModelTypeSet types); 238 void UpdateNudgeTimeRecords(ModelTypeSet types);
239 239
240 virtual void OnActionableError(const sessions::SyncSessionSnapshot& snapshot); 240 virtual void OnActionableError(const sessions::SyncSessionSnapshot& snapshot);
241 241
242 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
243
244 // A second factory specially for weak_handle_this_, to allow the handle
245 // to be const and alleviate threading concerns.
246 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
247
248 // For certain methods that need to worry about X-thread posting. 242 // For certain methods that need to worry about X-thread posting.
249 const WeakHandle<SyncSchedulerImpl> weak_handle_this_; 243 WeakHandle<SyncSchedulerImpl> weak_handle_this_;
250 244
251 // Used for logging. 245 // Used for logging.
252 const std::string name_; 246 const std::string name_;
253 247
254 // Set in Start(), unset in Stop(). 248 // Set in Start(), unset in Stop().
255 bool started_; 249 bool started_;
256 250
257 // Modifiable versions of kDefaultLongPollIntervalSeconds which can be 251 // Modifiable versions of kDefaultLongPollIntervalSeconds which can be
258 // updated by the server. 252 // updated by the server.
259 base::TimeDelta syncer_short_poll_interval_seconds_; 253 base::TimeDelta syncer_short_poll_interval_seconds_;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 303
310 // crbug/251307. This is a workaround for M29. crbug/259913 tracks proper fix 304 // crbug/251307. This is a workaround for M29. crbug/259913 tracks proper fix
311 // for M30. 305 // for M30.
312 // The issue is that poll job runs after few hours of inactivity and therefore 306 // The issue is that poll job runs after few hours of inactivity and therefore
313 // will always fail with auth error because of expired access token. Once 307 // will always fail with auth error because of expired access token. Once
314 // fresh access token is requested poll job is not retried. 308 // fresh access token is requested poll job is not retried.
315 // The change is to remember that poll timer just fired and retry poll job 309 // The change is to remember that poll timer just fired and retry poll job
316 // after credentials are updated. 310 // after credentials are updated.
317 bool do_poll_after_credentials_updated_; 311 bool do_poll_after_credentials_updated_;
318 312
313 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
314
315 // A second factory specially for weak_handle_this_, to allow the handle
316 // to be const and alleviate threading concerns.
317 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
318
319 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); 319 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
320 }; 320 };
321 321
322 } // namespace syncer 322 } // namespace syncer
323 323
324 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ 324 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698