Bug 1527772 - Move folder-factory lookup out of RDF. r=aceman
authorBen Campbell <benc@thunderbird.net>
Tue, 24 Sep 2019 17:11:51 +1200
changeset 36936 3970c1407633ddcc191872e8a411ee40c1c1ef42
parent 36935 729209b67d4514942041ff5d84ec799043991be6
child 36937 62176929a3c9aebc346b044da5caa233845b5f76
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersaceman
bugs1527772
Bug 1527772 - Move folder-factory lookup out of RDF. r=aceman
mail/components/im/modules/index_im.jsm
mailnews/base/public/nsMsgBaseCID.h
mailnews/base/src/folderLookupService.js
mailnews/base/util/nsMsgDBFolder.h
mailnews/build/nsMailModule.cpp
mailnews/jsaccount/test/unit/resources/testComponents.manifest
mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm
mailnews/local/public/nsMsgLocalCID.h
mailnews/news/public/nsMsgNewsCID.h
--- a/mail/components/im/modules/index_im.jsm
+++ b/mail/components/im/modules/index_im.jsm
@@ -55,17 +55,17 @@ var ScriptableInputStream = CC(
   "init"
 );
 
 // kIndexingDelay is how long we wait from the point of scheduling an indexing
 // job to actually carrying it out.
 var kIndexingDelay = 5000; // in milliseconds
 
 XPCOMUtils.defineLazyGetter(this, "MailFolder", () =>
-  Cc["@mozilla.org/rdf/resource-factory;1?name=mailbox"].createInstance(
+  Cc["@mozilla.org/mail/folder-factory;1?name=mailbox"].createInstance(
     Ci.nsIMsgFolder
   )
 );
 
 var gIMAccounts = {};
 
 function GlodaIMConversation(aTitle, aTime, aPath, aContent) {
   // grokNounItem from gloda.js puts automatically the values of all
--- a/mailnews/base/public/nsMsgBaseCID.h
+++ b/mailnews/base/public/nsMsgBaseCID.h
@@ -527,9 +527,13 @@
     0x740880E6, 0xE299, 0x4165, {                    \
       0xB8, 0x2F, 0xDF, 0x1D, 0xCA, 0xB3, 0xAE, 0x22 \
     }                                                \
   }
 
 #define MOZ_NEWMAILNOTIFICATIONSERVICE_CONTRACTID \
   "@mozilla.org/newMailNotificationService;1"
 
+#define NS_FOLDER_FACTORY_CONTRACTID "@mozilla.org/mail/folder-factory;1"
+#define NS_FOLDER_FACTORY_CONTRACTID_PREFIX \
+  NS_FOLDER_FACTORY_CONTRACTID "?name="
+
 #endif  // nsMessageBaseCID_h__
--- a/mailnews/base/src/folderLookupService.js
+++ b/mailnews/base/src/folderLookupService.js
@@ -65,17 +65,17 @@ folderLookupService.prototype = {
       return folder;
     }
 
     // Create new folder.
 
     // Check that uri has an active scheme, in case this folder is from
     // an extension that is currently disabled or hasn't started up yet.
     let scheme = uri.match(/\w*/)[0];
-    let contractID = "@mozilla.org/rdf/resource-factory;1?name=" + scheme;
+    let contractID = "@mozilla.org/mail/folder-factory;1?name=" + scheme;
     if (!(contractID in Cc)) {
       Cu.reportError(
         "getOrCreateFolderForURL: factory not registered for " + uri
       );
       return null;
     }
 
     let factory = Components.manager.getClassObject(
--- a/mailnews/base/util/nsMsgDBFolder.h
+++ b/mailnews/base/util/nsMsgDBFolder.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsMsgDBFolder_h__
 #define nsMsgDBFolder_h__
 
 #include "mozilla/Attributes.h"
 #include "msgCore.h"
 #include "nsIMsgFolder.h"
-#include "nsRDFResource.h"
 #include "nsIDBFolderInfo.h"
 #include "nsIMsgDatabase.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsCOMPtr.h"
 #include "nsIDBChangeListener.h"
 #include "nsIMsgPluggableStore.h"
 #include "nsIURL.h"
 #include "nsIFile.h"
--- a/mailnews/build/nsMailModule.cpp
+++ b/mailnews/build/nsMailModule.cpp
@@ -1228,17 +1228,17 @@ const mozilla::Module::ContractIDEntry k
     {JACPPINCOMINGSERVERDELEGATOR_CONTRACTID,
      &kJACPPINCOMINGSERVERDELEGATOR_CID},
     {JACPPMSGFOLDERDELEGATOR_CONTRACTID, &kJACPPMSGFOLDERDELEGATOR_CID},
     {JACPPSENDDELEGATOR_CONTRACTID, &kJACPPSENDDELEGATOR_CID},
     {JACPPURLDELEGATOR_CONTRACTID, &kJACPPURLDELEGATOR_CID},
 #endif
     // Imap Entries
     {NS_IMAPINCOMINGSERVER_CONTRACTID, &kNS_IMAPINCOMINGSERVER_CID},
-    {NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "imap", &kNS_IMAPRESOURCE_CID},
+    {NS_FOLDER_FACTORY_CONTRACTID_PREFIX "imap", &kNS_IMAPRESOURCE_CID},
     {"@mozilla.org/messenger/messageservice;1?type=imap-message",
      &kNS_IMAPSERVICE_CID},
     {"@mozilla.org/messenger/messageservice;1?type=imap", &kNS_IMAPSERVICE_CID},
     {NS_IMAPSERVICE_CONTRACTID, &kNS_IMAPSERVICE_CID},
     {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "imap", &kNS_IMAPSERVICE_CID},
     {NS_IMAPPROTOCOLINFO_CONTRACTID, &kNS_IMAPSERVICE_CID},
     {NS_CONTENT_HANDLER_CONTRACTID_PREFIX "x-application-imapfolder",
      &kNS_IMAPSERVICE_CID},
--- a/mailnews/jsaccount/test/unit/resources/testComponents.manifest
+++ b/mailnews/jsaccount/test/unit/resources/testComponents.manifest
@@ -4,17 +4,17 @@
 # Definitions of components used in testing of JsAccount
 
 # nsIMsgMailNewsUrl implementation of a demo base URL
 component {73F98539-A59F-4F6F-9A72-D83A08646C23} testJaFooUrlComponent.js
 contract @mozilla.org/jsaccount/testjafoourl;1 {73F98539-A59F-4F6F-9A72-D83A08646C23}
 
 # nsIMsgFolder implementation
 component {8508ddeb-3eab-4877-a420-297518f62371} testJaBaseMsgFolderComponent.js
-contract @mozilla.org/rdf/resource-factory;1?name=testja {8508ddeb-3eab-4877-a420-297518f62371}
+contract @mozilla.org/mail/folder-factory;1?name=testja {8508ddeb-3eab-4877-a420-297518f62371}
 
 # nsIMsgIncomingServer implementation
 component {0eec03cd-da67-4949-ab2d-5fa4bdc68135} testJaBaseIncomingServerComponent.js
 contract @mozilla.org/messenger/server;1?type=testja {0eec03cd-da67-4949-ab2d-5fa4bdc68135}
 
 # nsIMsgProtocolInfo implementation
 component {74b9b9c3-9594-41c4-b9f0-326e5daac2e0} testJaMsgProtocolInfoComponent.js
 contract @mozilla.org/messenger/protocol/info;1?type=testja {74b9b9c3-9594-41c4-b9f0-326e5daac2e0}
--- a/mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm
+++ b/mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm
@@ -21,17 +21,17 @@ const JaBaseMsgFolderProperties = {
     Ci.nsIDBChangeListener,
     Ci.nsIUrlListener,
     Ci.nsIJunkMailClassificationListener,
     Ci.nsIMsgTraitClassificationListener,
     Ci.nsIInterfaceRequestor,
     Ci.msgIOverride,
   ],
   delegateInterfaces: [Ci.nsIMsgFolder],
-  contractID: "@mozilla.org/rdf/resource-factory;1?name=testja",
+  contractID: "@mozilla.org/mail/folder-factory;1?name=testja",
   classID: Components.ID("{8508ddeb-3eab-4877-a420-297518f62371}"),
 };
 
 function JaBaseMsgFolder(aDelegator, aBaseInterfaces) {
   // Typical boilerplate to include in all implementations.
 
   // Object delegating method calls to the appropriate XPCOM object.
   // Weak because it owns us.
--- a/mailnews/local/public/nsMsgLocalCID.h
+++ b/mailnews/local/public/nsMsgLocalCID.h
@@ -9,17 +9,17 @@
 #include "nsMsgBaseCID.h"
 
 #define NS_POP3INCOMINGSERVER_TYPE "pop3"
 
 //
 // nsLocalMailFolderResourceCID
 //
 #define NS_LOCALMAILFOLDERRESOURCE_CONTRACTID \
-  NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "mailbox"
+  NS_FOLDER_FACTORY_CONTRACTID_PREFIX "mailbox"
 #define NS_LOCALMAILFOLDERRESOURCE_CID               \
   { /* e490d22c-cd67-11d2-8cca-0060b0fc14a3 */       \
     0xe490d22c, 0xcd67, 0x11d2, {                    \
       0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 \
     }                                                \
   }
 
 //
--- a/mailnews/news/public/nsMsgNewsCID.h
+++ b/mailnews/news/public/nsMsgNewsCID.h
@@ -9,17 +9,17 @@
 #include "nsISupports.h"
 #include "nsIFactory.h"
 #include "nsIComponentManager.h"
 #include "nsMsgBaseCID.h"
 
 //
 // nsMsgNewsFolder
 #define NS_NEWSFOLDERRESOURCE_CONTRACTID \
-  NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "news"
+  NS_FOLDER_FACTORY_CONTRACTID_PREFIX "news"
 #define NS_NEWSFOLDERRESOURCE_CID                    \
   { /* 4ace448a-f6d4-11d2-880d-004005263078 */       \
     0x4ace448a, 0xf6d4, 0x11d2, {                    \
       0x88, 0x0d, 0x00, 0x40, 0x05, 0x26, 0x30, 0x78 \
     }                                                \
   }
 
 //