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

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

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Merge pref changes from https://codereview.chromium.org/2528163002/. Created 4 years 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>
(...skipping 23 matching lines...) Expand all
34 class BackoffDelayProvider; 34 class BackoffDelayProvider;
35 struct ModelNeutralState; 35 struct ModelNeutralState;
36 36
37 class SyncSchedulerImpl : public SyncScheduler, public base::NonThreadSafe { 37 class SyncSchedulerImpl : public SyncScheduler, public base::NonThreadSafe {
38 public: 38 public:
39 // |name| is a display string to identify the syncer thread. Takes 39 // |name| is a display string to identify the syncer thread. Takes
40 // |ownership of |syncer| and |delay_provider|. 40 // |ownership of |syncer| and |delay_provider|.
41 SyncSchedulerImpl(const std::string& name, 41 SyncSchedulerImpl(const std::string& name,
42 BackoffDelayProvider* delay_provider, 42 BackoffDelayProvider* delay_provider,
43 SyncCycleContext* context, 43 SyncCycleContext* context,
44 Syncer* syncer); 44 Syncer* syncer,
45 bool local_sync_backend_enabled);
Nicolas Zea 2016/12/15 00:37:28 nit: how about renaming this to ignore_auth_creden
pastarmovj 2016/12/16 17:04:48 Done.
45 46
46 // Calls Stop(). 47 // Calls Stop().
47 ~SyncSchedulerImpl() override; 48 ~SyncSchedulerImpl() override;
48 49
49 void Start(Mode mode, base::Time last_poll_time) override; 50 void Start(Mode mode, base::Time last_poll_time) override;
50 void ScheduleConfiguration(const ConfigurationParams& params) override; 51 void ScheduleConfiguration(const ConfigurationParams& params) override;
51 void ScheduleClearServerData(const ClearParams& params) override; 52 void ScheduleClearServerData(const ClearParams& params) override;
52 void Stop() override; 53 void Stop() override;
53 void ScheduleLocalNudge( 54 void ScheduleLocalNudge(
54 ModelTypeSet types, 55 ModelTypeSet types,
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // time TrySyncCycleJobImpl is called. CANARY_PRIORITY allows syncer to run 286 // time TrySyncCycleJobImpl is called. CANARY_PRIORITY allows syncer to run
286 // even if scheduler is in exponential backoff. This is needed for events that 287 // even if scheduler is in exponential backoff. This is needed for events that
287 // have chance of resolving previous error (e.g. network connection change 288 // have chance of resolving previous error (e.g. network connection change
288 // after NETWORK_UNAVAILABLE error). 289 // after NETWORK_UNAVAILABLE error).
289 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl. 290 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl.
290 JobPriority next_sync_cycle_job_priority_; 291 JobPriority next_sync_cycle_job_priority_;
291 292
292 // One-shot timer for scheduling GU retry according to delay set by server. 293 // One-shot timer for scheduling GU retry according to delay set by server.
293 base::OneShotTimer retry_timer_; 294 base::OneShotTimer retry_timer_;
294 295
296 // Whether the local file based sync backend should be enabled. Dictates if
297 // the sheduler should wait for authentication to happen or not.
298 bool local_sync_backend_enabled_;
299
295 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; 300 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
296 301
297 // A second factory specially for weak_handle_this_, to allow the handle 302 // A second factory specially for weak_handle_this_, to allow the handle
298 // to be const and alleviate threading concerns. 303 // to be const and alleviate threading concerns.
299 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_; 304 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
300 305
301 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); 306 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
302 }; 307 };
303 308
304 } // namespace syncer 309 } // namespace syncer
305 310
306 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 311 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698