Commit 5b13de3e authored by Ehsan Akhgari's avatar Ehsan Akhgari
Browse files

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

parent 266b53e7
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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
 */
+5 −3
Original line number Diff line number Diff line
@@ -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 },
+0 −23
Original line number Diff line number Diff line
@@ -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,
+0 −6
Original line number Diff line number Diff line
@@ -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();

+2 −2
Original line number Diff line number Diff line
@@ -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);
Loading