OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "sync/engine/sync_scheduler_impl.h" | 5 #include "sync/engine/sync_scheduler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return false; | 145 return false; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 } // namespace | 149 } // namespace |
150 | 150 |
151 SyncSchedulerImpl::SyncSchedulerImpl(const std::string& name, | 151 SyncSchedulerImpl::SyncSchedulerImpl(const std::string& name, |
152 BackoffDelayProvider* delay_provider, | 152 BackoffDelayProvider* delay_provider, |
153 sessions::SyncSessionContext* context, | 153 sessions::SyncSessionContext* context, |
154 Syncer* syncer) | 154 Syncer* syncer) |
155 : weak_ptr_factory_(this), | 155 : name_(name), |
156 weak_ptr_factory_for_weak_handle_(this), | |
157 weak_handle_this_(MakeWeakHandle( | |
158 weak_ptr_factory_for_weak_handle_.GetWeakPtr())), | |
159 name_(name), | |
160 started_(false), | 156 started_(false), |
161 syncer_short_poll_interval_seconds_( | 157 syncer_short_poll_interval_seconds_( |
162 TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds)), | 158 TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds)), |
163 syncer_long_poll_interval_seconds_( | 159 syncer_long_poll_interval_seconds_( |
164 TimeDelta::FromSeconds(kDefaultLongPollIntervalSeconds)), | 160 TimeDelta::FromSeconds(kDefaultLongPollIntervalSeconds)), |
165 sessions_commit_delay_( | 161 sessions_commit_delay_( |
166 TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds)), | 162 TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds)), |
167 mode_(NORMAL_MODE), | 163 mode_(NORMAL_MODE), |
168 delay_provider_(delay_provider), | 164 delay_provider_(delay_provider), |
169 syncer_(syncer), | 165 syncer_(syncer), |
170 session_context_(context), | 166 session_context_(context), |
171 no_scheduling_allowed_(false), | 167 no_scheduling_allowed_(false), |
172 do_poll_after_credentials_updated_(false) { | 168 do_poll_after_credentials_updated_(false), |
| 169 weak_ptr_factory_(this), |
| 170 weak_ptr_factory_for_weak_handle_(this) { |
| 171 weak_handle_this_ = MakeWeakHandle( |
| 172 weak_ptr_factory_for_weak_handle_.GetWeakPtr()); |
173 } | 173 } |
174 | 174 |
175 SyncSchedulerImpl::~SyncSchedulerImpl() { | 175 SyncSchedulerImpl::~SyncSchedulerImpl() { |
176 DCHECK(CalledOnValidThread()); | 176 DCHECK(CalledOnValidThread()); |
177 Stop(); | 177 Stop(); |
178 } | 178 } |
179 | 179 |
180 void SyncSchedulerImpl::OnCredentialsUpdated() { | 180 void SyncSchedulerImpl::OnCredentialsUpdated() { |
181 DCHECK(CalledOnValidThread()); | 181 DCHECK(CalledOnValidThread()); |
182 | 182 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 | 894 |
895 #undef SDVLOG_LOC | 895 #undef SDVLOG_LOC |
896 | 896 |
897 #undef SDVLOG | 897 #undef SDVLOG |
898 | 898 |
899 #undef SLOG | 899 #undef SLOG |
900 | 900 |
901 #undef ENUM_CASE | 901 #undef ENUM_CASE |
902 | 902 |
903 } // namespace syncer | 903 } // namespace syncer |
OLD | NEW |