| Index: components/ntp_snippets/remote/ntp_snippets_service.cc
|
| diff --git a/components/ntp_snippets/remote/ntp_snippets_service.cc b/components/ntp_snippets/remote/ntp_snippets_service.cc
|
| index 63b79593e1d0730564daea882de936a42c83adc5..6767c607ce0ad903bed82866138ef8ee74635752 100644
|
| --- a/components/ntp_snippets/remote/ntp_snippets_service.cc
|
| +++ b/components/ntp_snippets/remote/ntp_snippets_service.cc
|
| @@ -213,6 +213,7 @@ NTPSnippetsService::NTPSnippetsService(
|
|
|
| // We transition to other states while finalizing the initialization, when the
|
| // database is done loading.
|
| + database_load_start_ = base::TimeTicks::Now();
|
| database_->LoadSnippets(base::Bind(&NTPSnippetsService::OnDatabaseLoaded,
|
| base::Unretained(this)));
|
| }
|
| @@ -472,6 +473,11 @@ void NTPSnippetsService::OnDatabaseLoaded(NTPSnippet::PtrVector snippets) {
|
| DCHECK(state_ == State::NOT_INITED);
|
| DCHECK(base::ContainsKey(categories_, articles_category_));
|
|
|
| + base::TimeDelta database_load_time =
|
| + base::TimeTicks::Now() - database_load_start_;
|
| + UMA_HISTOGRAM_MEDIUM_TIMES("NewTabPage.Snippets.DatabaseLoadTime",
|
| + database_load_time);
|
| +
|
| NTPSnippet::PtrVector to_delete;
|
| for (std::unique_ptr<NTPSnippet>& snippet : snippets) {
|
| Category snippet_category =
|
|
|