| Index: ios/chrome/browser/application_context_impl.cc
|
| diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc
|
| index 6f17dc2bfd5ac158c6b7717246c302eca4536079..d38e98f17fa9b1866cd945f01a30007ebf0057ec 100644
|
| --- a/ios/chrome/browser/application_context_impl.cc
|
| +++ b/ios/chrome/browser/application_context_impl.cc
|
| @@ -105,12 +105,13 @@ void ApplicationContextImpl::PreMainMessageLoopRun() {
|
|
|
| void ApplicationContextImpl::StartTearDown() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - // We need to destroy the MetricsServicesManager before the IO thread gets
|
| - // destroyed, since the destructor can call the URLFetcher destructor, which
|
| - // does a PostDelayedTask operation on the IO thread. (The IO thread will
|
| - // handle that URLFetcher operation before going away.)
|
| + // We need to destroy the MetricsServicesManager and NetworkTimeTracker before
|
| + // the IO thread gets destroyed, since the destructor can call the URLFetcher
|
| + // destructor, which does a PostDelayedTask operation on the IO thread. (The
|
| + // IO thread will handle that URLFetcher operation before going away.)
|
|
|
| metrics_services_manager_.reset();
|
| + network_time_tracker_.reset();
|
|
|
| // Need to clear browser states before the IO thread.
|
| chrome_browser_state_manager_.reset();
|
| @@ -254,7 +255,8 @@ ApplicationContextImpl::GetNetworkTimeTracker() {
|
| if (!network_time_tracker_) {
|
| network_time_tracker_.reset(new network_time::NetworkTimeTracker(
|
| base::WrapUnique(new base::DefaultClock),
|
| - base::WrapUnique(new base::DefaultTickClock), GetLocalState()));
|
| + base::WrapUnique(new base::DefaultTickClock), GetLocalState(),
|
| + GetSystemURLRequestContext()));
|
| }
|
| return network_time_tracker_.get();
|
| }
|
|
|