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

Unified Diff: ui/file_manager/file_manager/foreground/js/elements_importer.js

Issue 2589693002: Files App: add more performance metrics for foreground initialization. (Closed)
Patch Set: Move the position of InitBackgroundPage Created 4 years 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 | « tools/metrics/histograms/histograms.xml ('k') | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/elements_importer.js
diff --git a/ui/file_manager/file_manager/foreground/js/elements_importer.js b/ui/file_manager/file_manager/foreground/js/elements_importer.js
index c821ad9bb48cc583fd770903e07d0269082323ba..0d9d88d1ccbdee044f207e86fbe43e320bb4cc66 100644
--- a/ui/file_manager/file_manager/foreground/js/elements_importer.js
+++ b/ui/file_manager/file_manager/foreground/js/elements_importer.js
@@ -10,11 +10,17 @@ window.Polymer.dom = 'shadow';
* elements for file manager UI are loaded.
*/
window.importElementsPromise = new Promise(function(resolve, reject) {
+ var startTime = Date.now();
+
var link = document.createElement('link');
link.rel = 'import';
link.href = 'foreground/elements/elements_bundle.html';
link.setAttribute('async', '');
- link.onload = resolve;
+ link.onload = function() {
+ chrome.metricsPrivate.recordTime(
+ 'FileBrowser.Load.ImportElements', Date.now() - startTime);
+ resolve();
+ };
link.onerror = reject;
document.head.appendChild(link);
});
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698