Chromium Code Reviews| Index: chrome/browser/sync/glue/sync_backend_host_impl.cc |
| diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc |
| index 4bb16f5dfdcadacd1cdad8667537c8fd48f17721..85dcaf92b081c51a7318dd8c6bb84f0aba6333ae 100644 |
| --- a/chrome/browser/sync/glue/sync_backend_host_impl.cc |
| +++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| +#include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/invalidation/invalidation_service_factory.h" |
| #include "chrome/browser/network_time/network_time_tracker.h" |
| @@ -42,6 +43,28 @@ using syncer::InternalComponentsFactory; |
| namespace browser_sync { |
| +namespace { |
| + |
| +void UpdateNetworkTimeOnUIThread(const base::Time& network_time, |
|
sky
2014/05/16 17:37:32
nit: we generally don't use const references for t
hashimoto
2014/05/19 03:42:39
Oh, I didn't know that base/time/time.h explicitly
|
| + const base::TimeDelta& resolution, |
| + const base::TimeDelta& latency, |
| + const base::TimeTicks& post_time) { |
| + g_browser_process->network_time_tracker()->UpdateNetworkTime( |
| + network_time, resolution, latency, post_time); |
| +} |
| + |
| +void UpdateNetworkTime(const base::Time& network_time, |
| + const base::TimeDelta& resolution, |
| + const base::TimeDelta& latency) { |
| + content::BrowserThread::PostTask( |
|
sky
2014/05/16 17:17:43
I'm not familiar with this code. But question. Is
hashimoto
2014/05/16 17:29:32
base::TimeTicks::Now() passed as |post_time| to Up
|
| + content::BrowserThread::UI, |
| + FROM_HERE, |
| + base::Bind(&UpdateNetworkTimeOnUIThread, |
| + network_time, resolution, latency, base::TimeTicks::Now())); |
| +} |
| + |
| +} // namespace |
| + |
| SyncBackendHostImpl::SyncBackendHostImpl( |
| const std::string& name, |
| Profile* profile, |
| @@ -121,7 +144,7 @@ void SyncBackendHostImpl::Initialize( |
| sync_service_url, |
| network_resources->GetHttpPostProviderFactory( |
| make_scoped_refptr(profile_->GetRequestContext()), |
| - NetworkTimeTracker::BuildNotifierUpdateCallback(), |
| + base::Bind(&UpdateNetworkTime), |
| core_->GetRequestContextCancelationSignal()), |
| credentials, |
| invalidator_->GetInvalidatorClientId(), |
| @@ -845,4 +868,3 @@ base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
| #undef SDVLOG |
| #undef SLOG |
| - |