Backout changeset 9e6e20d26c0d (bug 1488305) because it hasn't been reviewed yet

This commit is contained in:
Ehsan Akhgari 2018-09-05 10:03:24 -04:00
Родитель 266b53e783
Коммит 5b13de3efe
7 изменённых файлов: 22 добавлений и 38 удалений

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

@ -629,6 +629,18 @@
{0x97, 0xa7, 0x06, 0xaf, 0x5e, 0x6d, 0x84, 0xc4} \
}
// Background channel registrar used for pairing HttpChannelParent
// and its background channel
#define NS_BACKGROUNDCHANNELREGISTRAR_CONTRACTID \
"@mozilla.org/network/background-channel-registrar;1"
#define NS_BACKGROUNDCHANNELREGISTRAR_CID \
{ /* 6907788a-17cc-4c2a-a7c5-59ad2d9cc079 */ \
0x6907788a, \
0x17cc, \
0x4c2a, \
{ 0xa7, 0xc5, 0x59, 0xad, 0x2d, 0x9c, 0xc0, 0x79} \
}
/******************************************************************************
* netwerk/protocol/ftp/ classes
*/

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

@ -37,7 +37,6 @@
#include "nsIContentSniffer.h"
#include "Predictor.h"
#include "nsIThreadPool.h"
#include "mozilla/net/BackgroundChannelRegistrar.h"
#include "mozilla/net/NeckoChild.h"
#include "RedirectChannelRegistrar.h"
@ -251,6 +250,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
#include "nsHttpNTLMAuth.h"
#include "nsHttpActivityDistributor.h"
#include "ThrottleQueue.h"
#include "BackgroundChannelRegistrar.h"
#undef LOG
#undef LOG_ENABLED
namespace mozilla {
@ -264,6 +264,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpActivityDistributor)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpBasicAuth)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpDigestAuth)
NS_GENERIC_FACTORY_CONSTRUCTOR(ThrottleQueue)
NS_GENERIC_FACTORY_CONSTRUCTOR(BackgroundChannelRegistrar)
} // namespace net
} // namespace mozilla
@ -647,8 +648,6 @@ static void nsNetShutdown()
mozilla::net::RedirectChannelRegistrar::Shutdown();
mozilla::net::BackgroundChannelRegistrar::Shutdown();
delete gNetSniffers;
gNetSniffers = nullptr;
delete gDataSniffers;
@ -723,6 +722,7 @@ NS_DEFINE_NAMED_CID(NS_HTTPAUTHMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPCHANNELAUTHPROVIDER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPACTIVITYDISTRIBUTOR_CID);
NS_DEFINE_NAMED_CID(NS_THROTTLEQUEUE_CID);
NS_DEFINE_NAMED_CID(NS_BACKGROUNDCHANNELREGISTRAR_CID);
NS_DEFINE_NAMED_CID(NS_FTPPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_RESPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_EXTENSIONPROTOCOLHANDLER_CID);
@ -842,6 +842,7 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
{ &kNS_HTTPCHANNELAUTHPROVIDER_CID, false, nullptr, mozilla::net::nsHttpChannelAuthProviderConstructor },
{ &kNS_HTTPACTIVITYDISTRIBUTOR_CID, false, nullptr, mozilla::net::nsHttpActivityDistributorConstructor },
{ &kNS_THROTTLEQUEUE_CID, false, nullptr, mozilla::net::ThrottleQueueConstructor },
{ &kNS_BACKGROUNDCHANNELREGISTRAR_CID, false, nullptr, mozilla::net::BackgroundChannelRegistrarConstructor },
{ &kNS_FTPPROTOCOLHANDLER_CID, false, nullptr, nsFtpProtocolHandlerConstructor },
{ &kNS_RESPROTOCOLHANDLER_CID, false, nullptr, nsResProtocolHandlerConstructor },
{ &kNS_EXTENSIONPROTOCOLHANDLER_CID, false, nullptr, mozilla::ExtensionProtocolHandlerConstructor },
@ -967,6 +968,7 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_HTTPCHANNELAUTHPROVIDER_CONTRACTID, &kNS_HTTPCHANNELAUTHPROVIDER_CID },
{ NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &kNS_HTTPACTIVITYDISTRIBUTOR_CID },
{ NS_THROTTLEQUEUE_CONTRACTID, &kNS_THROTTLEQUEUE_CID },
{ NS_BACKGROUNDCHANNELREGISTRAR_CONTRACTID, &kNS_BACKGROUNDCHANNELREGISTRAR_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ftp", &kNS_FTPPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource", &kNS_RESPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-extension", &kNS_EXTENSIONPROTOCOLHANDLER_CID },

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

@ -10,11 +10,6 @@
#include "HttpChannelParent.h"
#include "nsIInterfaceRequestor.h"
#include "nsXULAppAPI.h"
#include "mozilla/StaticPtr.h"
namespace {
mozilla::StaticRefPtr<mozilla::net::BackgroundChannelRegistrar> gSingleton;
}
namespace mozilla {
namespace net {
@ -35,24 +30,6 @@ BackgroundChannelRegistrar::~BackgroundChannelRegistrar()
MOZ_ASSERT(NS_IsMainThread());
}
// static
already_AddRefed<nsIBackgroundChannelRegistrar>
BackgroundChannelRegistrar::GetOrCreate()
{
if (!gSingleton) {
gSingleton = new BackgroundChannelRegistrar();
}
return do_AddRef(gSingleton);
}
// static
void
BackgroundChannelRegistrar::Shutdown()
{
MOZ_ASSERT(NS_IsMainThread());
gSingleton = nullptr;
}
void
BackgroundChannelRegistrar::NotifyChannelLinked(
HttpChannelParent* aChannelParent,

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

@ -9,7 +9,6 @@
#include "nsIBackgroundChannelRegistrar.h"
#include "nsRefPtrHashtable.h"
#include "mozilla/AlreadyAddRefed.h"
namespace mozilla {
namespace net {
@ -29,11 +28,6 @@ public:
explicit BackgroundChannelRegistrar();
// Singleton accessor
static already_AddRefed<nsIBackgroundChannelRegistrar> GetOrCreate();
static void Shutdown();
private:
virtual ~BackgroundChannelRegistrar();

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

@ -14,7 +14,7 @@
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Unused.h"
#include "mozilla/net/BackgroundChannelRegistrar.h"
#include "nsIBackgroundChannelRegistrar.h"
#include "nsNetCID.h"
#include "nsQueryObject.h"
#include "nsThreadUtils.h"
@ -54,7 +54,7 @@ public:
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIBackgroundChannelRegistrar> registrar =
BackgroundChannelRegistrar::GetOrCreate();
do_GetService(NS_BACKGROUNDCHANNELREGISTRAR_CONTRACTID);
MOZ_ASSERT(registrar);
registrar->LinkBackgroundChannel(mChannelId, mActor);

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

@ -26,7 +26,7 @@
#include "nsNetUtil.h"
#include "nsISupportsPriority.h"
#include "nsIAuthPromptProvider.h"
#include "mozilla/net/BackgroundChannelRegistrar.h"
#include "nsIBackgroundChannelRegistrar.h"
#include "nsSerializationHelper.h"
#include "nsISerializable.h"
#include "nsIAssociatedContentSecurity.h"
@ -263,7 +263,7 @@ HttpChannelParent::CleanupBackgroundChannel()
// This HttpChannelParent might still have a reference from
// BackgroundChannelRegistrar.
nsCOMPtr<nsIBackgroundChannelRegistrar> registrar =
BackgroundChannelRegistrar::GetOrCreate();
do_GetService(NS_BACKGROUNDCHANNELREGISTRAR_CONTRACTID);
MOZ_ASSERT(registrar);
registrar->DeleteChannel(mChannel->ChannelId());
@ -730,7 +730,7 @@ HttpChannelParent::WaitForBgParent()
nsCOMPtr<nsIBackgroundChannelRegistrar> registrar =
BackgroundChannelRegistrar::GetOrCreate();
do_GetService(NS_BACKGROUNDCHANNELREGISTRAR_CONTRACTID);
MOZ_ASSERT(registrar);
registrar->LinkHttpChannel(mChannel->ChannelId(), this);

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

@ -38,7 +38,6 @@ EXPORTS += [
EXPORTS.mozilla.net += [
'AltDataOutputStreamChild.h',
'AltDataOutputStreamParent.h',
'BackgroundChannelRegistrar.h',
'HttpAuthUtils.h',
'HttpBackgroundChannelChild.h',
'HttpBackgroundChannelParent.h',