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

Unified Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 2722643003: [Bookmark Manager] Add first meaningful paint metric to bookmark manager. (Closed)
Patch Set: Created 3 years, 10 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/bookmark_manager/js/main.js
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js
index 319397ecf807d6e2bb9a6e96c33d3677e4bc0d8e..ce3418323bfcec97cff04eb5cf6c871f306c1b5e 100644
--- a/chrome/browser/resources/bookmark_manager/js/main.js
+++ b/chrome/browser/resources/bookmark_manager/js/main.js
@@ -71,6 +71,11 @@ var searchTreeItem = new TreeItem({
});
/**
+ * @type {boolean}
+ */
+var firstLoad = true;
+
+/**
* Command shortcut mapping.
* @const
*/
@@ -191,6 +196,8 @@ function updateParentId(id) {
// Process the location hash. This is called by onhashchange and when the page
// is first loaded.
function processHash() {
+ var wasFirstLoad = firstLoad;
+ firstLoad = false;
var id = window.location.hash.slice(1);
if (!id) {
// If we do not have a hash, select first item in the tree.
@@ -240,6 +247,14 @@ function processHash() {
chrome.bookmarks.get(id, function(items) {
if (items && items.length == 1)
updateParentId(id);
+
+ if (wasFirstLoad) {
+ setTimeout(function() {
+ chrome.metricsPrivate.recordTime(
+ 'BookmarkManager.ResultsRenderedTime',
+ Math.floor(window.performance.now()));
+ });
+ }
});
}
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698