Chromium Code Reviews| Index: chrome/browser/sync/engine/sync_scheduler.cc |
| diff --git a/chrome/browser/sync/engine/sync_scheduler.cc b/chrome/browser/sync/engine/sync_scheduler.cc |
| index 82a847639a2f6d017ac842951f1abc5b7e4e08f1..909d1760640f60f44148b60022738bcb7964d892 100644 |
| --- a/chrome/browser/sync/engine/sync_scheduler.cc |
| +++ b/chrome/browser/sync/engine/sync_scheduler.cc |
| @@ -135,6 +135,12 @@ SyncScheduler::WaitInterval::WaitInterval(Mode mode, TimeDelta length) |
| #define SVLOG_LOC(from_here, verbose_level) \ |
| VLOG_LOC(from_here, verbose_level) << name_ << ": " |
| +namespace { |
| + |
| +const int kDefaultSessionsCommitDelaySeconds = 10; |
|
tim (not reviewing)
2011/08/10 18:42:11
I was hoping to keep consts like this in one place
akalin
2011/08/10 20:10:36
I think it's okay for now since it's temp code. I
|
| + |
| +} // namespace |
| + |
| SyncScheduler::SyncScheduler(const std::string& name, |
| sessions::SyncSessionContext* context, |
| Syncer* syncer) |
| @@ -146,6 +152,8 @@ SyncScheduler::SyncScheduler(const std::string& name, |
| TimeDelta::FromSeconds(kDefaultShortPollIntervalSeconds)), |
| syncer_long_poll_interval_seconds_( |
| TimeDelta::FromSeconds(kDefaultLongPollIntervalSeconds)), |
| + sessions_commit_delay_( |
| + TimeDelta::FromSeconds(kDefaultSessionsCommitDelaySeconds)), |
| mode_(NORMAL_MODE), |
| server_connection_ok_(false), |
| delay_provider_(new DelayProvider()), |
| @@ -1063,6 +1071,12 @@ void SyncScheduler::OnReceivedLongPollIntervalUpdate( |
| syncer_long_poll_interval_seconds_ = new_interval; |
| } |
| +void SyncScheduler::OnReceivedSessionsCommitDelay( |
| + const base::TimeDelta& new_delay) { |
| + DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| + sessions_commit_delay_ = new_delay; |
| +} |
| + |
| void SyncScheduler::OnShouldStopSyncingPermanently() { |
| DCHECK_EQ(MessageLoop::current(), sync_loop_); |
| SVLOG(2) << "OnShouldStopSyncingPermanently"; |
| @@ -1084,16 +1098,16 @@ void SyncScheduler::set_notifications_enabled(bool notifications_enabled) { |
| session_context_->set_notifications_enabled(notifications_enabled); |
| } |
| +base::TimeDelta SyncScheduler::GetSessionsCommitDelay() const { |
| + return sessions_commit_delay_; |
|
tim (not reviewing)
2011/08/10 18:42:11
The style guide would recommend calling this metho
akalin
2011/08/10 20:10:36
Done.
|
| +} |
| + |
| #undef SVLOG_LOC |
| #undef SVLOG |
| #undef SLOG |
| -#undef VLOG_LOC |
| - |
| -#undef VLOG_LOC_STREAM |
| - |
| #undef ENUM_CASE |
| } // browser_sync |