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

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

Issue 22815003: Add detailed performance histograms to Files.app. (Abandoned) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed + rebased. Created 7 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
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index a9d59b8298b5bd387927496e4a00956b4a34abec..221f4291f70ad3283c94cc78c8b915fe23d1a6a0 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -210,6 +210,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
};
FileManager.prototype.initPreferences_ = function(callback) {
+ metrics.startInterval('Load.Preferences');
var group = new AsyncUtil.Group();
// DRIVE preferences should be initialized before creating DirectoryModel
@@ -250,7 +251,10 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
// TODO(yoshiki): Remove this in M31 http://crbug.com/268784/
chrome.storage.local.remove('folder-shortcuts-list');
- group.run(callback);
+ group.run(function() {
+ metrics.recordInterval('Load.Preferences');
+ callback();
+ });
};
/**
@@ -286,6 +290,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initFileSystemUI_ = function(callback) {
+ metrics.startInterval('Load.FileSystemUI');
this.table_.startBatchUpdates();
this.grid_.startBatchUpdates();
@@ -410,6 +415,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.table_.endBatchUpdates();
this.grid_.endBatchUpdates();
+ metrics.recordInterval('Load.FileSystemUI');
callback();
};
@@ -721,6 +727,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initGeneral_ = function(callback) {
+ metrics.startInterval('Load.General');
if (window.appState) {
this.params_ = window.appState.params || {};
this.defaultPath = window.appState.defaultPath;
@@ -730,6 +737,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
{};
this.defaultPath = this.params_.defaultPath;
}
+ metrics.recordInterval('Load.General');
callback();
};
@@ -740,16 +748,19 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initStrings_ = function(callback) {
+ metrics.startInterval('Load.Strings');
// Fetch the strings via the private api if running in the browser window.
// Otherwise, read cached strings from the local storage.
if (util.platform.runningInBrowser()) {
chrome.fileBrowserPrivate.getStrings(function(strings) {
loadTimeData.data = strings;
+ metrics.recordInterval('Load.Strings');
callback();
});
} else {
chrome.storage.local.get('strings', function(items) {
loadTimeData.data = items['strings'];
+ metrics.recordInterval('Load.Strings');
callback();
});
}
@@ -777,6 +788,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initEssentialUI_ = function(callback) {
+ metrics.startInterval('Load.EssentialUI');
this.listType_ = null;
this.filesystemObserverId_ = null;
@@ -826,13 +838,16 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.initDialogType_();
+ metrics.recordInterval('Load.Display');
+ metrics.recordInterval('Load.EssentialUI');
+
// Show the window as soon as the UI pre-initialization is done.
if (this.dialogType == DialogType.FULL_PAGE &&
!util.platform.runningInBrowser()) {
chrome.app.window.current().show();
setTimeout(callback, 100); // Wait until the animation is finished.
} else {
- callback();
+ callback();
}
};
@@ -862,6 +877,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
* @private
*/
FileManager.prototype.initAdditionalUI_ = function(callback) {
+ metrics.startInterval('Load.AdditionalUI');
this.initDialogs_();
this.dialogDom_.addEventListener('drop', function(e) {
@@ -1058,6 +1074,7 @@ var BOTTOM_MARGIN_FOR_PREVIEW_PANEL_PX = 52;
this.table_.normalizeColumns();
this.table_.redraw();
+ metrics.recordInterval('Load.AdditionalUI');
callback();
};
« no previous file with comments | « chrome/browser/resources/file_manager/js/directory_model.js ('k') | chrome/browser/resources/file_manager/js/metrics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698