Bug 1608610 - Update paths for components and other js/json files. r=darktrojan
authorPaul Morris <paul@thunderbird.net>
Fri, 10 Jan 2020 22:44:21 -0500
changeset 37222 50ae36bb50fdd97b9f8efd795f5c5be12130abd0
parent 37221 617509326044bf9249768bc37019380adfae0135
child 37223 8d524b01c605ad4acba95b5924842fbe60e06c94
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1608610
Bug 1608610 - Update paths for components and other js/json files. r=darktrojan
calendar/base/backend/calBackendLoader.js
calendar/base/backend/icaljs/calICALJSComponents.js
calendar/base/backend/icaljs/calICSService.js
calendar/base/modules/calExtract.jsm
calendar/base/src/calItemModule.js
calendar/base/src/calStartupService.js
calendar/base/src/calTimezoneService.js
calendar/import-export/calImportExportModule.js
calendar/providers/caldav/calDavCalendar.js
calendar/test/unit/test_imip.js
--- a/calendar/base/backend/calBackendLoader.js
+++ b/calendar/base/backend/calBackendLoader.js
@@ -35,20 +35,17 @@ calBackendLoader.prototype = {
         "@mozilla.org/calendar/ics-service;1": "{c61cb903-4408-41b3-bc22-da0b27efdfe1}",
         "@mozilla.org/calendar/period;1": "{394a281f-7299-45f7-8b1f-cce21258972f}",
         "@mozilla.org/calendar/recurrence-rule;1": "{df19281a-5389-4146-b941-798cb93a7f0d}",
         "@mozilla.org/calendar/duration;1": "{7436f480-c6fc-4085-9655-330b1ee22288}",
       };
 
       // Load ical.js backend
       let scope = {};
