Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: chrome/browser/resources/history/history.js

Issue 2203263002: History: Add load-time metric for non-MD and MD History WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isherman@ review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5ca33c68c215669b61205f32eb35223be17c88a2 100644
--- a/chrome/browser/resources/history/history.js
+++ b/chrome/browser/resources/history/history.js
@@ -939,6 +939,7 @@ function HistoryView(model) {
this.model_ = model;
this.pageIndex_ = 0;
this.lastDisplayed_ = [];
+ this.hasRenderedResults_ = false;
this.model_.setView(this);
@@ -1122,6 +1123,15 @@ 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() {
+ chrome.send(
+ 'metricsHandler:recordTime',
+ ['History.ResultsRenderedTime', window.performance.now()]);
+ });
+ }
};
/**
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/history.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698