Bug 479006 - get rid of crufty timeline service globals [dead code]. r=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sat, 19 Oct 2019 17:24:00 +0200
changeset 80385 b0211b8216502b456a5cac312f82407fbcdf3c44
parent 80380 de1e28a237a6681e5f5bd6e30e869a2da46d8db9
child 80386 32e57b35f3f0e1c77f7736851e8f4e7377263a95
push id9583
push usergeoff@darktrojan.net
push dateMon, 21 Oct 2019 03:01:29 +0000
treeherdertry-comm-central@0c79d985a4df [default view] [failures only]
reviewersfrg
bugs479006
Bug 479006 - get rid of crufty timeline service globals [dead code]. r=frg
mail/base/content/SearchDialog.js
mailnews/mailnews.js
suite/mailnews/content/SearchDialog.js
suite/mailnews/content/commandglue.js
suite/mailnews/content/mailWindow.js
suite/mailnews/content/mailWindowOverlay.js
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -23,17 +23,16 @@ var gCurrentFolder;
 
 var gFolderDisplay;
 // Although we don't display messages, we have a message display object to
 //  simplify our code.  It's just always disabled.
 var gMessageDisplay;
 
 var gFolderPicker;
 var gStatusFeedback;
-var gTimelineEnabled = false;
 var gSearchBundle;
 
 // Datasource search listener -- made global as it has to be registered
 // and unregistered in different functions.
 var gDataSourceSearchListener;
 var gViewSearchListener;
 
 var gSearchStopButton;
--- a/mailnews/mailnews.js
+++ b/mailnews/mailnews.js
@@ -1,19 +1,16 @@
 /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // SpaceHit() function: whether spacebar advances to next unread message.
 pref("mail.advance_on_spacebar", true);
 
-//mailnews.timeline_is_enabled should be set to true ONLY for perf measurement-timeline builds.
-pref("mailnews.timeline_is_enabled", false);
-
 pref("mailnews.logComposePerformance", false);
 
 pref("mail.wrap_long_lines",                true);
 
 // Show attachments of supported types rendered directly in the message body view.
 pref("mail.inline_attachments",             true);
 // When rendering attachments inline, show also text attachments (e.g. CSV, HTML,
 // plain text) which are potentially very long.
--- a/suite/mailnews/content/SearchDialog.js
+++ b/suite/mailnews/content/SearchDialog.js
@@ -13,17 +13,16 @@ var gMsgFolderSelected;
 var nsIMsgFolder = Ci.nsIMsgFolder;
 var nsIMsgWindow = Ci.nsIMsgWindow;
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 
 var gFolderDatasource;
 var gFolderPicker;
 var gStatusBar = null;
 var gStatusFeedback = new nsMsgStatusFeedback();
-var gTimelineEnabled = false;
 var gMessengerBundle = null;
 var RDF;
 var gSearchBundle;
 var gNextMessageViewIndexAfterDelete = -2;
 
 // Datasource search listener -- made global as it has to be registered
 // and unregistered in different functions.
 var gDataSourceSearchListener;
--- a/suite/mailnews/content/commandglue.js
+++ b/suite/mailnews/content/commandglue.js
@@ -696,21 +696,16 @@ function FolderPaneSelectionChange()
     // has right-clicked on a folder different from the one that was
     // originally highlighted.  On a right-click, the highlight (selection)
     // of a row will be different from the value of currentIndex, thus if
     // the currentIndex is not selected, it means the user right-clicked
     // and we don't want to load the contents of the folder.
     if (!folderSelection.isSelected(folderSelection.currentIndex))
       return;
 
-    if(gTimelineEnabled) {
-      gTimelineService.startTimer("FolderLoading");
-      gTimelineService.enter("FolderLoading has Started");
-    }
-
     gVirtualFolderTerms = null;
     gXFVirtualFolderTerms = null;
 
     let folders = GetSelectedMsgFolders();
     if (folders.length == 1)
     {
         let msgFolder = folders[0];
         let uriToLoad = msgFolder.URI;
@@ -940,17 +935,16 @@ var gSearchSession;
 
 var nsIMsgFolder = Ci.nsIMsgFolder;
 var nsIMsgWindow = Ci.nsIMsgWindow;
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 
 var gFolderDatasource;
 var gFolderPicker;
 var gStatusBar = null;
-var gTimelineEnabled = false;
 var gMessengerBundle = null;
 
 // Datasource search listener -- made global as it has to be registered
 // and unregistered in different functions.
 var gDataSourceSearchListener;
 var gViewSearchListener;
 
 var gMailSession;
--- a/suite/mailnews/content/mailWindow.js
+++ b/suite/mailnews/content/mailWindow.js
@@ -475,21 +475,16 @@ nsMsgStatusFeedback.prototype =
       if (this.stopTimeoutID)
       {
         clearTimeout(this.stopTimeoutID);
         this.stopTimeoutID = null;
       }
   },
    _stopMeteors : function()
     {
-      if(gTimelineEnabled){
-        gTimelineService.stopTimer("FolderLoading");
-        gTimelineService.markTimer("FolderLoading");
-        gTimelineService.resetTimer("FolderLoading");
-      }
       this.ensureStatusFields();
       this.showStatusString(this.myDefaultStatus);
 
       // stop the throbber
       if (this.throbber)
         this.throbber.setAttribute("busy", false);
 
       // Turn progress meter off.
--- a/suite/mailnews/content/mailWindowOverlay.js
+++ b/suite/mailnews/content/mailWindowOverlay.js
@@ -32,32 +32,16 @@ var kNotAPhishMessage = 1;
 var kMsgForwardAsAttachment = 0;
 
 var gMessengerBundle;
 var gOfflineManager;
 var gCopyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                      .getService(Ci.nsIMsgCopyService);
 var gMarkViewedMessageAsReadTimer = null; // if the user has configured the app to mark a message as read if it is viewed for more than n seconds
 
-var gTimelineService = null;
-var gTimelineEnabled = ("@mozilla.org;timeline-service;1" in Cc);
-if (gTimelineEnabled) {
-  try {
-    gTimelineEnabled = Services.prefs.getBoolPref("mailnews.timeline_is_enabled");
-    if (gTimelineEnabled) {
-      gTimelineService =
-        Cc["@mozilla.org;timeline-service;1"].getService(Ci.nsITimelineService);
-    }
-  }
-  catch (ex)
-  {
-    gTimelineEnabled = false;
-  }
-}
-
 var gDisallow_classes_no_html = 1; /* the user preference,
      if HTML is not allowed. I assume, that the user could have set this to a
      value > 1 in his prefs.js or user.js, but that the value will not
      change during runtime other than through the MsgBody*() functions below.*/
 
 // Disable the File | New | Account... menu item if the account preference is locked.
 // Two other affected areas are the account central and the account manager dialogs.
 function menu_new_init()