-      Services.scriptloader.loadSubScript(
-        "resource://calendar/components/calICALJSComponents.js",
-        scope
-      );
+      Services.scriptloader.loadSubScript("resource:///components/calICALJSComponents.js", scope);
 
       // Register the icaljs components. We used to unregisterFactory, but this caused all
       // sorts of problems. Just registering over it seems to work quite fine.
       let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
       for (let [contractID, classID] of Object.entries(contracts)) {
         let newClassID = Components.ID(classID);
         let newFactory = lazyFactoryFor(scope, newClassID);
         registrar.registerFactory(newClassID, "", contractID, newFactory);
--- a/calendar/base/backend/icaljs/calICALJSComponents.js
+++ b/calendar/base/backend/icaljs/calICALJSComponents.js
@@ -9,22 +9,22 @@
 /* import-globals-from calPeriod.js */
 /* import-globals-from calRecurrenceRule.js */
 
 var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 this.NSGetFactory = cid => {
   let scriptLoadOrder = [
-    "resource://calendar/calendar-js/calTimezone.js",
-    "resource://calendar/calendar-js/calDateTime.js",
-    "resource://calendar/calendar-js/calDuration.js",
-    "resource://calendar/calendar-js/calICSService.js",
-    "resource://calendar/calendar-js/calPeriod.js",
-    "resource://calendar/calendar-js/calRecurrenceRule.js",
+    "resource:///components/calTimezone.js",
+    "resource:///components/calDateTime.js",
+    "resource:///components/calDuration.js",
+    "resource:///components/calICSService.js",
+    "resource:///components/calPeriod.js",
+    "resource:///components/calRecurrenceRule.js",
   ];
 
   for (let script of scriptLoadOrder) {
     Services.scriptloader.loadSubScript(script, this);
   }
 
   let components = [
     calDateTime,
--- a/calendar/base/backend/icaljs/calICSService.js
+++ b/calendar/base/backend/icaljs/calICSService.js
@@ -568,17 +568,17 @@ calICSService.prototype = {
     let comp = ICAL.parse(serialized);
     return new calIcalComponent(new ICAL.Component(comp));
   },
 
   parseICSAsync: function(serialized, tzProvider, listener) {
     // There are way too many error checking messages here, but I had so
     // much pain with this method that I don't want it to break again.
     try {
-      let worker = new ChromeWorker("resource://calendar/calendar-js/calICSService-worker.js");
+      let worker = new ChromeWorker("resource:///components/calICSService-worker.js");
       worker.onmessage = function(event) {
         let rc = Cr.NS_ERROR_FAILURE;
         let icalComp = null;
         try {
           rc = event.data.rc;
           icalComp = new calIcalComponent(new ICAL.Component(event.data.data));
           if (!Components.isSuccessCode(rc)) {
             cal.ERROR("[calICSService] Error in parser worker: " + event.data);
--- a/calendar/base/modules/calExtract.jsm
+++ b/calendar/base/modules/calExtract.jsm
@@ -12,17 +12,17 @@ var { Services } = ChromeUtils.import("r
  * @param fallbackLocale  locale to use when others are not found or
  *                            detection is disabled
  * @param dayStart        ambiguous hours earlier than this are considered to
  *                            be in the afternoon, when null then by default
  *                            set to 6
  * @param fixedLang       whether to use only fallbackLocale for extraction
  */
 function Extractor(fallbackLocale, dayStart, fixedLang) {
-  this.bundleUrl = "resource://calendar/chrome/calendar-LOCALE/calendar-extract.properties";
+  this.bundleUrl = "resource:///chrome/LOCALE/locale/LOCALE/calendar/calendar-extract.properties";
   this.fallbackLocale = fallbackLocale;
   this.email = "";
   this.marker = "--MARK--";
   // this should never be found in an email
   this.defPattern = "061dc19c-719f-47f3-b2b5-e767e6f02b7a";
   this.collected = [];
   this.numbers = [];
   this.hourlyNumbers = [];
--- a/calendar/base/src/calItemModule.js
+++ b/calendar/base/src/calItemModule.js
@@ -27,41 +27,41 @@
 /* import-globals-from calTodo.js */
 /* import-globals-from calWeekInfoService.js */
 
 var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 this._NSGetFactory = cid => {
   let scriptLoadOrder = [
-    "resource://calendar/calendar-js/calItemBase.js",
-    "resource://calendar/calendar-js/calCachedCalendar.js",
+    "resource:///components/calItemBase.js",
+    "resource:///components/calCachedCalendar.js",
 
-    "resource://calendar/calendar-js/calAlarm.js",
-    "resource://calendar/calendar-js/calAlarmMonitor.js",
-    "resource://calendar/calendar-js/calAlarmService.js",
-    "resource://calendar/calendar-js/calAttendee.js",
-    "resource://calendar/calendar-js/calAttachment.js",
-    "resource://calendar/calendar-js/calCalendarManager.js",
-    "resource://calendar/calendar-js/calCalendarSearchService.js",
-    "resource://calendar/calendar-js/calDateTimeFormatter.js",
-    "resource://calendar/calendar-js/calDeletedItems.js",
-    "resource://calendar/calendar-js/calEvent.js",
-    "resource://calendar/calendar-js/calFreeBusyService.js",
-    "resource://calendar/calendar-js/calIcsParser.js",
-    "resource://calendar/calendar-js/calIcsSerializer.js",
-    "resource://calendar/calendar-js/calItipItem.js",
-    "resource://calendar/calendar-js/calProtocolHandler.js",
-    "resource://calendar/calendar-js/calRecurrenceDate.js",
-    "resource://calendar/calendar-js/calRecurrenceInfo.js",
-    "resource://calendar/calendar-js/calRelation.js",
-    "resource://calendar/calendar-js/calStartupService.js",
-    "resource://calendar/calendar-js/calTransactionManager.js",
-    "resource://calendar/calendar-js/calTodo.js",
-    "resource://calendar/calendar-js/calWeekInfoService.js",
+    "resource:///components/calAlarm.js",
+    "resource:///components/calAlarmMonitor.js",
+    "resource:///components/calAlarmService.js",
+    "resource:///components/calAttendee.js",
+    "resource:///components/calAttachment.js",
+    "resource:///components/calCalendarManager.js",
+    "resource:///components/calCalendarSearchService.js",
+    "resource:///components/calDateTimeFormatter.js",
+    "resource:///components/calDeletedItems.js",
+    "resource:///components/calEvent.js",
+    "resource:///components/calFreeBusyService.js",
+    "resource:///components/calIcsParser.js",
+    "resource:///components/calIcsSerializer.js",
+    "resource:///components/calItipItem.js",
+    "resource:///components/calProtocolHandler.js",
+    "resource:///components/calRecurrenceDate.js",
+    "resource:///components/calRecurrenceInfo.js",
+    "resource:///components/calRelation.js",
+    "resource:///components/calStartupService.js",
+    "resource:///components/calTransactionManager.js",
+    "resource:///components/calTodo.js",
+    "resource:///components/calWeekInfoService.js",
   ];
 
   for (let script of scriptLoadOrder) {
     Services.scriptloader.loadSubScript(script, this);
   }
 
   let components = [
     calAlarm,
--- a/calendar/base/src/calStartupService.js
+++ b/calendar/base/src/calStartupService.js
@@ -63,17 +63,17 @@ calStartupService.prototype = {
 
     // Localization service
     let locales = {
       startup: function(aCompleteListener) {
         let packaged = Services.locale.packagedLocales;
         let fileSrc = new FileSource(
           "calendar",
           packaged,
-          "resource://calendar/chrome/calendar-{locale}/locale/{locale}/"
+          "resource:///chrome/{locale}/locale/{locale}/calendar/"
         );
         L10nRegistry.registerSource(fileSrc);
         aCompleteListener.onResult(null, Cr.NS_OK);
       },
       shutdown: function(aCompleteListener) {
         aCompleteListener.onResult(null, Cr.NS_OK);
       },
     };
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -98,17 +98,17 @@ calTimezoneService.prototype = {
             resolve(tzData);
           } catch (ex) {
             reject(ex);
           }
         });
       });
     }
 
-    fetchJSON("resource://calendar/timezones/zones.json")
+    fetchJSON("resource:///res/zones.json")
       .then(tzData => {
         for (let tzid of Object.keys(tzData.aliases)) {
           let data = tzData.aliases[tzid];
           if (typeof data == "object" && data !== null) {
             this.mZones.set(tzid, data);
           }
         }
         for (let tzid of Object.keys(tzData.zones)) {
@@ -851,12 +851,12 @@ function guessSystemTimezone() {
     Cu.reportError(ex);
   }
 
   // return the guessed timezone
   return probableTZId;
 }
 
 this.NSGetFactory = cid => {
-  Services.scriptloader.loadSubScript("resource://calendar/calendar-js/calTimezone.js", this);
+  Services.scriptloader.loadSubScript("resource:///components/calTimezone.js", this);
   this.NSGetFactory = XPCOMUtils.generateNSGetFactory([calTimezoneService]);
   return this.NSGetFactory(cid);
 };
--- a/calendar/import-export/calImportExportModule.js
+++ b/calendar/import-export/calImportExportModule.js
@@ -9,23 +9,23 @@
 /* import-globals-from calMonthGridPrinter.js */
 /* import-globals-from calWeekPrinter.js */
 
 var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 this.NSGetFactory = cid => {
   let scriptLoadOrder = [
-    "resource://calendar/calendar-js/calIcsImportExport.js",
-    "resource://calendar/calendar-js/calHtmlExport.js",
-    "resource://calendar/calendar-js/calOutlookCSVImportExport.js",
+    "resource:///components/calIcsImportExport.js",
+    "resource:///components/calHtmlExport.js",
+    "resource:///components/calOutlookCSVImportExport.js",
 
-    "resource://calendar/calendar-js/calListFormatter.js",
-    "resource://calendar/calendar-js/calMonthGridPrinter.js",
-    "resource://calendar/calendar-js/calWeekPrinter.js",
+    "resource:///components/calListFormatter.js",
+    "resource:///components/calMonthGridPrinter.js",
+    "resource:///components/calWeekPrinter.js",
   ];
 
   for (let script of scriptLoadOrder) {
     Services.scriptloader.loadSubScript(script, this);
   }
 
   let components = [
     calIcsImporter,
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -3277,15 +3277,12 @@ calDavObserver.prototype = {
   onError: function(aCalendar, aErrNo, aMessage) {
     this.mCalendar.readOnly = true;
     this.mCalendar.notifyError(aErrNo, aMessage);
   },
 };
 
 /** Module Registration */
 this.NSGetFactory = cid => {
-  Services.scriptloader.loadSubScript(
-    "resource://calendar/calendar-js/calDavRequestHandlers.js",
-    this
-  );
+  Services.scriptloader.loadSubScript("resource:///components/calDavRequestHandlers.js", this);
   this.NSGetFactory = XPCOMUtils.generateNSGetFactory([calDavCalendar]);
   return this.NSGetFactory(cid);
 };
--- a/calendar/test/unit/test_imip.js
+++ b/calendar/test/unit/test_imip.js
@@ -1,16 +1,16 @@
 /* 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/. */
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var calItipEmailTransport = {};
 Services.scriptloader.loadSubScript(
-  "resource://calendar/components/calItipEmailTransport.js",
+  "resource:///components/calItipEmailTransport.js",
   calItipEmailTransport
 );
 
 function itipItemForTest(title, seq) {
   let itipItem = Cc["@mozilla.org/calendar/itip-item;1"].createInstance(Ci.calIItipItem);
   itipItem.init(
     [
       "BEGIN:VCALENDAR",