Chromium Code Reviews| Index: chrome/browser/win/jumplist.cc |
| diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc |
| index 7ebb5eab0553e7be09175a4f82c941bac03e2de6..9e641789593c95874358a947f85e66fdf8f47a44 100644 |
| --- a/chrome/browser/win/jumplist.cc |
| +++ b/chrome/browser/win/jumplist.cc |
| @@ -753,6 +753,9 @@ void JumpList::CreateNewJumpListAndNotifyOS( |
| return; |
| } |
| + base::TimeDelta most_visited_category_time = |
| + add_custom_category_timer.Elapsed(); |
| + |
| // Update the "Recently Closed" category of the JumpList. |
| if (!jumplist_updater.AddCustomCategory( |
| l10n_util::GetStringUTF16(IDS_RECENTLY_CLOSED), recently_closed_pages, |
| @@ -760,9 +763,22 @@ void JumpList::CreateNewJumpListAndNotifyOS( |
| return; |
| } |
| + base::TimeDelta add_category_total_time = add_custom_category_timer.Elapsed(); |
| + |
| + double most_visited_over_recently_closed = |
| + most_visited_category_time.InMillisecondsF() / |
| + (add_category_total_time - most_visited_category_time).InMillisecondsF(); |
|
Ilya Sherman
2017/07/04 03:41:19
nit: Mebbe move this into the if-stmt?
chengx
2017/07/04 06:02:16
Done.
|
| + |
| + if (recently_closed_pages.size() == kRecentlyClosedItems && |
| + most_visited_pages.size() == kMostVisitedItems) { |
| + // TODO(chengx): Remove the UMA histogram after fixing crbug/736530. |
| + UMA_HISTOGRAM_COUNTS_100("WinJumplist.AddCategoryTimeComparison", |
| + (int)(most_visited_over_recently_closed * 10)); |
|
Ilya Sherman
2017/07/04 03:41:19
Why are you multiplying by 10? It's not clear to
chengx
2017/07/04 06:02:16
The ration is typically between 1 and 10. I multip
|
| + } |
| + |
| // If AddCustomCategory takes longer than the maximum allowed time, abort the |
| // current update and skip the next |kUpdatesToSkipUnderHeavyLoad| updates. |
| - if (add_custom_category_timer.Elapsed() >= kTimeOutForAddCustomCategory) { |
| + if (add_category_total_time >= kTimeOutForAddCustomCategory) { |
| update_transaction->update_timeout = true; |
| return; |
| } |