Chromium Code Reviews| Index: chrome/browser/resources/history/history.js |
| diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js |
| index 7643b8fd336866b834cfcf4ee793251c74102bde..b22f731a3cdabf1e3d4893e3e19c651d87a166ac 100644 |
| --- a/chrome/browser/resources/history/history.js |
| +++ b/chrome/browser/resources/history/history.js |
| @@ -75,6 +75,14 @@ function recordUmaHistogram(histogram, maxBucketValue, value) { |
| maxBucketValue]); |
| } |
| +/** |
| + * Record the current time in milliseconds since pageload into a UMA histogram. |
| + * @param {string} histogram The name of the histogram to be recorded in. |
| + */ |
| +function recordTimeHistogram(histogram) { |
|
calamity
2016/08/03 08:23:22
Is this worth moving into cr_util.js?
calamity
2016/08/03 08:23:22
Param no longer needed?
Dan Beam
2016/08/03 21:05:17
why not just inline this method? it's only used o
tsergeant
2016/08/03 22:53:56
Sure, inlined.
|
| + chrome.send('metricsHandler:recordTime', [histogram, performance.now()]); |
| +} |
| + |
| /////////////////////////////////////////////////////////////////////////////// |
| // Visit: |
| @@ -939,6 +947,7 @@ function HistoryView(model) { |
| this.model_ = model; |
| this.pageIndex_ = 0; |
| this.lastDisplayed_ = []; |
| + this.hasRenderedResults_ = false; |
| this.model_.setView(this); |
| @@ -1122,6 +1131,13 @@ HistoryView.prototype.onModelReady = function(doneLoading) { |
| var isSearch = this.model_.getSearchText().length > 0; |
| $('search-field').hidden = !(hasResults || isSearch); |
| } |
| + |
| + if (!this.hasRenderedResults_) { |
| + this.hasRenderedResults_ = true; |
| + requestAnimationFrame(function() { |
|
tsergeant
2016/08/03 07:37:04
I have two main options here:
* requestAnimationF
calamity
2016/08/03 08:23:23
rAF sgtm.
|
| + recordTimeHistogram('History.ResultsRenderedTime'); |
| + }); |
| + } |
| }; |
| /** |