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

Unified Diff: ui/file_manager/file_manager/foreground/js/file_manager.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 | « ui/file_manager/file_manager/foreground/js/elements_importer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_manager.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js
index c2ead98156c42c858d1803c807ff96c95b2f6b1d..ea40548ec0f2e7929869891d20edc4b89899e9cc 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -466,9 +466,13 @@ FileManager.prototype = /** @struct */ {
* @private
*/
FileManager.prototype.startInitSettings_ = function() {
+ metrics.startInterval('Load.InitSettings');
this.appStateController_ = new AppStateController(this.dialogType);
return new Promise(function(resolve) {
- this.appStateController_.loadInitialViewOptions().then(resolve);
+ this.appStateController_.loadInitialViewOptions().then(function() {
+ metrics.recordInterval('Load.InitSettings');
+ resolve();
+ });
}.bind(this));
};
@@ -715,16 +719,20 @@ FileManager.prototype = /** @struct */ {
this.dialogDom_ = dialogDom;
this.document_ = this.dialogDom_.ownerDocument;
+ metrics.startInterval('Load.InitDocuments');
return Promise.all([
this.initBackgroundPagePromise_,
window.importElementsPromise
]).then(function() {
+ metrics.recordInterval('Load.InitDocuments');
+ metrics.startInterval('Load.InitUI');
this.initEssentialUI_();
this.initAdditionalUI_();
return this.initSettingsPromise_;
}.bind(this)).then(function() {
this.initFileSystemUI_();
this.initUIFocus_();
+ metrics.recordInterval('Load.InitUI');
}.bind(this));
};
@@ -770,6 +778,7 @@ FileManager.prototype = /** @struct */ {
*/
FileManager.prototype.startInitBackgroundPage_ = function() {
return new Promise(function(resolve) {
+ metrics.startInterval('Load.InitBackgroundPage');
chrome.runtime.getBackgroundPage(/** @type {function(Window=)} */ (
function(opt_backgroundPage) {
assert(opt_backgroundPage);
@@ -787,6 +796,7 @@ FileManager.prototype = /** @struct */ {
this.backgroundPage_.background.mediaScanner;
this.historyLoader_ =
this.backgroundPage_.background.historyLoader;
+ metrics.recordInterval('Load.InitBackgroundPage');
resolve();
}.bind(this));
}.bind(this)));
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/elements_importer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698