Bug 1555633 - Backed out changeset ec6a2a472a5e for causing test failures in chrome/test/unit/test_no_remote_registration.js. a=backout DONTBUILD

--HG--
extra : rebase_source : 3eea65173cae5b1b64ccbe59e832004548f8584f
This commit is contained in:
Jorg K 2019-06-22 11:05:28 +02:00
Родитель 7fdf19b83e
Коммит d504627d43
3 изменённых файлов: 1 добавлений и 45 удалений

Просмотреть файл

@ -45,7 +45,6 @@ XPIDL_SOURCES += [
'nsIMsgPluggableStore.idl',
'nsIMsgPrintEngine.idl',
'nsIMsgProgress.idl',
'nsIMsgProtocolHandler.idl',
'nsIMsgProtocolInfo.idl',
'nsIMsgPurgeService.idl',
'nsIMsgShutdown.idl',

Просмотреть файл

@ -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);
};

Просмотреть файл

@ -7,11 +7,6 @@
#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"
@ -90,32 +85,7 @@ nsresult NS_NewMailnewsURI(nsIURI** aURI, const nsACString& 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;