Bug 1502774 - Part 3: Remove nsAuthModule r=valentin
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 01 Nov 2018 10:39:58 +0000
changeset 443940 32c4433496ab85436ec4797109bd830094c0781a
parent 443939 5662f3757fb48b894966f7d36841a9dbd6f66b98
child 443941 cc154f685edec9f190a9d3b0c8acd551861879b4
push id34976
push userdvarga@mozilla.com
push dateThu, 01 Nov 2018 22:26:55 +0000
treeherdermozilla-central@b953c577afe2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1502774
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1502774 - Part 3: Remove nsAuthModule r=valentin Depends on D10026 Differential Revision: https://phabricator.services.mozilla.com/D10027
extensions/auth/moz.build
extensions/auth/nsAuthFactory.cpp
extensions/auth/nsIAuthModule.cpp
netwerk/build/moz.build
netwerk/build/nsNetModule.cpp
--- a/extensions/auth/moz.build
+++ b/extensions/auth/moz.build
@@ -1,22 +1,22 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 UNIFIED_SOURCES += [
-    'nsAuthFactory.cpp',
     'nsAuthGSSAPI.cpp',
 ]
 
 SOURCES += [
     'nsAuthSASL.cpp',
     'nsHttpNegotiateAuth.cpp', # contains constants whose names conflict with constants in other files
+    'nsIAuthModule.cpp',       # includes windows.h recursively which conflicts with TimeStamp.h
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsAuthSSPI.cpp',
     ]
     DEFINES['USE_SSPI'] = True
 else:
rename from extensions/auth/nsAuthFactory.cpp
rename to extensions/auth/nsIAuthModule.cpp
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsIAuthModule.cpp
@@ -1,35 +1,24 @@
 /* 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 "mozilla/ModuleUtils.h"
-#include "nsCRT.h"
 #include "nsIAuthModule.h"
-
-//-----------------------------------------------------------------------------
-#include "nsAuthGSSAPI.h"
 #if defined( USE_SSPI )
 #include "nsAuthSSPI.h"
 #else
 #include "nsAuthSambaNTLM.h"
 #endif
+#include "nsCRT.h"
+#include "nsAuthGSSAPI.h"
 #include "nsAuthSASL.h"
 #include "nsNTLMAuthModule.h"
 #include "nsNSSComponent.h"
 
-static const mozilla::Module::CIDEntry kAuthCIDs[] = {
-  { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kAuthContracts[] = {
-  { nullptr }
-};
-
 // static
 already_AddRefed<nsIAuthModule>
 nsIAuthModule::CreateInstance(const char* aType)
 {
   nsCOMPtr<nsIAuthModule> auth;
   if (!nsCRT::strcmp(aType, "kerb-gss")) {
     auth = new nsAuthGSSAPI(PACKAGE_TYPE_KERBEROS);
   } else if (!nsCRT::strcmp(aType, "negotiate-gss")) {
@@ -68,35 +57,9 @@ nsIAuthModule::CreateInstance(const char
     auth = ntlmAuth.forget();
   } else {
     return nullptr;
   }
 
   return auth.forget();
 }
 
-//-----------------------------------------------------------------------------
 mozilla::LazyLogModule gNegotiateLog("negotiateauth");
-
-// setup nspr logging ...
-static nsresult
-InitNegotiateAuth()
-{
-  return NS_OK;
-}
-
-static void
-DestroyNegotiateAuth()
-{
-  nsAuthGSSAPI::Shutdown();
-}
-
-static const mozilla::Module kAuthModule = {
-  mozilla::Module::kVersion,
-  kAuthCIDs,
-  kAuthContracts,
-  nullptr,
-  nullptr,
-  InitNegotiateAuth,
-  DestroyNegotiateAuth
-};
-
-NSMODULE_DEFN(nsAuthModule) = &kAuthModule;
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -12,16 +12,17 @@ SOURCES += [
     'nsNetModule.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
+    '/extensions/auth',
     '/netwerk/base',
     '/netwerk/cache',
     '/netwerk/dns',
     '/netwerk/mime',
     '/netwerk/protocol/about',
     '/netwerk/protocol/data',
     '/netwerk/protocol/file',
     '/netwerk/protocol/ftp',
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -34,16 +34,17 @@
 #include "nsXULAppAPI.h"
 #include "nsCategoryCache.h"
 #include "nsIContentSniffer.h"
 #include "Predictor.h"
 #include "nsIThreadPool.h"
 #include "mozilla/net/BackgroundChannelRegistrar.h"
 #include "mozilla/net/NeckoChild.h"
 #include "RedirectChannelRegistrar.h"
+#include "nsAuthGSSAPI.h"
 
 #include "nsNetCID.h"
 
 #if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_LINUX)
 #define BUILD_NETWORK_INFO_SERVICE 1
 #endif
 
 typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
@@ -615,16 +616,18 @@ static void nsNetShutdown()
     mozilla::net::WebSocketChannel::Shutdown();
 
     mozilla::net::Http2CompressionCleanup();
 
     mozilla::net::RedirectChannelRegistrar::Shutdown();
 
     mozilla::net::BackgroundChannelRegistrar::Shutdown();
 
+    nsAuthGSSAPI::Shutdown();
+
     delete gNetSniffers;
     gNetSniffers = nullptr;
     delete gDataSniffers;
     gDataSniffers = nullptr;
 }
 
 NS_DEFINE_NAMED_CID(NS_IOSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_STREAMTRANSPORTSERVICE_CID);