Bug 1502774 - Part 3: Remove nsAuthModule r=valentin
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 29 Oct 2018 14:59:24 +0000
changeset 443347 6b821f5b12ae5c9520a0d1da2575094b5a532899
parent 443346 b3bf57d996a72f0a8843b85ec3e0379092a7bf87
child 443348 9b13397e4ca57cd1e6bcb9b1586d55455924656b
push id71908
push usereakhgari@mozilla.com
push dateMon, 29 Oct 2018 15:06:25 +0000
treeherderautoland@6b821f5b12ae [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);