Bug 1555633 - Backed out changeset ec6a2a472a5e for causing test failures in chrome/test/unit/test_no_remote_registration.js. a=backout DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sat, 22 Jun 2019 11:05:28 +0200
changeset 35924 9bbc721229fddcf5f209bbc33f4449ce58211647
parent 35923 aedfbb684ce8128dff40ab4619599393a3e44edd
child 35925 e2aac84cae9495a19c1ad87cc74825933c11a306
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersbackout
bugs1555633
Bug 1555633 - Backed out changeset ec6a2a472a5e for causing test failures in chrome/test/unit/test_no_remote_registration.js. a=backout DONTBUILD
mailnews/base/public/moz.build
mailnews/base/public/nsIMsgProtocolHandler.idl
mailnews/base/util/nsNewMailnewsURI.cpp
--- a/mailnews/base/public/moz.build
+++ b/mailnews/base/public/moz.build
@@ -40,17 +40,16 @@ XPIDL_SOURCES += [
     'nsIMsgMailNewsUrl.idl',
     'nsIMsgMailSession.idl',
     'nsIMsgMdnGenerator.idl',
     'nsIMsgMessageService.idl',
     'nsIMsgOfflineManager.idl',
     'nsIMsgPluggableStore.idl',
     'nsIMsgPrintEngine.idl',
     'nsIMsgProgress.idl',
-    'nsIMsgProtocolHandler.idl',
     'nsIMsgProtocolInfo.idl',
     'nsIMsgPurgeService.idl',
     'nsIMsgShutdown.idl',
     'nsIMsgStatusFeedback.idl',
     'nsIMsgTagService.idl',
     'nsIMsgThread.idl',
     'nsIMsgUserFeedbackListener.idl',
     'nsIMsgWindow.idl',
deleted file mode 100644
--- a/mailnews/base/public/nsIMsgProtocolHandler.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; 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/. */
-
-#include "nsISupports.idl"
-
-interface nsIURI;
-
-[scriptable, uuid(4e9e4a43-343a-4309-a88b-08c5f37f5965)]
-interface nsIMsgProtocolHandler : nsISupports {
-  nsIURI newURI(in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI);
-};
--- a/mailnews/base/util/nsNewMailnewsURI.cpp
+++ b/mailnews/base/util/nsNewMailnewsURI.cpp
@@ -2,21 +2,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/. */
 
 #include "nsNewMailnewsURI.h"
 #include "nsURLHelper.h"
 #include "nsSimpleURI.h"
 #include "nsStandardURL.h"
-#include "nsThreadUtils.h"
-#include "MainThreadUtils.h"
-#include "mozilla/SyncRunnable.h"
-#include "nsIMsgProtocolHandler.h"
-#include "nsIComponentRegistrar.h"
 
 #include "../../local/src/nsPop3Service.h"
 #include "../../local/src/nsMailboxService.h"
 #include "../../compose/src/nsSmtpService.h"
 #include "../../../ldap/xpcom/src/nsLDAPURL.h"
 #include "../../imap/src/nsImapService.h"
 #include "../../news/src/nsNntpService.h"
 #include "../../addrbook/src/nsAddbookProtocolHandler.h"
@@ -85,38 +80,13 @@ nsresult NS_NewMailnewsURI(nsIURI** aURI
         .Finalize(aURI);
   }
   if (scheme.EqualsLiteral("webcal") || scheme.EqualsLiteral("webcals")) {
     return NS_MutateURI(new mozilla::net::nsStandardURL::Mutator())
         .SetSpec(aSpec)
         .Finalize(aURI);
   }
 
-  nsCOMPtr<nsIComponentRegistrar> compMgr;
-  NS_GetComponentRegistrar(getter_AddRefs(compMgr));
-  if (compMgr) {
-    nsAutoCString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX);
-    contractID += scheme;
-    bool isRegistered = false;
-    compMgr->IsContractIDRegistered(contractID.get(), &isRegistered);
-    if (isRegistered) {
-      auto NewURI =
-          [&aSpec, &aCharset, &aBaseURI, aURI, &contractID, &rv ]() -> auto {
-        nsCOMPtr<nsIMsgProtocolHandler> handler(
-            do_GetService(contractID.get(), &rv));
-        if (handler) {
-          rv = handler->NewURI(aSpec, aCharset, aBaseURI, aURI);
-        }
-      };
-      if (NS_IsMainThread()) {
-        NewURI();
-      } else {
-        nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction("NewURI", NewURI);
-        mozilla::SyncRunnable::DispatchToThread(
-            mozilla::GetMainThreadEventTarget(), task);
-      }
-      return rv;
-    }
-  }
+  // XXX TODO: What about JS Account?
 
   // None of the above, return an error and let M-C handle it.
   return NS_ERROR_UNKNOWN_PROTOCOL;
 }