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

Side by Side Diff: components/sync/engine_impl/sync_scheduler_impl.h

Issue 2915453002: Deprecate NonThreadSafe in components/sync in favor of SequenceChecker. (Closed)
Patch Set: fix comment Created 3 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 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 COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/cancelable_callback.h" 13 #include "base/cancelable_callback.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/threading/non_thread_safe.h" 18 #include "base/sequence_checker.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "base/timer/timer.h" 20 #include "base/timer/timer.h"
21 #include "components/sync/engine/polling_constants.h" 21 #include "components/sync/engine/polling_constants.h"
22 #include "components/sync/engine_impl/cycle/nudge_tracker.h" 22 #include "components/sync/engine_impl/cycle/nudge_tracker.h"
23 #include "components/sync/engine_impl/cycle/sync_cycle.h" 23 #include "components/sync/engine_impl/cycle/sync_cycle.h"
24 #include "components/sync/engine_impl/cycle/sync_cycle_context.h" 24 #include "components/sync/engine_impl/cycle/sync_cycle_context.h"
25 #include "components/sync/engine_impl/net/server_connection_manager.h" 25 #include "components/sync/engine_impl/net/server_connection_manager.h"
26 #include "components/sync/engine_impl/nudge_source.h" 26 #include "components/sync/engine_impl/nudge_source.h"
27 #include "components/sync/engine_impl/sync_scheduler.h" 27 #include "components/sync/engine_impl/sync_scheduler.h"
28 #include "components/sync/engine_impl/syncer.h" 28 #include "components/sync/engine_impl/syncer.h"
29 29
30 namespace syncer { 30 namespace syncer {
31 31
32 class BackoffDelayProvider; 32 class BackoffDelayProvider;
33 struct ModelNeutralState; 33 struct ModelNeutralState;
34 34
35 class SyncSchedulerImpl : public SyncScheduler, public base::NonThreadSafe { 35 class SyncSchedulerImpl : public SyncScheduler {
36 public: 36 public:
37 // |name| is a display string to identify the syncer thread. Takes 37 // |name| is a display string to identify the syncer thread. Takes
38 // |ownership of |syncer| and |delay_provider|. 38 // |ownership of |syncer| and |delay_provider|.
39 SyncSchedulerImpl(const std::string& name, 39 SyncSchedulerImpl(const std::string& name,
40 BackoffDelayProvider* delay_provider, 40 BackoffDelayProvider* delay_provider,
41 SyncCycleContext* context, 41 SyncCycleContext* context,
42 Syncer* syncer, 42 Syncer* syncer,
43 bool ignore_auth_credentials); 43 bool ignore_auth_credentials);
44 44
45 // Calls Stop(). 45 // Calls Stop().
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // after NETWORK_UNAVAILABLE error). 287 // after NETWORK_UNAVAILABLE error).
288 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl. 288 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl.
289 JobPriority next_sync_cycle_job_priority_; 289 JobPriority next_sync_cycle_job_priority_;
290 290
291 // One-shot timer for scheduling GU retry according to delay set by server. 291 // One-shot timer for scheduling GU retry according to delay set by server.
292 base::OneShotTimer retry_timer_; 292 base::OneShotTimer retry_timer_;
293 293
294 // Dictates if the scheduler should wait for authentication to happen or not. 294 // Dictates if the scheduler should wait for authentication to happen or not.
295 bool ignore_auth_credentials_; 295 bool ignore_auth_credentials_;
296 296
297 SEQUENCE_CHECKER(sequence_checker_);
298
297 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; 299 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
298 300
299 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); 301 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
300 }; 302 };
301 303
302 } // namespace syncer 304 } // namespace syncer
303 305
304 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 306 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « components/sync/engine_impl/js_mutation_event_observer.cc ('k') | components/sync/engine_impl/sync_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698