Bug 1469459 - ESLint fixes in calendar/. r+a=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 22 Jun 2018 17:38:46 +1200
changeset 31457 ecbb3575019d6c0aba3f7d9048637dc1a595605b
parent 31456 c18560d6ce40848b44d62525bc997cc1a448929a
child 31458 2f664c4e1d7a40556db2f9af3bccbbfa6add79a1
push id2260
push usermozilla@jorgk.com
push dateWed, 04 Jul 2018 07:20:31 +0000
treeherdercomm-beta@d8d4f094a0af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1469459
Bug 1469459 - ESLint fixes in calendar/. r+a=philipp MozReview-Commit-ID: AGLuFniyX3o MozReview-Commit-ID: EOYZGjkTukK
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-base-view.xml
calendar/base/content/calendar-chrome-startup.js
calendar/base/content/calendar-dnd-listener.js
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/calendar-management.js
calendar/base/content/calendar-statusbar.js
calendar/base/content/calendar-task-editing.js
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-views.js
calendar/base/content/dialogs/calendar-invitations-dialog.js
calendar/base/content/dialogs/calendar-print-dialog.js
calendar/base/content/import-export.js
calendar/base/content/preferences/categories.js
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/modules/calUtils.jsm
calendar/base/modules/utils/calAsyncUtils.jsm
calendar/base/modules/utils/calDataUtils.jsm
calendar/base/modules/utils/calItipUtils.jsm
calendar/base/src/calCachedCalendar.js
calendar/base/src/calFilter.js
calendar/base/src/calItemBase.js
calendar/base/src/calTransactionManager.js
calendar/lightning/content/imip-bar.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/providers/caldav/calDavRequestHandlers.js
calendar/providers/composite/calCompositeCalendar.js
calendar/providers/gdata/content/browserRequest.js
calendar/providers/gdata/content/gdata-list-tree.xml
calendar/providers/gdata/modules/OAuth2.jsm
calendar/providers/gdata/modules/gdataRequest.jsm
calendar/providers/ics/calICSCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/resources/content/publish.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_freebusy_service.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_items.js
calendar/test/unit/test_search_service.js
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -590,17 +590,17 @@ agendaListbox.setupContextMenu = functio
  *
  * @param aStart        (optional) The start date for the item query.
  * @param aEnd          (optional) The end date for the item query.
  * @param aCalendar     (optional) If specified, the single calendar from
  *                                   which the refresh will occur.
  */
 agendaListbox.refreshCalendarQuery = function(aStart, aEnd, aCalendar) {
     let refreshJob = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         agendaListbox: this,
         calendar: null,
         calId: null,
         operation: null,
         cancelled: false,
 
         onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDateTime) {
             if (this.agendaListbox.mPendingRefreshJobs.has(this.calId)) {
@@ -863,24 +863,20 @@ agendaListbox.calendarOpListener = { age
 
 /**
  * Calendar and composite observer, used to keep agenda listbox up to date.
  * @see calIObserver
  * @see calICompositeObserver
  */
 agendaListbox.calendarObserver = { agendaListbox: agendaListbox };
 
-agendaListbox.calendarObserver.QueryInterface = function(aIID) {
-    if (!aIID.equals(Components.interfaces.calIObserver) &&
-        !aIID.equals(Components.interfaces.calICompositeObserver) &&
-        !aIID.equals(Components.interfaces.nsISupports)) {
-        throw Components.results.NS_ERROR_NO_INTERFACE;
-    }
-    return this;
-};
+agendaListbox.calendarObserver.QueryInterface = cal.generateQI([
+    Ci.calIObserver,
+    Ci.calICompositeObserver
+]);
 
 // calIObserver:
 agendaListbox.calendarObserver.onStartBatch = function() {
 };
 
 agendaListbox.calendarObserver.onEndBatch = function() {
 };
 
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -56,20 +56,20 @@
                 this.calView.handlePreference(subj, topic, pref);
             }
         })
       ]]></field>
 
       <field name="mObserver"><![CDATA[
           // the calIObserver, calICompositeObserver, and calIAlarmServiceObserver
           ({
-              QueryInterface: XPCOMUtils.generateQI([
-                  Components.interfaces.calIObserver,
-                  Components.interfaces.calIAlarmServiceObserver,
-                  Components.interfaces.calICompositeObserver
+              QueryInterface: cal.generateQI([
+                  Ci.calIObserver,
+                  Ci.calIAlarmServiceObserver,
+                  Ci.calICompositeObserver
               ]),
 
               calView: this,
 
               onStartBatch: function() {
               },
               onEndBatch: function() {
               },
@@ -446,17 +446,17 @@
             this.addItemsFromCalendar(this.mCalendar);
         ]]></body>
       </method>
 
       <method name="addItemsFromCalendar">
         <parameter name="aCalendar"/>
         <body><![CDATA[
             let refreshJob = {
-                QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+                QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
                 calView: this,
                 calendar: null,
                 calId: null,
                 operation: null,
                 cancelled: false,
 
                 onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDateTime) {
                     this.calView.mLog.info("Refresh complete of calendar " + this.calId);
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -107,17 +107,17 @@ function onCalendarViewResize(aEvent) {
  * TODO: The systemcolors pref observer really only needs to be set up once, so
  * ideally this code should go into a component. This should be taken care of when
  * there are more prefs that need to be observed on a global basis that don't fit
  * into the calendar manager.
  */
 var calendarWindowPrefs = {
 
     /** nsISupports QueryInterface */
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
 
     /** Initialize the preference observers */
     init: function() {
         Services.prefs.addObserver("calendar.view.useSystemColors", this);
         Services.ww.registerNotification(this);
 
         // Trigger setting pref on all open windows
         this.observe(null, "nsPref:changed", "calendar.view.useSystemColors");
--- a/calendar/base/content/calendar-dnd-listener.js
+++ b/calendar/base/content/calendar-dnd-listener.js
@@ -555,17 +555,17 @@ calTaskButtonDNDObserver.prototype = {
  */
 function invokeEventDragSession(aItem, aXULBox) {
     let transfer = Cc["@mozilla.org/widget/transferable;1"]
                    .createInstance(Ci.nsITransferable);
     transfer.init(null);
     transfer.addDataFlavor("text/calendar");
 
     let flavourProvider = {
-        QueryInterface: XPCOMUtils.generateQI([Ci.nsIFlavorDataProvider]),
+        QueryInterface: ChromeUtils.generateQI([Ci.nsIFlavorDataProvider]),
 
         item: aItem,
         getFlavorData: function(aInTransferable, aInFlavor, aOutData, aOutDataLen) {
             if ((aInFlavor == "application/vnd.x-moz-cal-event") ||
                 (aInFlavor == "application/vnd.x-moz-cal-task")) {
                 aOutData.value = aItem;
                 aOutDataLen.value = 1;
             } else {
@@ -604,12 +604,14 @@ function invokeEventDragSession(aItem, a
         if (e.result != Components.results.NS_ERROR_FAILURE) {
             // Pressing Escape on some platforms results in NS_ERROR_FAILURE
             // being thrown. Catch this exception, but throw anything else.
             throw e;
         }
     }
 }
 
+/* exported calendarViewDNDObserver, calendarMailButtonDNDObserver,
+   calendarCalendarButtonDNDObserver, calendarTaskButtonDNDObserver */
 var calendarViewDNDObserver = new calViewDNDObserver();
 var calendarMailButtonDNDObserver = new calMailButtonDNDObserver();
 var calendarCalendarButtonDNDObserver = new calCalendarButtonDNDObserver();
 var calendarTaskButtonDNDObserver = new calTaskButtonDNDObserver();
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -124,17 +124,17 @@ InvitationsManager.prototype = {
 
         gInvitationsRequestManager.cancelPendingRequests();
         this.updateStartDate();
         this.deleteAllItems();
 
         let cals = cal.getCalendarManager().getCalendars({});
 
         let opListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             mCount: cals.length,
             mRequestManager: gInvitationsRequestManager,
             mInvitationsManager: this,
             mHandledItems: {},
 
             // calIOperationListener
             onOperationComplete: function(aCalendar,
                                           aStatus,
@@ -263,17 +263,17 @@ InvitationsManager.prototype = {
     processJobQueue: function(queue, jobQueueFinishedCallBack) {
         // TODO: undo/redo
         function operationListener(mgr, queueCallback, oldItem_) {
             this.mInvitationsManager = mgr;
             this.mJobQueueFinishedCallBack = queueCallback;
             this.mOldItem = oldItem_;
         }
         operationListener.prototype = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onOperationComplete: function(aCalendar,
                                           aStatus,
                                           aOperationType,
                                           aId,
                                           aDetail) {
                 if (Components.isSuccessCode(aStatus) &&
                     aOperationType == Components.interfaces.calIOperationListener.MODIFY) {
                     cal.itip.checkAndSend(aOperationType, aDetail, this.mOldItem);
--- a/calendar/base/content/calendar-management.js
+++ b/calendar/base/content/calendar-management.js
@@ -345,19 +345,19 @@ function showOnlyCalendar(aCalendar) {
             composite.removeCalendar(calendar);
         }
     }
     composite.addCalendar(aCalendar);
     composite.endBatch();
 }
 
 var compositeObserver = {
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.calIObserver,
-        Components.interfaces.calICompositeObserver
+    QueryInterface: cal.generateQI([
+        Ci.calIObserver,
+        Ci.calICompositeObserver
     ]),
 
     onStartBatch: function() {},
     onEndBatch: function() {},
     onAddItem: function() {},
     onModifyItem: function() {},
     onDeleteItem: function() {},
     onError: function() {},
@@ -401,17 +401,17 @@ function openCalendarSubscriptionsDialog
                       "_blank",
                       "chrome,titlebar,modal,resizable");
 }
 
 /**
  * Calendar Offline Manager
  */
 var calendarOfflineManager = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
 
     init: function() {
         if (this.initialized) {
             throw Components.results.NS_ERROR_ALREADY_INITIALIZED;
         }
         Services.obs.addObserver(this, "network:offline-status-changed");
 
         this.updateOfflineUI(!this.isOnline());
--- a/calendar/base/content/calendar-statusbar.js
+++ b/calendar/base/content/calendar-statusbar.js
@@ -19,17 +19,17 @@ var gCalendarStatusFeedback = {
     mStatusBar: null,
     mStatusProgressPanel: null,
     mThrobber: null,
     mProgressMode: Components.interfaces.calIStatusObserver.NO_PROGRESS,
     mCurIndex: 0,
     mInitialized: false,
     mCalendars: {},
 
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIStatusObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calIStatusObserver]),
 
     initialize: function(aWindow) {
         if (!this.mInitialized) {
             this.mWindow = aWindow;
             this.mStatusText = this.mWindow.document.getElementById("statusText");
             this.mStatusBar = this.mWindow.document.getElementById("statusbar-icon");
             this.mStatusProgressPanel = this.mWindow.document.getElementById("statusbar-progresspanel");
             this.mThrobber = this.mWindow.document.getElementById("navigator-throbber");
--- a/calendar/base/content/calendar-task-editing.js
+++ b/calendar/base/content/calendar-task-editing.js
@@ -166,17 +166,17 @@ var taskEdit = {
 
     /**
      * Observer to watch for readonly, disabled and capability changes of the
      * observed calendar.
      *
      * @see calIObserver
      */
     calendarObserver: {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIObserver]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIObserver]),
 
         // calIObserver:
         onStartBatch: function() {},
         onEndBatch: function() {},
         onLoad: function(aCalendar) {},
         onAddItem: function(aItem) {},
         onModifyItem: function(aNewItem, aOldItem) {},
         onDeleteItem: function(aDeletedItem) {},
@@ -211,19 +211,19 @@ var taskEdit = {
     /**
      * Observer to watch for changes to the selected calendar.
      *
      * XXX I think we don't need to implement calIObserver here.
      *
      * @see calICompositeObserver
      */
     compositeObserver: {
-        QueryInterface: XPCOMUtils.generateQI([
-            Components.interfaces.calIObserver,
-            Components.interfaces.calICompositeObserver
+        QueryInterface: cal.generateQI([
+            Ci.calIObserver,
+            Ci.calICompositeObserver
         ]),
 
         // calIObserver:
         onStartBatch: function() {},
         onEndBatch: function() {},
         onLoad: function(aCalendar) {},
         onAddItem: function(aItem) {},
         onModifyItem: function(aNewItem, aOldItem) {},
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -332,17 +332,17 @@
         <parameter name="aEvent"/>
         <body><![CDATA[
             return this.mTreeView._getItemFromEvent(aEvent);
         ]]></body>
       </method>
 
       <field name="mTreeView"><![CDATA[
         ({
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsITreeView]),
+            QueryInterface: ChromeUtils.generateQI([Ci.nsITreeView]),
 
             /**
              * Attributes
              */
 
             // back reference to the binding
             binding: this,
             tree: null,
@@ -802,19 +802,19 @@
       <!--
         Observer for the calendar event data source. This keeps the unifinder
         display up to date when the calendar event data is changed
         -->
       <field name="mTaskTreeObserver"><![CDATA[
         ({
             binding: this,
 
-            QueryInterface: XPCOMUtils.generateQI([
-                Components.interfaces.calICompositeObserver,
-                Components.interfaces.calIObserver
+            QueryInterface: cal.generateQI([
+                Ci.calICompositeObserver,
+                Ci.calIObserver
             ]),
 
             /**
              * calIObserver methods and properties
              */
             onStartBatch: function() {
             },
 
@@ -897,17 +897,17 @@
 
         ]]></body>
       </method>
 
       <method name="refreshFromCalendar">
         <parameter name="aCalendar"/>
         <body><![CDATA[
             let refreshJob = {
-                QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+                QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
                 binding: this,
                 calendar: null,
                 items: null,
                 operation: null,
 
                 onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDateTime) {
                     if (aOpCalendar.id in this.binding.mPendingRefreshJobs) {
                         delete this.binding.mPendingRefreshJobs[aOpCalendar.id];
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -51,20 +51,20 @@ function getCurrentUnifinderFilter() {
 /**
  * Observer for the calendar event data source. This keeps the unifinder
  * display up to date when the calendar event data is changed
  *
  * @see calIObserver
  * @see calICompositeObserver
  */
 var unifinderObserver = {
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.calICompositeObserver,
-        Components.interfaces.nsIObserver,
-        Components.interfaces.calIObserver
+    QueryInterface: cal.generateQI([
+        Ci.calICompositeObserver,
+        Ci.nsIObserver,
+        Ci.calIObserver
     ]),
 
     // calIObserver:
     onStartBatch: function() {
     },
 
     onEndBatch: function() {
         refreshEventTree();
@@ -382,17 +382,17 @@ function unifinderKeyPress(aEvent) {
             break;
     }
 }
 
 /**
  * Tree controller for unifinder search results
  */
 var unifinderTreeView = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsITreeView]),
+    QueryInterface: ChromeUtils.generateQI([Ci.nsITreeView]),
 
     // Provide a default tree that holds all the functions used here to avoid
     // cludgy if (this.tree) { this.tree.rowCountChanged(...); } constructs.
     tree: {
         rowCountChanged: function() {},
         beginUpdateBatch: function() {},
         endUpdateBatch: function() {},
         invalidate: function() {}
@@ -868,17 +868,17 @@ function addItemsFromSingleCalendarInter
 
 function addItemsFromCalendar(aCalendar, aAddItemsInternalFunc) {
     if (isUnifinderHidden()) {
         // If the unifinder is hidden, don't refresh the events to reduce needed
         // getItems calls.
         return;
     }
     let refreshListener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         mEventArray: [],
 
         onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDateTime) {
             let refreshTreeInternalFunc = function() {
                 aAddItemsInternalFunc(refreshListener.mEventArray);
             };
             setTimeout(refreshTreeInternalFunc, 0);
         },
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -14,17 +14,17 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 
 /**
  * Controller for the views
  * @see calIcalendarViewController
  */
 var calendarViewController = {
-    QueryInterface: XPCOMUtils.generateQI([Ci.calICalendarViewController]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calICalendarViewController]),
 
     /**
      * Creates a new event
      * @see calICalendarViewController
      */
     createNewEvent: function(aCalendar, aStartTime, aEndTime, aForceAllday) {
         // if we're given both times, skip the dialog
         if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {
@@ -403,17 +403,17 @@ function updateStyleSheetForViews(aCalen
  * colors.
  *
  * Note we need to keep the categoryPrefBranch variable outside of
  * initCategories since branch observers only live as long as the branch object
  * is alive, and out of categoryManagement to avoid cyclic references.
  */
 var categoryPrefBranch;
 var categoryManagement = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
 
     initCategories: function() {
         categoryPrefBranch = Services.prefs.getBranch("calendar.category.color.");
         let categories = categoryPrefBranch.getChildList("");
 
         // Fix illegally formatted category prefs.
         for (let i in categories) {
             let category = categories[i];
@@ -641,17 +641,17 @@ function editSelectedEvents() {
 }
 
 /**
  * Select all events from all calendars. Use with care.
  */
 function selectAllEvents() {
     let items = [];
     let listener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
             currentView().setSelectedItems(items.length, items, false);
         },
         onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
             for (let item of aItems) {
                 items.push(item);
             }
         }
--- a/calendar/base/content/dialogs/calendar-invitations-dialog.js
+++ b/calendar/base/content/dialogs/calendar-invitations-dialog.js
@@ -8,17 +8,17 @@ ChromeUtils.import("resource://calendar/
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 /**
  * Sets up the invitations dialog from the window arguments, retrieves the
  * invitations from the invitations manager.
  */
 function onLoad() {
     let operationListener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
             let updatingBox = document.getElementById("updating-box");
             updatingBox.setAttribute("hidden", "true");
             let richListBox = document.getElementById("invitations-listbox");
             if (richListBox.getRowCount() > 0) {
                 richListBox.selectedIndex = 0;
             } else {
                 let noInvitationsBox =
--- a/calendar/base/content/dialogs/calendar-print-dialog.js
+++ b/calendar/base/content/dialogs/calendar-print-dialog.js
@@ -137,17 +137,17 @@ function getPrintSettings(receiverFunc) 
             break;
         }
     }
 
     // Some filters above might have filled the events list themselves. If not,
     // then fetch the items here.
     if (requiresFetch) {
         let listener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDateTime) {
                 receiverFunc(settings);
             },
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 settings.eventList = settings.eventList.concat(aItems);
                 if (!settings.printTasksWithNoDueDate) {
                     eventWithDueDate = [];
                     for (let item of settings.eventList) {
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
@@ -153,17 +153,17 @@ function putItemsIntoCal(destCal, aItems
     let duplicateCount = 0;
     // Used to store the last error. Only the last error, because we don't
     // wan't to bomb the user with thousands of error messages in case
     // something went really wrong.
     // (example of something very wrong: importing the same file twice.
     //  quite easy to trigger, so we really should do this)
     let lastError;
     let listener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
             count++;
             if (!Components.isSuccessCode(aStatus)) {
                 if (aStatus == Components.interfaces.calIErrors.DUPLICATE_ID) {
                     duplicateCount++;
                 } else {
                     failedCount++;
                     lastError = aStatus;
@@ -323,17 +323,17 @@ function saveEventsToFile(calendarEventA
  * Exports all the events and tasks in a calendar.  If aCalendar is not specified,
  * the user will be prompted with a list of calendars to choose which one to export.
  *
  * @param aCalendar     (optional) A specific calendar to export
  */
 function exportEntireCalendar(aCalendar) {
     let itemArray = [];
     let getListener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aOpCalendar, aStatus, aOperationType, aId, aDetail) {
             saveEventsToFile(itemArray, aOpCalendar.name);
         },
         onGetResult: function(aOpCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
             for (let item of aItems) {
                 itemArray.push(item);
             }
         }
--- a/calendar/base/content/preferences/categories.js
+++ b/calendar/base/content/preferences/categories.js
@@ -56,17 +56,17 @@ var gCategoriesPane = {
 
         this.mCategoryDialog = "chrome://calendar/content/preferences/editCategory.xul";
 
         // Workaround for Bug 1151440 - the HTML color picker won't work
         // in linux when opened from modal dialog
         this.mWinProp = "centerscreen, chrome, resizable=no";
         if (AppConstants.platform != "linux") {
             this.mWinProp += ", modal";
-        };
+        }
     },
 
     /**
      * Updates the listbox containing the categories from the categories saved
      * in preferences.
      */
 
     updatePrefs: function() {
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -62,17 +62,17 @@
             throw Components.Exception("Seting calendars on type='full' is not supported",
                                        Components.results.NS_ERROR_NOT_IMPLEMENTED);
         ]]></setter>
       </property>
 
       <field name="calMgrObserver"><![CDATA[
         ({
             listTree: this,
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarManagerObserver]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calICalendarManagerObserver]),
 
             // calICalendarManagerObserver
             onCalendarRegistered: function(aCalendar) {
                 this.listTree.addCalendar(aCalendar);
                 let composite = this.listTree.compositeCalendar;
                 let inComposite = aCalendar.getProperty(composite.prefPrefix +
                                                         "-in-composite");
                 if ((inComposite === null) || inComposite) {
@@ -90,19 +90,19 @@
                 // enabled/disabled.
                 document.commandDispatcher.updateCommands("calendar_commands");
             }
         })
       ]]></field>
       <field name="compositeObserver"><![CDATA[
         ({
             listTree: this,
-            QueryInterface: XPCOMUtils.generateQI([
-                Components.interfaces.calICompositeObserver,
-                Components.interfaces.calIObserver
+            QueryInterface: cal.generateQI([
+                Ci.calICompositeObserver,
+                Ci.calIObserver
             ]),
 
             // calICompositeObserver
             onCalendarAdded: function(aCalendar) {
                 // Make sure the checkbox state is updated
                 this.listTree.updateCalendar(aCalendar);
             },
 
@@ -249,17 +249,17 @@
           if (this.mCompositeCalendar) {
               this.mCompositeCalendar.removeObserver(this.compositeObserver);
           }
       ]]></destructor>
 
       <field name="calObserver"><![CDATA[
         ({
             listTree: this,
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIObserver]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIObserver]),
 
             // calIObserver. Note that each registered calendar uses this observer
             onStartBatch: function() { },
             onEndBatch: function() { },
             onLoad: function() { },
 
             onAddItem: function(aItem) { },
             onModifyItem: function(aNewItem, aOldItem) { },
@@ -291,17 +291,17 @@
                 this.onPropertyChanged(aCalendar, aName, null, null);
             }
         })
       ]]></field>
 
       <field name="compositeObserver"><![CDATA[
         ({
             listTree: this,
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICompositeObserver]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calICompositeObserver]),
 
             // calICompositeObserver
             onCalendarAdded: function(aCalendar) {
                 // Make sure the checkbox state is updated
                 this.listTree.updateCalendar(aCalendar);
             },
 
             onCalendarRemoved: function(aCalendar) {
--- a/calendar/base/modules/calUtils.jsm
+++ b/calendar/base/modules/calUtils.jsm
@@ -260,17 +260,17 @@ var cal = {
                 break;
         }
 
         for (let method of methods) {
             if (!(method in template)) {
                 adapter[method] = function() {};
             }
         }
-        adapter.QueryInterface = XPCOMUtils.generateQI([iface]);
+        adapter.QueryInterface = ChromeUtils.generateQI([iface]);
 
         return adapter;
     },
 
     /**
      * Make a UUID, without enclosing brackets, e.g. 0d3950fd-22e5-4508-91ba-0489bdac513f
      *
      * @return {String}         The generated UUID
--- a/calendar/base/modules/utils/calAsyncUtils.jsm
+++ b/calendar/base/modules/utils/calAsyncUtils.jsm
@@ -102,17 +102,17 @@ var calasync = {
      * See also promisifyCalendar, where the above can be replaced with:
      *   function promiseAddItem(aItem) {
      *     let calendar = cal.async.promisifyCalendar(aItem.calendar);
      *     return calendar.addItem(aItem);
      *   }
      */
     promiseOperationListener: function(deferred) {
         return {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             items: [],
             itemStatus: Components.results.NS_OK,
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail,
                                   aCount, aItems) {
                 this.itemStatus = aStatus;
                 if (Components.isSuccessCode(aStatus)) {
                     this.items = this.items.concat(aItems);
                 } else {
--- a/calendar/base/modules/utils/calDataUtils.jsm
+++ b/calendar/base/modules/utils/calDataUtils.jsm
@@ -16,30 +16,30 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 this.EXPORTED_SYMBOLS = ["caldata"]; /* exported caldata */
 
 class PropertyMap extends Map {
     get simpleEnumerator() {
         let entries = [...this.entries()].filter(([key, value]) => value !== undefined);
         let index = 0;
 
         return {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISimpleEnumerator]),
+            QueryInterface: ChromeUtils.generateQI([Ci.nsISimpleEnumerator]),
 
             hasMoreElements: function() {
                 return index < entries.length;
             },
 
             getNext: function() {
                 if (!this.hasMoreElements()) {
                     throw Components.results.NS_ERROR_UNEXPECTED;
                 }
 
                 let [name, value] = entries[index++];
                 return {
-                    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProperty]),
+                    QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
                     name: name,
                     value: value
                 };
             }
         };
     }
 }
 
--- a/calendar/base/modules/utils/calItipUtils.jsm
+++ b/calendar/base/modules/utils/calItipUtils.jsm
@@ -1442,17 +1442,17 @@ function sendMessage(aItem, aMethod, aRe
  *                                        recipients.
  */
 function ItipOpListener(aOpListener, aOldItem, aExtResponse=null) {
     this.mOpListener = aOpListener;
     this.mOldItem = aOldItem;
     this.mExtResponse = aExtResponse;
 }
 ItipOpListener.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
 
     mOpListener: null,
     mOldItem: null,
     mExtResponse: null,
 
     onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
         cal.ASSERT(Components.isSuccessCode(aStatus), "error on iTIP processing");
         if (Components.isSuccessCode(aStatus)) {
@@ -1530,19 +1530,19 @@ var ItipItemFinderFactory = {
 function ItipItemFinder(aId, itipItem, optionsFunc) {
     this.mItipItem = itipItem;
     this.mOptionsFunc = optionsFunc;
     this.mSearchId = aId;
 }
 
 ItipItemFinder.prototype = {
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.calIObserver,
-        Components.interfaces.calIOperationListener
+    QueryInterface: cal.generateQI([
+        Ci.calIObserver,
+        Ci.calIOperationListener
     ]),
 
     mSearchId: null,
     mItipItem: null,
     mOptionsFunc: null,
     mFoundItems: null,
 
     findItem: function() {
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -7,17 +7,17 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 
 var calICalendar = Components.interfaces.calICalendar;
 var cICL = Components.interfaces.calIChangeLog;
 var cIOL = Components.interfaces.calIOperationListener;
 
 var gNoOpListener = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+    QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIOperationListener]),
     onGetResult: function(calendar, status, itemType, detail, count, items) {
     },
 
     onOperationComplete: function(calendar, status, opType, id, detail) {
     }
 };
 
 /**
@@ -51,17 +51,17 @@ function isUnavailableCode(result) {
     }
 }
 
 function calCachedCalendarObserverHelper(home, isCachedObserver) {
     this.home = home;
     this.isCachedObserver = isCachedObserver;
 }
 calCachedCalendarObserverHelper.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIObserver]),
+    QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIObserver]),
     isCachedObserver: false,
 
     onStartBatch: function() {
         this.home.mObservers.notify("onStartBatch");
     },
 
     onEndBatch: function() {
         this.home.mObservers.notify("onEndBatch");
@@ -127,28 +127,30 @@ function calCachedCalendar(uncachedCalen
     this.setupCachedCalendar();
     if (this.supportsChangeLog) {
         uncachedCalendar.offlineStorage = this.mCachedCalendar;
     }
     this.offlineCachedItems = {};
     this.offlineCachedItemFlags = {};
 }
 calCachedCalendar.prototype = {
+    /* eslint-disable mozilla/use-chromeutils-generateqi */
     QueryInterface: function(aIID) {
         if (aIID.equals(Components.interfaces.calISchedulingSupport) &&
             this.mUncachedCalendar.QueryInterface(aIID)) {
             // check whether uncached calendar supports it:
             return this;
         } else if (aIID.equals(Components.interfaces.calICalendar) ||
                    aIID.equals(Components.interfaces.nsISupports)) {
             return this;
         } else {
             throw Components.results.NS_ERROR_NO_INTERFACE;
         }
     },
+    /* eslint-enable mozilla/use-chromeutils-generateqi */
 
     mCachedCalendar: null,
     mCachedObserver: null,
     mUncachedCalendar: null,
     mObservers: null,
     mSuperCalendar: null,
     offlineCachedItems: null,
     offlineCachedItemFlags: null,
@@ -224,17 +226,17 @@ calCachedCalendar.prototype = {
             Components.utils.reportError(exc);
         }
     },
 
     getOfflineAddedItems: function(callbackFunc) {
         let self = this;
         self.offlineCachedItems = {};
         let getListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIOperationListener]),
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 for (let item of aItems) {
                     self.offlineCachedItems[item.hashId] = item;
                     self.offlineCachedItemFlags[item.hashId] = cICL.OFFLINE_FLAG_CREATED_RECORD;
                 }
             },
 
             onOperationComplete: function(aCalendar, aStatus, aOpType, aId, aDetail) {
@@ -243,17 +245,17 @@ calCachedCalendar.prototype = {
         };
         this.mCachedCalendar.getItems(calICalendar.ITEM_FILTER_ALL_ITEMS | calICalendar.ITEM_FILTER_OFFLINE_CREATED,
                                       0, null, null, getListener);
     },
 
     getOfflineModifiedItems: function(callbackFunc) {
         let self = this;
         let getListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIOperationListener]),
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 for (let item of aItems) {
                     self.offlineCachedItems[item.hashId] = item;
                     self.offlineCachedItemFlags[item.hashId] = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
                 }
             },
 
             onOperationComplete: function(aCalendar, aStatus, aOpType, aId, aDetail) {
@@ -262,17 +264,17 @@ calCachedCalendar.prototype = {
         };
         this.mCachedCalendar.getItems(calICalendar.ITEM_FILTER_OFFLINE_MODIFIED | calICalendar.ITEM_FILTER_ALL_ITEMS,
                                       0, null, null, getListener);
     },
 
     getOfflineDeletedItems: function(callbackFunc) {
         let self = this;
         let getListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIOperationListener]),
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 for (let item of aItems) {
                     self.offlineCachedItems[item.hashId] = item;
                     self.offlineCachedItemFlags[item.hashId] = cICL.OFFLINE_FLAG_DELETED_RECORD;
                 }
             },
 
             onOperationComplete: function(aCalendar, aStatus, aOpType, aId, aDetail) {
@@ -338,17 +340,17 @@ calCachedCalendar.prototype = {
                 }
             };
             this.mPendingSync = this.mUncachedCalendar.replayChangesOn(opListener);
             return this.mPendingSync;
         }
 
         cal.LOG("[calCachedCalendar] Doing full sync for calendar " + this.uri.spec);
         let completeListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Components.interfaces.calIOperationListener]),
             modifiedTimes: {},
             hasRenewedCalendar: false,
             getsCompleted: 0,
             getsReceived: 0,
             opCompleted: false,
 
             onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
                 if (Components.isSuccessCode(aStatus)) {
--- a/calendar/base/src/calFilter.js
+++ b/calendar/base/src/calFilter.js
@@ -856,17 +856,17 @@ calFilter.prototype = {
         }
         let props = this.mFilterProperties;
 
         // we use a local proxy listener for the calICalendar.getItems() call, and use it
         // to handle occurrence expansion and filter the results before forwarding them to
         // the listener passed in the aListener argument.
         let self = this;
         let listener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onOperationComplete: aListener.onOperationComplete.bind(aListener),
 
             onGetResult: function(aOpCalendar, aStatus, aOpItemType, aDetail, aCount, aItems) {
                 let items;
                 if (props.occurrences == props.FILTER_OCCURRENCES_PAST_AND_NEXT) {
                     // with the FILTER_OCCURRENCES_PAST_AND_NEXT occurrence filter we will
                     // get parent items returned here, so we need to let the getOccurrences
                     // function handle occurrence expansion.
--- a/calendar/base/src/calItemBase.js
+++ b/calendar/base/src/calItemBase.js
@@ -48,17 +48,17 @@ calItemBase.prototype = {
         this.mProperties = new cal.data.PropertyMap();
         this.mPropertyParams = {};
         this.mProperties.set("CREATED", cal.dtz.jsDateToDateTime(new Date()));
     },
 
     /**
      * @see nsISupports
      */
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIItemBase]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calIItemBase]),
 
     /**
      * @see calIItemBase
      */
     get aclEntry() {
         let aclEntry = this.mACLEntry;
         let aclManager = this.calendar && this.calendar.superCalendar.aclManager;
 
@@ -458,17 +458,17 @@ calItemBase.prototype = {
             mParamNames: Object.keys(parameters),
             hasMoreElements: function() {
                 return (this.mParamNames.length > 0);
             },
 
             getNext: function() {
                 let paramName = this.mParamNames.pop();
                 return { // nsIProperty
-                    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProperty]),
+                    QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
                     name: paramName,
                     value: parameters[paramName]
                 };
             }
         };
     },
 
     // void getAttendees(out PRUint32 count,
--- a/calendar/base/src/calTransactionManager.js
+++ b/calendar/base/src/calTransactionManager.js
@@ -78,17 +78,17 @@ function calTransaction(aAction, aItem, 
 
 var calTransactionClassID = Components.ID("{fcb54c82-2fb9-42cb-bf44-1e197a55e520}");
 var calTransactionInterfaces = [
     Components.interfaces.nsITransaction,
     Components.interfaces.calIOperationListener
 ];
 calTransaction.prototype = {
     classID: calTransactionClassID,
-    QueryInterface: XPCOMUtils.generateQI(calTransactionInterfaces),
+    QueryInterface: ChromeUtils.generateQI(calTransactionInterfaces),
     classInfo: XPCOMUtils.generateCI({
         classID: calTransactionClassID,
         classDescription: "Calendar Transaction",
         contractID: "mozilla.org/calendar/transaction;1",
         interfaces: calTransactionInterfaces,
     }),
 
     mAction: null,
--- a/calendar/lightning/content/imip-bar.js
+++ b/calendar/lightning/content/imip-bar.js
@@ -309,17 +309,17 @@ var ltnImipBar = {
                     aParticipantStatus = "";
                 }
                 // hide the buttons now, to disable pressing them twice...
                 if (aPartStat == aParticipantStatus) {
                     ltnImipBar.resetButtons();
                 }
 
                 let opListener = {
-                    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+                    QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
                     onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
                         if (Components.isSuccessCode(aStatus) && isDeclineCounter) {
                             // TODO: move the DECLINECOUNTER stuff to actionFunc
                             aItipItem.getItemList({}).forEach(aItem => {
                                 // we can rely on the received itipItem to reply at this stage
                                 // already, the checks have been done in cal.itip.processFoundItems
                                 // when setting up the respective aActionFunc
                                 let attendees = cal.itip.getAttendeesBySender(
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -2973,17 +2973,17 @@ function onCommandSave(aIsClosing) {
     // When the call is complete, we need to set the new item, so that the
     // dialog is up to date.
 
     // XXX Do we want to disable the dialog or at least the save button until
     // the call is complete? This might help when the user tries to save twice
     // before the call is complete. In that case, we do need a progress bar and
     // the ability to cancel the operation though.
     let listener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOpType, aId, aItem) {
             // Check if the current window has a calendarItem first, because in case of undo
             // window refers to the main window and we would get a 'calendarItem is undefined' warning.
             if (!aIsClosing && "calendarItem" in window) {
                 // If we changed the calendar of the item, onOperationComplete will be called multiple
                 // times. We need to make sure we're receiving the update on the right calendar.
                 if ((!window.calendarItem.id ||aId == window.calendarItem.id) &&
                     (aCalendar.id == window.calendarItem.calendar.id) &&
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -653,17 +653,17 @@ function ltnFinish() {
 var FIRST_DELAY_STARTUP = 100;
 var FIRST_DELAY_RESCHEDULE = 100;
 var FIRST_DELAY_REGISTER = 10000;
 var FIRST_DELAY_UNREGISTER = 0;
 
 var gInvitationsOperationListener = {
     mCount: 0,
 
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
     onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
         let invitationsBox = document.getElementById("calendar-invitations-panel");
         if (Components.isSuccessCode(aStatus)) {
             let value = cal.l10n.getLtnString("invitationsLink.label", [this.mCount]);
             document.getElementById("calendar-invitations-label").value = value;
             setElementValue(invitationsBox, this.mCount < 1 && "true", "hidden");
         } else {
             invitationsBox.setAttribute("hidden", "true");
@@ -676,17 +676,17 @@ var gInvitationsOperationListener = {
             this.mCount += aCount;
         }
     }
 };
 
 var gInvitationsCalendarManagerObserver = {
     mSideBar: this,
 
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarManagerObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calICalendarManagerObserver]),
 
     onCalendarRegistered: function(aCalendar) {
         this.mSideBar.rescheduleInvitationsUpdate(FIRST_DELAY_REGISTER);
     },
 
     onCalendarUnregistering: function(aCalendar) {
         this.mSideBar.rescheduleInvitationsUpdate(FIRST_DELAY_UNREGISTER);
     },
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -39,21 +39,21 @@ etagsHandler.prototype = {
     calendar: null,
     baseUri: null,
     changeLogListener: null,
     logXML: "",
 
     itemsReported: null,
     itemsNeedFetching: null,
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.nsISAXContentHandler,
-        Components.interfaces.nsISAXErrorHandler,
-        Components.interfaces.nsIRequestObserver,
-        Components.interfaces.nsIStreamListener
+    QueryInterface: cal.generateQI([
+        Ci.nsISAXContentHandler,
+        Ci.nsISAXErrorHandler,
+        Ci.nsIRequestObserver,
+        Ci.nsIStreamListener
     ]),
 
     /**
      * @see nsIStreamListener
      */
     onStartRequest: function(request, context) {
         let httpchannel = request.QueryInterface(Components.interfaces.nsIHttpChannel);
 
@@ -300,21 +300,21 @@ webDavSyncHandler.prototype = {
     logXML: "",
     isInPropStat: false,
     changeCount: 0,
     unhandledErrors: 0,
     itemsReported: null,
     itemsNeedFetching: null,
     additionalSyncNeeded: false,
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.nsISAXContentHandler,
-        Components.interfaces.nsISAXErrorHandler,
-        Components.interfaces.nsIRequestObserver,
-        Components.interfaces.nsIStreamListener
+    QueryInterface: cal.generateQI([
+        Ci.nsISAXContentHandler,
+        Ci.nsISAXErrorHandler,
+        Ci.nsIRequestObserver,
+        Ci.nsIStreamListener
     ]),
 
     doWebDAVSync: function() {
         if (this.calendar.mDisabled) {
             // check if maybe our calendar has become available
             this.calendar.setupAuthentication(this.changeLogListener);
             return;
         }
@@ -667,21 +667,21 @@ multigetSyncHandler.prototype = {
     listener: null,
     changeLogListener: null,
     logXML: null,
     unhandledErrors: 0,
     itemsNeedFetching: null,
     additionalSyncNeeded: false,
     timer: null,
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.nsISAXContentHandler,
-        Components.interfaces.nsISAXErrorHandler,
-        Components.interfaces.nsIRequestObserver,
-        Components.interfaces.nsIStreamListener
+    QueryInterface: cal.generateQI([
+        Ci.nsISAXContentHandler,
+        Ci.nsISAXErrorHandler,
+        Ci.nsIRequestObserver,
+        Ci.nsIStreamListener
     ]),
 
     doMultiGet: function() {
         if (this.calendar.mDisabled) {
             // check if maybe our calendar has become available
             this.calendar.setupAuthentication(this.changeLogListener);
             return;
         }
--- a/calendar/providers/composite/calCompositeCalendar.js
+++ b/calendar/providers/composite/calCompositeCalendar.js
@@ -84,17 +84,17 @@ function calCompositeCalendar() {
 var calCompositeCalendarClassID = Components.ID("{aeff788d-63b0-4996-91fb-40a7654c6224}");
 var calCompositeCalendarInterfaces = [
     Components.interfaces.calICalendarProvider,
     Components.interfaces.calICalendar,
     Components.interfaces.calICompositeCalendar,
 ];
 calCompositeCalendar.prototype = {
     classID: calCompositeCalendarClassID,
-    QueryInterface: XPCOMUtils.generateQI(calCompositeCalendarInterfaces),
+    QueryInterface: ChromeUtils.generateQI(calCompositeCalendarInterfaces),
     classInfo: XPCOMUtils.generateCI({
         classID: calCompositeCalendarClassID,
         contractID: "@mozilla.org/calendar/calendar;1?type=composite",
         classDescription: "Composite Calendar Provider",
         interfaces: calCompositeCalendarInterfaces,
     }),
 
     //
--- a/calendar/providers/gdata/content/browserRequest.js
+++ b/calendar/providers/gdata/content/browserRequest.js
@@ -10,19 +10,19 @@ var wpl = Components.interfaces.nsIWebPr
 
 var reporterListener = {
     _isBusy: false,
     get securityButton() {
         delete this.securityButton;
         return (this.securityButton = document.getElementById("security-button"));
     },
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.nsIWebProgressListener,
-        Components.interfaces.nsISupportsWeakReference,
+    QueryInterface: cal.generateQI([
+        Ci.nsIWebProgressListener,
+        Ci.nsISupportsWeakReference,
     ]),
 
     onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
     },
 
     onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress,
                                aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {
     },
--- a/calendar/providers/gdata/content/gdata-list-tree.xml
+++ b/calendar/providers/gdata/content/gdata-list-tree.xml
@@ -89,17 +89,17 @@
             mem.id = cal.getUUID();
             return mem;
         ]]></getter>
       </property>
 
       <field name="mCalendarHeaderIndex">0</field>
       <field name="mTasksHeaderIndex">0</field>
 
-      <field name="QueryInterface">XPCOMUtils.generateQI([Components.interfaces.nsITreeView])</field>
+      <field name="QueryInterface">ChromeUtils.generateQI([Ci.nsITreeView])</field>
 
       <property name="calendars">
         <getter><![CDATA[
             return this.mCalendarList;
         ]]></getter>
         <setter><![CDATA[
             for (let i = 0; i < val.length; i++) {
                 let calendar = val[i];
--- a/calendar/providers/gdata/modules/OAuth2.jsm
+++ b/calendar/providers/gdata/modules/OAuth2.jsm
@@ -112,19 +112,19 @@ OAuth2.prototype = {
                     return;
                 }
 
                 this._listener = {
                     window: aWindow,
                     webProgress: aWebProgress,
                     _parent: this.account,
 
-                    QueryInterface: XPCOMUtils.generateQI([
-                        Components.interfaces.nsIWebProgressListener,
-                        Components.interfaces.nsISupportsWeakReference
+                    QueryInterface: cal.generateQI([
+                        Ci.nsIWebProgressListener,
+                        Ci.nsISupportsWeakReference
                     ]),
 
                     _cleanUp: function() {
                         this.webProgress.removeProgressListener(this);
                         this.window.close();
                         delete this.window;
                     },
 
--- a/calendar/providers/gdata/modules/gdataRequest.jsm
+++ b/calendar/providers/gdata/modules/gdataRequest.jsm
@@ -83,21 +83,21 @@ calGoogleRequest.prototype = {
     /* Simple Attributes */
     method: "GET",
     id: null,
     uri: null,
     calendar: null,
     reauthenticate: true,
     requestDate: null,
 
-    QueryInterface: XPCOMUtils.generateQI([
-        Components.interfaces.calIOperation,
-        Components.interfaces.nsIStreamLoaderObserver,
-        Components.interfaces.nsIInterfaceRequestor,
-        Components.interfaces.nsIChannelEventSink
+    QueryInterface: cal.generateQI([
+        Ci.calIOperation,
+        Ci.nsIStreamLoaderObserver,
+        Ci.nsIInterfaceRequestor,
+        Ci.nsIChannelEventSink
     ]),
 
     /**
      * Implement calIOperation
      */
     get isPending() {
         return (this.mLoader && this.mLoader.request != null);
     },
--- a/calendar/providers/ics/calICSCalendar.js
+++ b/calendar/providers/ics/calICSCalendar.js
@@ -299,17 +299,17 @@ calICSCalendar.prototype = {
         }
     },
 
     doWriteICS: function() {
         cal.LOG("[calICSCalendar] Writing ICS File " + this.uri.spec);
         let self = this;
         let listener = {
             serializer: null,
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
                 let inLastWindowClosingSurvivalArea = false;
                 try {
                     // All events are returned. Now set up a channel and a
                     // streamloader to upload.  onStopRequest will be called
                     // once the write has finished
                     let channel = Services.io.newChannelFromURI2(self.mUri,
                                                                  null,
@@ -505,17 +505,17 @@ calICSCalendar.prototype = {
         if (this.isLocked()) {
             return;
         }
 
         function modListener(action) {
             this.mAction = action;
         }
         modListener.prototype = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onGetResult: function() {},
             onOperationComplete: function() {
                 this.mAction.opCompleteArgs = arguments;
             }
         };
 
         let a;
         let writeICS = false;
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -1016,17 +1016,17 @@ calStorageCalendar.prototype = {
                                      Components.interfaces.calIOperationListener.ADD,
                                      aItem.id,
                                      aItem);
     },
 
     modifyOfflineItem: function(aItem, aListener) {
         let self = this;
         let opListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onGetResult: function(calendar, status, itemType, detail, count, items) {
             },
             onOperationComplete: function(calendar, status, opType, id, oldOfflineJournalFlag) {
                 let newOfflineJournalFlag = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
                 if (oldOfflineJournalFlag == cICL.OFFLINE_FLAG_CREATED_RECORD || oldOfflineJournalFlag == cICL.OFFLINE_FLAG_DELETED_RECORD) {
                     // Do nothing since a flag of "created" or "deleted" exists
                 } else {
                     self.setOfflineJournalFlag(aItem, newOfflineJournalFlag);
@@ -1039,17 +1039,17 @@ calStorageCalendar.prototype = {
             }
         };
         this.getItemOfflineFlag(aItem, opListener);
     },
 
     deleteOfflineItem: function(aItem, aListener) {
         let self = this;
         let opListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onGetResult: function(calendar, status, itemType, detail, count, items) {
 
             },
             onOperationComplete: function(calendar, status, opType, id, oldOfflineJournalFlag) {
                 if (oldOfflineJournalFlag) {
                     // Delete item if flag is c
                     if (oldOfflineJournalFlag == cICL.OFFLINE_FLAG_CREATED_RECORD) {
                         self.deleteItemById(aItem.id);
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -1307,17 +1307,17 @@ calWcapCalendar.prototype.replayChangesO
                 listener.onResult(request, null);
             }
         },
         log("replayChangesOn():\n\titemFilter=0x" + itemFilter.toString(0x10) +
             "\n\tdtFrom=" + getIcalUTC(dtFrom), this));
 
     try {
         let writeListener = {
-            QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+            QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
             onGetResult: function() {},
             onOperationComplete: function(aCalendar, status, opType, id, detail) {
                 if (!Components.isSuccessCode(status)) {
                     request.execRespFunc(status); // any error on writing breaks whole operation
                 }
             }
         };
         let request = new calWcapRequest(
--- a/calendar/resources/content/publish.js
+++ b/calendar/resources/content/publish.js
@@ -87,17 +87,17 @@ function publishEntireCalendar(aCalendar
  */
 function publishEntireCalendarDialogResponse(CalendarPublishObject, aProgressDialog) {
     // store the selected remote ics path as a calendar preference
     CalendarPublishObject.calendar.setProperty("remote-ics-path",
                                            CalendarPublishObject.remotePath);
 
     let itemArray = [];
     let getListener = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIOperationListener]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIOperationListener]),
         onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail) {
             publishItemArray(itemArray, CalendarPublishObject.remotePath, aProgressDialog);
         },
         onGetResult: function(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) {
             if (!Components.isSuccessCode(aStatus)) {
                 aborted = true;
                 return;
             }
@@ -192,17 +192,17 @@ var notificationCallbacks = {
         }
 
         throw Components.results.NS_ERROR_NO_INTERFACE;
     }
 };
 
 
 var publishingListener = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIStreamListener]),
+    QueryInterface: ChromeUtils.generateQI([Ci.nsIStreamListener]),
 
     onStartRequest: function(request, ctxt) {
     },
 
     onStopRequest: function(request, ctxt, status, errorMsg) {
         ctxt.wrappedJSObject.onStopUpload();
 
         let channel;
--- a/calendar/test/unit/test_alarmservice.js
+++ b/calendar/test/unit/test_alarmservice.js
@@ -7,17 +7,17 @@ ChromeUtils.import("resource://gre/modul
 
 var EXPECT_NONE = 0;
 var EXPECT_FIRED = 1;
 var EXPECT_TIMER = 2;
 
 function do_check_xor(a, b, aMessage) { return ok((a && !b) || (!a && b), aMessage); }
 
 var alarmObserver = {
-    QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIAlarmServiceObserver]),
+    QueryInterface: ChromeUtils.generateQI([Ci.calIAlarmServiceObserver]),
 
     service: null,
     firedMap: {},
     expectedMap: {},
     pendingOps: {},
 
     onAlarm: function(aItem, aAlarm) {
         this.firedMap[aItem.hashId] = this.firedMap[aItem.hashId] || {};
--- a/calendar/test/unit/test_freebusy_service.js
+++ b/calendar/test/unit/test_freebusy_service.js
@@ -103,17 +103,20 @@ function test_failure() {
                                   cIFI.BUSY_ALL,
                                   listener);
 }
 
 function test_cancel() {
     _clearProviders();
 
     let provider = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIFreeBusyProvider, Components.interfaces.calIOperation]),
+        QueryInterface: cal.generateQI([
+            Ci.calIFreeBusyProvider,
+            Ci.calIOperation
+        ]),
         getFreeBusyIntervals: function(aCalId, aStart, aEnd, aTypes, aListener) {
             Services.tm.currentThread.dispatch({
                 run: function() {
                     dump("Cancelling freebusy query...");
                     operation.cancel();
                 }
             }, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);
 
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -48,17 +48,17 @@ var MockConflictPrompt = {
     }
 };
 
 function MockAlertsService() {}
 
 MockAlertsService.prototype = {
     showAlertNotification: function() {
     },
-    QueryInterface: XPCOMUtils.generateQI([
+    QueryInterface: ChromeUtils.generateQI([
         Ci.nsIAlertsService
     ])
 };
 
 function replaceAlertsService() {
     let originalAlertsServiceCID =
         MockRegistrar.register("@mozilla.org/alerts-service;1", MockAlertsService);
     registerCleanupFunction(() => {
--- a/calendar/test/unit/test_items.js
+++ b/calendar/test/unit/test_items.js
@@ -16,31 +16,31 @@ function really_run_test() {
     test_attachment();
     test_lastack();
     test_categories();
     test_alarm();
 }
 
 function test_aclmanager() {
     let mockCalendar = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendar]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calICalendar]),
 
         get superCalendar() { return this; },
         get aclManager() { return this; },
 
         getItemEntry: function(item) {
             if (item.id == "withentry") {
                 return itemEntry;
             }
             return null;
         },
     };
 
     let itemEntry = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIItemACLEntry]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calIItemACLEntry]),
         userCanModify: true,
         userCanRespond: false,
         userCanViewAll: true,
         userCanViewDateAndTime: false,
     };
 
     let event = cal.createEvent();
     event.id = "withentry";
@@ -67,17 +67,17 @@ function test_aclmanager() {
     equal(event.aclEntry, null);
 }
 
 function test_calendar() {
     let event = cal.createEvent();
     let parentEntry = cal.createEvent();
 
     let mockCalendar = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendar]),
+        QueryInterface: ChromeUtils.generateQI([Ci.calICalendar]),
         id: "one"
     };
 
     parentEntry.calendar = mockCalendar;
     event.parentItem = parentEntry;
 
     notEqual(event.calendar, null);
     equal(event.calendar.id, "one");
--- a/calendar/test/unit/test_search_service.js
+++ b/calendar/test/unit/test_search_service.js
@@ -89,17 +89,20 @@ function test_failure() {
     search.searchForCalendars("str", HINT_EXACT_MATCH, 0, listener);
     ok(listener.called);
 }
 
 function test_cancel() {
     search.getProviders({}).forEach(search.removeProvider, search);
 
     let provider = {
-        QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarSearchProvider, Components.interfaces.calIOperation]),
+        QueryInterface: ChromeUtils.generateQI([
+            Ci.calICalendarSearchProvider,
+            Ci.calIOperation
+        ]),
         searchForCalendars: function(aStr, aHint, aMax, aListener) {
             Services.tm.currentThread.dispatch({
                 run: function() {
                     dump("Cancelling search...");
                     operation.cancel();
                 }
             }, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);