Bug 784739 - Switch from NULL to nullptr in extensions/; r=ehsan
authormatekm <matekm@gmail.com>
Tue, 02 Apr 2013 21:06:20 -0400
changeset 127024 e0d063f04ee215165146043ce66975d7e3fd0cf0
parent 127023 fb7aae8421bcbe2168ad311f25ecf8ef4134a30d
child 127025 6af3167805da577c434871ea205bbb0d75b1ad67
push id25791
push usereakhgari@mozilla.com
push dateWed, 03 Apr 2013 01:06:37 +0000
treeherdermozilla-inbound@e0d063f04ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone23.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 784739 - Switch from NULL to nullptr in extensions/; r=ehsan
extensions/auth/gssapi.h
extensions/auth/nsAuthFactory.cpp
extensions/auth/nsAuthGSSAPI.cpp
extensions/auth/nsAuthSASL.cpp
extensions/auth/nsAuthSSPI.cpp
extensions/auth/nsHttpNegotiateAuth.cpp
extensions/cookie/nsCookieModule.cpp
extensions/cookie/nsCookiePermission.h
extensions/cookie/nsPermissionManager.cpp
extensions/gio/nsGIOProtocolHandler.cpp
extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
extensions/permissions/nsModuleFactory.cpp
extensions/pref/autoconfig/src/nsConfigFactory.cpp
extensions/pref/autoconfig/src/nsReadConfig.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozInlineSpellChecker.h
extensions/spellcheck/src/mozInlineSpellWordUtil.h
extensions/spellcheck/src/mozSpellChecker.cpp
extensions/spellcheck/src/mozSpellCheckerFactory.cpp
extensions/spellcheck/src/mozSpellI18NManager.cpp
extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
--- a/extensions/auth/gssapi.h
+++ b/extensions/auth/gssapi.h
@@ -240,17 +240,17 @@ typedef struct gss_channel_bindings_stru
  */
 #define GSS_C_NO_NAME ((gss_name_t) 0)
 #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
 #define GSS_C_NO_OID ((gss_OID) 0)
 #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
 #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
 #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
 #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
-#define GSS_C_EMPTY_BUFFER {0, NULL}
+#define GSS_C_EMPTY_BUFFER {0, nullptr}
 
 /*
  * Some alternate names for a couple of the above
  * values.  These are defined for V1 compatibility.
  */
 #define GSS_C_NULL_OID GSS_C_NO_OID
 #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
 
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsAuthFactory.cpp
@@ -184,43 +184,43 @@ NS_DEFINE_NAMED_CID(NS_SYSNTLMAUTH_CID);
 #else
 NS_DEFINE_NAMED_CID(NS_SAMBANTLMAUTH_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_HTTPNEGOTIATEAUTH_CID);
 NS_DEFINE_NAMED_CID(NS_AUTHSASL_CID);
 
 
 static const mozilla::Module::CIDEntry kAuthCIDs[] = {
-  { &kNS_GSSAUTH_CID, false, NULL, nsKerbGSSAPIAuthConstructor },
-  { &kNS_NEGOTIATEAUTH_CID, false, NULL, nsGSSAPIAuthConstructor },
+  { &kNS_GSSAUTH_CID, false, nullptr, nsKerbGSSAPIAuthConstructor },
+  { &kNS_NEGOTIATEAUTH_CID, false, nullptr, nsGSSAPIAuthConstructor },
 #if defined( USE_SSPI )
-  { &kNS_NEGOTIATEAUTHSSPI_CID, false, NULL, nsAuthSSPIConstructor },
-  { &kNS_KERBAUTHSSPI_CID, false, NULL, nsKerbSSPIAuthConstructor },
-  { &kNS_SYSNTLMAUTH_CID, false, NULL, nsSysNTLMAuthConstructor },
+  { &kNS_NEGOTIATEAUTHSSPI_CID, false, nullptr, nsAuthSSPIConstructor },
+  { &kNS_KERBAUTHSSPI_CID, false, nullptr, nsKerbSSPIAuthConstructor },
+  { &kNS_SYSNTLMAUTH_CID, false, nullptr, nsSysNTLMAuthConstructor },
 #else
-  { &kNS_SAMBANTLMAUTH_CID, false, NULL, nsSambaNTLMAuthConstructor },
+  { &kNS_SAMBANTLMAUTH_CID, false, nullptr, nsSambaNTLMAuthConstructor },
 #endif
-  { &kNS_HTTPNEGOTIATEAUTH_CID, false, NULL, nsHttpNegotiateAuthConstructor },
-  { &kNS_AUTHSASL_CID, false, NULL, nsAuthSASLConstructor },
-  { NULL }
+  { &kNS_HTTPNEGOTIATEAUTH_CID, false, nullptr, nsHttpNegotiateAuthConstructor },
+  { &kNS_AUTHSASL_CID, false, nullptr, nsAuthSASLConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kAuthContracts[] = {
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-gss", &kNS_GSSAUTH_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-gss", &kNS_NEGOTIATEAUTH_CID },
 #if defined( USE_SSPI )
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-sspi", &kNS_NEGOTIATEAUTHSSPI_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "kerb-sspi", &kNS_KERBAUTHSSPI_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SYSNTLMAUTH_CID },
 #else
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SAMBANTLMAUTH_CID },
 #endif
   { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "negotiate", &kNS_HTTPNEGOTIATEAUTH_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sasl-gssapi", &kNS_AUTHSASL_CID },
-  { NULL }
+  { nullptr }
 };
 
 //-----------------------------------------------------------------------------
 #if defined( PR_LOGGING )
 PRLogModuleInfo *gNegotiateLog;
 
 // setup nspr logging ...
 static nsresult
@@ -238,15 +238,15 @@ DestroyNegotiateAuth()
 {
   nsAuthGSSAPI::Shutdown();
 }
 
 static const mozilla::Module kAuthModule = {
   mozilla::Module::kVersion,
   kAuthCIDs,
   kAuthContracts,
-  NULL,
-  NULL,
+  nullptr,
+  nullptr,
   InitNegotiateAuth,
   DestroyNegotiateAuth
 };
 
 NSMODULE_DEFN(nsAuthModule) = &kAuthModule;
--- a/extensions/auth/nsAuthGSSAPI.cpp
+++ b/extensions/auth/nsAuthGSSAPI.cpp
@@ -57,26 +57,26 @@ static const char kNegotiateAuthGssLib[]
     "network.negotiate-auth.gsslib";
 static const char kNegotiateAuthNativeImp[] = 
    "network.negotiate-auth.using-native-gsslib";
 
 static struct GSSFunction {
     const char *str;
     PRFuncPtr func;
 } gssFuncs[] = {
-    { "gss_display_status", NULL },
-    { "gss_init_sec_context", NULL },
-    { "gss_indicate_mechs", NULL },
-    { "gss_release_oid_set", NULL },
-    { "gss_delete_sec_context", NULL },
-    { "gss_import_name", NULL },
-    { "gss_release_buffer", NULL },
-    { "gss_release_name", NULL },
-    { "gss_wrap", NULL },
-    { "gss_unwrap", NULL }
+    { "gss_display_status", nullptr },
+    { "gss_init_sec_context", nullptr },
+    { "gss_indicate_mechs", nullptr },
+    { "gss_release_oid_set", nullptr },
+    { "gss_delete_sec_context", nullptr },
+    { "gss_import_name", nullptr },
+    { "gss_release_buffer", nullptr },
+    { "gss_release_name", nullptr },
+    { "gss_wrap", nullptr },
+    { "gss_unwrap", nullptr }
 };
 
 static bool      gssNativeImp = true;
 static PRLibrary* gssLibrary = nullptr;
 
 #define gss_display_status_ptr      ((gss_display_status_type)*gssFuncs[0].func)
 #define gss_init_sec_context_ptr    ((gss_init_sec_context_type)*gssFuncs[1].func)
 #define gss_indicate_mechs_ptr      ((gss_indicate_mechs_type)*gssFuncs[2].func)
@@ -99,26 +99,26 @@ gssInit()
 {
     nsXPIDLCString libPath;
     nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (prefs) {
         prefs->GetCharPref(kNegotiateAuthGssLib, getter_Copies(libPath)); 
         prefs->GetBoolPref(kNegotiateAuthNativeImp, &gssNativeImp); 
     }
 
-    PRLibrary *lib = NULL;
+    PRLibrary *lib = nullptr;
 
     if (!libPath.IsEmpty()) {
         LOG(("Attempting to load user specified library [%s]\n", libPath.get()));
         gssNativeImp = false;
         lib = PR_LoadLibrary(libPath.get());
     }
     else {
 #ifdef XP_WIN
-        char *libName = PR_GetLibraryName(NULL, "gssapi32");
+        char *libName = PR_GetLibraryName(nullptr, "gssapi32");
         if (libName) {
             lib = PR_LoadLibrary("gssapi32");
             PR_FreeLibraryName(libName);
         }
 #else
         
         const char *const libNames[] = {
             "gss",
@@ -143,33 +143,33 @@ gssInit()
              * See Bugzilla #325433
              */
             if (lib &&
                 PR_FindFunctionSymbol(lib, 
                                       "internal_krb5_gss_initialize") &&
                 PR_FindFunctionSymbol(lib, "gssd_pname_to_uid")) {
                 LOG(("CITI libgssapi found, which calls exit(). Skipping\n"));
                 PR_UnloadLibrary(lib);
-                lib = NULL;
+                lib = nullptr;
             }
         }
 
         for (size_t i = 0; i < ArrayLength(libNames) && !lib; ++i) {
-            char *libName = PR_GetLibraryName(NULL, libNames[i]);
+            char *libName = PR_GetLibraryName(nullptr, libNames[i]);
             if (libName) {
                 lib = PR_LoadLibrary(libName);
                 PR_FreeLibraryName(libName);
 
                 if (lib &&
                     PR_FindFunctionSymbol(lib, 
                                           "internal_krb5_gss_initialize") &&
                     PR_FindFunctionSymbol(lib, "gssd_pname_to_uid")) {
                     LOG(("CITI libgssapi found, which calls exit(). Skipping\n"));
                     PR_UnloadLibrary(lib);
-                    lib = NULL;
+                    lib = nullptr;
                 } 
             }
         }
 #endif
     }
     
     if (!lib) {
         LOG(("Fail to load gssapi library\n"));
@@ -391,17 +391,17 @@ nsAuthGSSAPI::GetNextToken(const void *i
 
 #if defined(HAVE_RES_NINIT)
     res_ninit(&_res);
 #endif
     major_status = gss_import_name_ptr(&minor_status,
                                    &input_token,
                                    &gss_c_nt_hostbased_service,
                                    &server);
-    input_token.value = NULL;
+    input_token.value = nullptr;
     input_token.length = 0;
     if (GSS_ERROR(major_status)) {
         LogGssError(major_status, minor_status, "gss_import_name() failed");
         return NS_ERROR_FAILURE;
     }
 
     if (inToken) {
         input_token.length = inTokenLen;
@@ -424,17 +424,17 @@ nsAuthGSSAPI::GetNextToken(const void *i
     // the native lib
     KLBoolean found;    
     bool doingMailTask = mServiceName.Find("imap@") ||
                            mServiceName.Find("pop@") ||
                            mServiceName.Find("smtp@") ||
                            mServiceName.Find("ldap@");
     
     if (!doingMailTask && (gssNativeImp &&
-         (KLCacheHasValidTickets_ptr(NULL, kerberosVersion_V5, &found, NULL, NULL) != klNoErr || !found)))
+         (KLCacheHasValidTickets_ptr(nullptr, kerberosVersion_V5, &found, nullptr, nullptr) != klNoErr || !found)))
     {
         major_status = GSS_S_FAILURE;
         minor_status = 0;
     }
     else
 #endif /* XP_MACOSX */
     major_status = gss_init_sec_context_ptr(&minor_status,
                                             GSS_C_NO_CREDENTIAL,
@@ -468,17 +468,17 @@ nsAuthGSSAPI::GetNextToken(const void *i
         // next call.
         //
     } 
     
     *outTokenLen = output_token.length;
     if (output_token.length != 0)
         *outToken = nsMemory::Clone(output_token.value, output_token.length);
     else
-        *outToken = NULL;
+        *outToken = nullptr;
     
     gss_release_buffer_ptr(&minor_status, &output_token);
 
     if (major_status == GSS_S_COMPLETE)
         rv = NS_SUCCESS_AUTH_FINISHED;
     else
         rv = NS_OK;
 
@@ -502,31 +502,31 @@ nsAuthGSSAPI::Unwrap(const void *inToken
 
     input_token.value = (void *) inToken;
     input_token.length = inTokenLen;
 
     major_status = gss_unwrap_ptr(&minor_status,
                                   mCtx,
                                   &input_token,
                                   &output_token,
-                                  NULL,
-                                  NULL);
+                                  nullptr,
+                                  nullptr);
     if (GSS_ERROR(major_status)) {
         LogGssError(major_status, minor_status, "gss_unwrap() failed");
         Reset();
         gss_release_buffer_ptr(&minor_status, &output_token);
         return NS_ERROR_FAILURE;
     }
 
     *outTokenLen = output_token.length;
 
     if (output_token.length)
         *outToken = nsMemory::Clone(output_token.value, output_token.length);
     else
-        *outToken = NULL;
+        *outToken = nullptr;
 
     gss_release_buffer_ptr(&minor_status, &output_token);
 
     return NS_OK;
 }
  
 NS_IMETHODIMP
 nsAuthGSSAPI::Wrap(const void *inToken,
@@ -543,17 +543,17 @@ nsAuthGSSAPI::Wrap(const void *inToken,
     input_token.value = (void *) inToken;
     input_token.length = inTokenLen;
 
     major_status = gss_wrap_ptr(&minor_status,
                                 mCtx,
                                 confidential,
                                 GSS_C_QOP_DEFAULT,
                                 &input_token,
-                                NULL,
+                                nullptr,
                                 &output_token);
     
     if (GSS_ERROR(major_status)) {
         LogGssError(major_status, minor_status, "gss_wrap() failed");
         Reset();
         gss_release_buffer_ptr(&minor_status, &output_token);
         return NS_ERROR_FAILURE;
     }
--- a/extensions/auth/nsAuthSASL.cpp
+++ b/extensions/auth/nsAuthSASL.cpp
@@ -77,17 +77,17 @@ nsAuthSASL::GetNextToken(const void *inT
     if (!mInnerModule) 
         return NS_ERROR_NOT_INITIALIZED;
 
     if (mSASLReady) {
         // If the server COMPLETEs with an empty token, Cyrus sends us that token.
         // I don't think this is correct, but we need to handle that behaviour.
         // Cyrus ignores the contents of our reply token.
         if (inTokenLen == 0) {
-            *outToken = NULL;
+            *outToken = nullptr;
             *outTokenLen = 0;
             return NS_OK;
         }
         // We've completed the GSSAPI portion of the handshake, and are
         // now ready to do the SASL security layer and authzid negotiation
 
         // Input packet from the server needs to be unwrapped.
         rv = mInnerModule->Unwrap(inToken, inTokenLen, &unwrappedToken, 
@@ -109,17 +109,17 @@ nsAuthSASL::GetNextToken(const void *inT
           Reset();
           return NS_ERROR_OUT_OF_MEMORY;
         }
         message[0] = 0x01; // No security layer
         message[1] = 0x00;
         message[2] = 0x00;
         message[3] = 0x00; // Maxbuf must be zero if we've got no sec layer
         strcpy(message+4, userbuf.get());
-        // Userbuf should not be NULL terminated, so trim the trailing NULL
+        // Userbuf should not be nullptr terminated, so trim the trailing nullptr
         // when wrapping the message
         rv = mInnerModule->Wrap((void *) message, messageLen-1, false, 
                                 outToken, outTokenLen);
         nsMemory::Free(message);
         Reset(); // All done
         return NS_SUCCEEDED(rv) ? NS_SUCCESS_AUTH_FINISHED : rv;
     }
     rv = mInnerModule->GetNextToken(inToken, inTokenLen, outToken, 
--- a/extensions/auth/nsAuthSSPI.cpp
+++ b/extensions/auth/nsAuthSSPI.cpp
@@ -257,23 +257,23 @@ nsAuthSSPI::Init(const char *serviceName
         ai.User = reinterpret_cast<unsigned short*>(mUsername.BeginWriting());
         ai.UserLength = mUsername.Length();
         ai.Password = reinterpret_cast<unsigned short*>(mPassword.BeginWriting());
         ai.PasswordLength = mPassword.Length();
         ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
         pai = &ai;
     }
 
-    rc = (sspi->AcquireCredentialsHandleW)(NULL,
+    rc = (sspi->AcquireCredentialsHandleW)(nullptr,
                                            package,
                                            SECPKG_CRED_OUTBOUND,
-                                           NULL,
+                                           nullptr,
                                            pai,
-                                           NULL,
-                                           NULL,
+                                           nullptr,
+                                           nullptr,
                                            &mCred,
                                            &useBefore);
     if (rc != SEC_E_OK)
         return NS_ERROR_UNEXPECTED;
     LOG(("AcquireCredentialsHandle() succeeded.\n"));
     return NS_OK;
 }
 
@@ -427,17 +427,17 @@ nsAuthSSPI::GetNextToken(const void *inT
         // We are starting a new authentication sequence.  If we have already 
         // initialized our security context, then we're in trouble because it 
         // means that the first sequence failed.  We need to bail or else we 
         // might end up in an infinite loop.
         if (mCtxt.dwLower || mCtxt.dwUpper || mCertDERData || mCertDERLength) {
             LOG(("Cannot restart authentication sequence!"));
             return NS_ERROR_UNEXPECTED;
         }
-        ctxIn = NULL;
+        ctxIn = nullptr;
         mIsFirst = false;
     }
 
     obd.ulVersion = SECBUFFER_VERSION;
     obd.cBuffers = 1;
     obd.pBuffers = &ob;
     ob.BufferType = SECBUFFER_TOKEN;
     ob.cbBuffer = mMaxTokenLen;
@@ -453,17 +453,17 @@ nsAuthSSPI::GetNextToken(const void *inT
     SEC_WCHAR *sn = (SEC_WCHAR *) wSN.get();
 
     rc = (sspi->InitializeSecurityContextW)(&mCred,
                                             ctxIn,
                                             sn,
                                             ctxReq,
                                             0,
                                             SECURITY_NATIVE_DREP,
-                                            inToken ? &ibd : NULL,
+                                            inToken ? &ibd : nullptr,
                                             0,
                                             &mCtxt,
                                             &obd,
                                             &ctxAttr,
                                             &ignored);
     if (rc == SEC_I_CONTINUE_NEEDED || rc == SEC_E_OK) {
 
 #ifdef PR_LOGGING
@@ -472,17 +472,17 @@ nsAuthSSPI::GetNextToken(const void *inT
         else
             LOG(("InitializeSecurityContext: continue.\n"));
 #endif
         if (sspi_cbt)
             nsMemory::Free(sspi_cbt);
             
         if (!ob.cbBuffer) {
             nsMemory::Free(ob.pvBuffer);
-            ob.pvBuffer = NULL;
+            ob.pvBuffer = nullptr;
         }
         *outToken = ob.pvBuffer;
         *outTokenLen = ob.cbBuffer;
 
         if (rc == SEC_E_OK)
             return NS_SUCCESS_AUTH_FINISHED;
 
         return NS_OK;
@@ -515,23 +515,23 @@ nsAuthSSPI::Unwrap(const void *inToken,
     if (!ib[0].pvBuffer)
         return NS_ERROR_OUT_OF_MEMORY;
     
     memcpy(ib[0].pvBuffer, inToken, inTokenLen);
 
     // app data
     ib[1].BufferType = SECBUFFER_DATA;
     ib[1].cbBuffer = 0;
-    ib[1].pvBuffer = NULL;
+    ib[1].pvBuffer = nullptr;
 
     rc = (sspi->DecryptMessage)(
                                 &mCtxt,
                                 &ibd,
                                 0, // no sequence numbers
-                                NULL
+                                nullptr
                                 );
 
     if (SEC_SUCCESS(rc)) {
         // check if ib[1].pvBuffer is really just ib[0].pvBuffer, in which
         // case we can let the caller free it. Otherwise, we need to
         // clone it, and free the original
         if (ib[0].pvBuffer == ib[1].pvBuffer) {
             *outToken = ib[1].pvBuffer;
--- a/extensions/auth/nsHttpNegotiateAuth.cpp
+++ b/extensions/auth/nsHttpNegotiateAuth.cpp
@@ -232,17 +232,17 @@ nsHttpNegotiateAuth::GenerateCredentials
         inTokenLen = (len * 3)/4;
         inToken = malloc(inTokenLen);
         if (!inToken)
             return (NS_ERROR_OUT_OF_MEMORY);
 
         //
         // Decode the response that followed the "Negotiate" token
         //
-        if (PL_Base64Decode(challenge, len, (char *) inToken) == NULL) {
+        if (PL_Base64Decode(challenge, len, (char *) inToken) == nullptr) {
             free(inToken);
             return(NS_ERROR_UNEXPECTED);
         }
     }
     else {
         //
         // Initializing, don't use an input token.
         //
--- a/extensions/cookie/nsCookieModule.cpp
+++ b/extensions/cookie/nsCookieModule.cpp
@@ -22,29 +22,29 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsCookieP
 
 NS_DEFINE_NAMED_CID(NS_PERMISSIONMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_POPUPWINDOWMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_COOKIEPROMPTSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_COOKIEPERMISSION_CID);
 
 
 static const mozilla::Module::CIDEntry kCookieCIDs[] = {
-    { &kNS_PERMISSIONMANAGER_CID, false, NULL, nsIPermissionManagerConstructor },
-    { &kNS_POPUPWINDOWMANAGER_CID, false, NULL, nsPopupWindowManagerConstructor },
-    { &kNS_COOKIEPROMPTSERVICE_CID, false, NULL, nsCookiePromptServiceConstructor },
-    { &kNS_COOKIEPERMISSION_CID, false, NULL, nsCookiePermissionConstructor },
-    { NULL }
+    { &kNS_PERMISSIONMANAGER_CID, false, nullptr, nsIPermissionManagerConstructor },
+    { &kNS_POPUPWINDOWMANAGER_CID, false, nullptr, nsPopupWindowManagerConstructor },
+    { &kNS_COOKIEPROMPTSERVICE_CID, false, nullptr, nsCookiePromptServiceConstructor },
+    { &kNS_COOKIEPERMISSION_CID, false, nullptr, nsCookiePermissionConstructor },
+    { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kCookieContracts[] = {
     { NS_PERMISSIONMANAGER_CONTRACTID, &kNS_PERMISSIONMANAGER_CID },
     { NS_POPUPWINDOWMANAGER_CONTRACTID, &kNS_POPUPWINDOWMANAGER_CID },
     { NS_COOKIEPROMPTSERVICE_CONTRACTID, &kNS_COOKIEPROMPTSERVICE_CID },
     { NS_COOKIEPERMISSION_CONTRACTID, &kNS_COOKIEPERMISSION_CID },
-    { NULL }
+    { nullptr }
 };
 
 static const mozilla::Module kCookieModule = {
     mozilla::Module::kVersion,
     kCookieCIDs,
     kCookieContracts
 };
 
--- a/extensions/cookie/nsCookiePermission.h
+++ b/extensions/cookie/nsCookiePermission.h
@@ -28,17 +28,17 @@ public:
     , mCookiesAlwaysAcceptSession(false)
     {}
   virtual ~nsCookiePermission() {}
 
   bool Init();
   void PrefChanged(nsIPrefBranch *, const char *);
 
 private:
-   bool EnsureInitialized() { return (mPermMgr != NULL && mThirdPartyUtil != NULL) || Init(); };
+   bool EnsureInitialized() { return (mPermMgr != nullptr && mThirdPartyUtil != nullptr) || Init(); };
 
   nsCOMPtr<nsIPermissionManager> mPermMgr;
   nsCOMPtr<mozIThirdPartyUtil> mThirdPartyUtil;
 
   int64_t      mCookiesLifetimeSec;            // lifetime limit specified in seconds
   uint8_t      mCookiesLifetimePolicy;         // pref for how long cookies are stored
   bool mCookiesAlwaysAcceptSession;    // don't prompt for session cookies
 };
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -48,17 +48,17 @@ IsChildProcess()
  *          process, nullptr.
  */
 static ContentChild*
 ChildProcess()
 {
   if (IsChildProcess()) {
     ContentChild* cpc = ContentChild::GetSingleton();
     if (!cpc)
-      NS_RUNTIMEABORT("Content Process is NULL!");
+      NS_RUNTIMEABORT("Content Process is nullptr!");
     return cpc;
   }
 
   return nullptr;
 }
 
 
 #define ENSURE_NOT_CHILD_PROCESS_(onError) \
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -222,17 +222,17 @@ nsGIOInputStream::MountVolume() {
                     G_CALLBACK (mount_operation_ask_password), mChannel);
   mMountRes = MOUNT_OPERATION_IN_PROGRESS;
   /* g_file_mount_enclosing_volume uses a dbus request to mount the volume.
      Callback mount_enclosing_volume_finished is called in main thread 
      (not this thread on which this method is called). */
   g_file_mount_enclosing_volume(mHandle,
                                 G_MOUNT_MOUNT_NONE,
                                 mount_op,
-                                NULL,
+                                nullptr,
                                 mount_enclosing_volume_finished,
                                 this);
   mozilla::MonitorAutoLock mon(mMonitorMountInProgress);
   /* Waiting for finish of mount operation thread */  
   while (mMountRes == MOUNT_OPERATION_IN_PROGRESS)
     mon.Wait();
   
   g_object_unref(mount_op);
@@ -247,34 +247,34 @@ nsGIOInputStream::MountVolume() {
 /**
  * Create list of infos about objects in opened directory
  * Return: NS_OK when list obtained, otherwise error code according
  * to failed operation.
  */
 nsresult
 nsGIOInputStream::DoOpenDirectory()
 {
-  GError *error = NULL;
+  GError *error = nullptr;
 
   GFileEnumerator *f_enum = g_file_enumerate_children(mHandle,
                                                       "standard::*,time::*",
                                                       G_FILE_QUERY_INFO_NONE,
-                                                      NULL,
+                                                      nullptr,
                                                       &error);
   if (!f_enum) {
     nsresult rv = MapGIOResult(error);
     g_warning("Cannot read from directory: %s", error->message);
     g_error_free(error);
     return rv;
   }
   // fill list of file infos
-  GFileInfo *info = g_file_enumerator_next_file(f_enum, NULL, &error);
+  GFileInfo *info = g_file_enumerator_next_file(f_enum, nullptr, &error);
   while (info) {
     mDirList = g_list_append(mDirList, info);
-    info = g_file_enumerator_next_file(f_enum, NULL, &error);
+    info = g_file_enumerator_next_file(f_enum, nullptr, &error);
   }
   g_object_unref(f_enum);
   if (error) {
     g_warning("Error reading directory content: %s", error->message);
     nsresult rv = MapGIOResult(error);
     g_error_free(error);
     return rv;
   }
@@ -304,19 +304,19 @@ nsGIOInputStream::DoOpenDirectory()
 /**
  * Create file stream and set mime type for channel
  * @param info file info used to determine mime type
  * @return NS_OK when file stream created successfuly, error code otherwise
  */
 nsresult
 nsGIOInputStream::DoOpenFile(GFileInfo *info)
 {
-  GError *error = NULL;
+  GError *error = nullptr;
 
-  mStream = g_file_read(mHandle, NULL, &error);
+  mStream = g_file_read(mHandle, nullptr, &error);
   if (!mStream) {
     nsresult rv = MapGIOResult(error);
     g_warning("Cannot read from file: %s", error->message);
     g_error_free(error);
     return rv;
   }
 
   const char * content_type = g_file_info_get_content_type(info);
@@ -344,44 +344,44 @@ nsGIOInputStream::DoOpenFile(GFileInfo *
  * Start file open operation, mount volume when needed and according to file type
  * create file output stream or read directory content.
  * @return NS_OK when file or directory opened successfully, error code otherwise
  */
 nsresult
 nsGIOInputStream::DoOpen()
 {
   nsresult rv;
-  GError *error = NULL;
+  GError *error = nullptr;
 
   NS_ASSERTION(mHandle == nullptr, "already open");
 
   mHandle = g_file_new_for_uri( mSpec.get() );
 
   GFileInfo *info = g_file_query_info(mHandle,
                                       "standard::*",
                                       G_FILE_QUERY_INFO_NONE,
-                                      NULL,
+                                      nullptr,
                                       &error);
 
   if (error) {
     if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_MOUNTED) {
       // location is not yet mounted, try to mount
       g_error_free(error);
       if (NS_IsMainThread()) 
         return NS_ERROR_NOT_CONNECTED;
-      error = NULL;
+      error = nullptr;
       rv = MountVolume();
       if (rv != NS_OK) {
         return rv;
       }
       // get info again
       info = g_file_query_info(mHandle,
                                "standard::*",
                                G_FILE_QUERY_INFO_NONE,
-                               NULL,
+                               nullptr,
                                &error);
       // second try to get file info from remote files after media mount
       if (!info) {
         g_warning("Unable to get file info: %s", error->message);
         rv = MapGIOResult(error);
         g_error_free(error);
         return rv;
       }
@@ -418,21 +418,21 @@ nsGIOInputStream::DoOpen()
  *         error code otherwise
  */
 nsresult
 nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead)
 {
   nsresult rv = NS_ERROR_NOT_AVAILABLE;
   if (mStream) {
     // file read
-    GError *error = NULL;    
+    GError *error = nullptr;    
     uint32_t bytes_read = g_input_stream_read(G_INPUT_STREAM(mStream),
                                               aBuf,
                                               aCount,
-                                              NULL,
+                                              nullptr,
                                               &error);
     if (error) {
       rv = MapGIOResult(error);
       *aCountRead = 0;
       g_warning("Cannot read from file: %s", error->message);
       g_error_free(error);
       return rv;
     }
@@ -705,17 +705,17 @@ nsGIOInputStream::IsNonBlocking(bool *aR
  * @param res result object
  * @param user_data pointer to nsGIOInputStream
  */
 static void
 mount_enclosing_volume_finished (GObject *source_object,
                                  GAsyncResult *res,
                                  gpointer user_data)
 {
-  GError *error = NULL;
+  GError *error = nullptr;
 
   nsGIOInputStream* istream = static_cast<nsGIOInputStream*>(user_data);
   
   g_file_mount_enclosing_volume_finish(G_FILE (source_object), res, &error);
   
   if (error) {
     g_warning("Mount failed: %s %d", error->message, error->code);
     istream->SetMountResult(MOUNT_OPERATION_FAILED, error->code);
@@ -1008,17 +1008,17 @@ nsGIOProtocolHandler::NewURI(const nsACS
 
     if (!gvfs) {
       g_warning("Cannot get GVfs object.");
       return NS_ERROR_UNKNOWN_PROTOCOL;
     }
 
     const gchar* const * uri_schemes = g_vfs_get_supported_uri_schemes(gvfs);
 
-    while (*uri_schemes != NULL) {
+    while (*uri_schemes != nullptr) {
       // While flatSpec ends with ':' the uri_scheme does not. Therefore do not
       // compare last character.
       if (StringHead(flatSpec, colon_location).Equals(*uri_schemes)) {
         uri_scheme_supported = true;
         break;
       }
       uri_schemes++;
     }
@@ -1103,23 +1103,23 @@ nsGIOProtocolHandler::Observe(nsISupport
     0x4d19,                                          \
     {0x9e, 0x84, 0xe2, 0xeb, 0xfe, 0x21, 0x34, 0x80} \
 }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGIOProtocolHandler, Init)
 NS_DEFINE_NAMED_CID(NS_GIOPROTOCOLHANDLER_CID);
 
 static const mozilla::Module::CIDEntry kVFSCIDs[] = {
-  { &kNS_GIOPROTOCOLHANDLER_CID, false, NULL, nsGIOProtocolHandlerConstructor },
-  { NULL }
+  { &kNS_GIOPROTOCOLHANDLER_CID, false, nullptr, nsGIOProtocolHandlerConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kVFSContracts[] = {
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GIO_SCHEME, &kNS_GIOPROTOCOLHANDLER_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kVFSModule = {
   mozilla::Module::kVersion,
   kVFSCIDs,
   kVFSContracts
 };
 
--- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
@@ -373,19 +373,19 @@ nsGnomeVFSInputStream::DoOpen()
 
   NS_ASSERTION(mHandle == nullptr, "already open");
 
   // Push a callback handler on the stack for this thread, so we can intercept
   // authentication requests from GnomeVFS.  We'll use the channel to get a
   // nsIAuthPrompt instance.
 
   gnome_vfs_module_callback_push(GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION,
-                                 AuthCallback, mChannel, NULL);
+                                 AuthCallback, mChannel, nullptr);
 
-  // Query the mime type first (this could return NULL). 
+  // Query the mime type first (this could return nullptr). 
   //
   // XXX We need to do this up-front in order to determine how to open the URI.
   //     Unfortunately, the error code GNOME_VFS_ERROR_IS_DIRECTORY is not
   //     always returned by gnome_vfs_open when we pass it a URI to a directory!
   //     Otherwise, we could have used that as a way to failover to opening the
   //     URI as a directory.  Also, it would have been ideal if
   //     gnome_vfs_get_file_info_from_handle were actually implemented by the
   //     smb:// module, since that would have allowed us to potentially save a
@@ -957,23 +957,23 @@ nsGnomeVFSProtocolHandler::Observe(nsISu
     0x49e1,                                          \
     {0x9c, 0x98, 0x0a, 0x83, 0x84, 0xde, 0x7f, 0x6c} \
 }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSProtocolHandler, Init)
 NS_DEFINE_NAMED_CID(NS_GNOMEVFSPROTOCOLHANDLER_CID);
 
 static const mozilla::Module::CIDEntry kVFSCIDs[] = {
-  { &kNS_GNOMEVFSPROTOCOLHANDLER_CID, false, NULL, nsGnomeVFSProtocolHandlerConstructor },
-  { NULL }
+  { &kNS_GNOMEVFSPROTOCOLHANDLER_CID, false, nullptr, nsGnomeVFSProtocolHandlerConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kVFSContracts[] = {
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GNOMEVFS_SCHEME, &kNS_GNOMEVFSPROTOCOLHANDLER_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kVFSModule = {
   mozilla::Module::kVersion,
   kVFSCIDs,
   kVFSContracts
 };
 
--- a/extensions/permissions/nsModuleFactory.cpp
+++ b/extensions/permissions/nsModuleFactory.cpp
@@ -8,28 +8,28 @@
 #include "nsXPIDLString.h"
 
 // Define the constructor function for the objects
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsContentBlocker, Init)
 
 NS_DEFINE_NAMED_CID(NS_CONTENTBLOCKER_CID);
 
 static const mozilla::Module::CIDEntry kPermissionsCIDs[] = {
-  { &kNS_CONTENTBLOCKER_CID, false, NULL, nsContentBlockerConstructor },
-  { NULL }
+  { &kNS_CONTENTBLOCKER_CID, false, nullptr, nsContentBlockerConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kPermissionsContracts[] = {
   { NS_CONTENTBLOCKER_CONTRACTID, &kNS_CONTENTBLOCKER_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kPermissionsCategories[] = {
   { "content-policy", NS_CONTENTBLOCKER_CONTRACTID, NS_CONTENTBLOCKER_CONTRACTID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kPermissionsModule = {
   mozilla::Module::kVersion,
   kPermissionsCIDs,
   kPermissionsContracts,
   kPermissionsCategories
 };
--- a/extensions/pref/autoconfig/src/nsConfigFactory.cpp
+++ b/extensions/pref/autoconfig/src/nsConfigFactory.cpp
@@ -10,30 +10,30 @@
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAutoConfig, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsReadConfig, Init)
 
 NS_DEFINE_NAMED_CID(NS_AUTOCONFIG_CID);
 NS_DEFINE_NAMED_CID(NS_READCONFIG_CID);
 
 static const mozilla::Module::CIDEntry kAutoConfigCIDs[] = {
-  { &kNS_AUTOCONFIG_CID, false, NULL, nsAutoConfigConstructor },
-  { &kNS_READCONFIG_CID, false, NULL, nsReadConfigConstructor },
-  { NULL }
+  { &kNS_AUTOCONFIG_CID, false, nullptr, nsAutoConfigConstructor },
+  { &kNS_READCONFIG_CID, false, nullptr, nsReadConfigConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kAutoConfigContracts[] = {
   { NS_AUTOCONFIG_CONTRACTID, &kNS_AUTOCONFIG_CID },
   { NS_READCONFIG_CONTRACTID, &kNS_READCONFIG_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kAutoConfigCategories[] = {
   { "pref-config-startup", "ReadConfig Module", NS_READCONFIG_CONTRACTID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kAutoConfigModule = {
   mozilla::Module::kVersion,
   kAutoConfigCIDs,
   kAutoConfigContracts,
   kAutoConfigCategories
 };
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -163,17 +163,17 @@ nsresult nsReadConfig::readConfigFile()
 
         // Evaluate platform specific directives
         rv = openAndEvaluateJSFile("platform.js", 0, false, false);
         if (NS_FAILED(rv)) 
             return rv;
 
         mRead = true;
     }
-    // If the lockFileName is NULL return ok, because no lockFile will be used
+    // If the lockFileName is nullptr return ok, because no lockFile will be used
   
   
     // Once the config file is read, we should check that the vendor name 
     // is consistent By checking for the vendor name after reading the config 
     // file we allow for the preference to be set (and locked) by the creator 
     // of the cfg file meaning the file can not be renamed (successfully).
 
     nsCOMPtr<nsIPrefBranch> prefBranch;
@@ -195,17 +195,17 @@ nsresult nsReadConfig::readConfigFile()
     if (NS_FAILED(rv))
         // There is NO REASON we should ever get here. This is POST reading 
         // of the config file.
         return NS_ERROR_FAILURE;
 
   
     rv = prefBranch->GetCharPref("general.config.vendor", 
                                   getter_Copies(lockVendor));
-    // If vendor is not NULL, do this check
+    // If vendor is not nullptr, do this check
     if (NS_SUCCEEDED(rv)) {
 
         fileNameLen = PL_strlen(lockFileName);
     
         // lockVendor and lockFileName should be the same with the addtion of 
         // .cfg to the filename by checking this post reading of the cfg file 
         // this value can be set within the cfg file adding a level of security.
     
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -94,17 +94,17 @@ mozInlineSpellStatus::mozInlineSpellStat
 {
 }
 
 // mozInlineSpellStatus::InitForEditorChange
 //
 //    This is the most complicated case. For changes, we need to compute the
 //    range of stuff that changed based on the old and new caret positions,
 //    as well as use a range possibly provided by the editor (start and end,
-//    which are usually NULL) to get a range with the union of these.
+//    which are usually nullptr) to get a range with the union of these.
 
 nsresult
 mozInlineSpellStatus::InitForEditorChange(
     EditAction aAction,
     nsIDOMNode* aAnchorNode, int32_t aAnchorOffset,
     nsIDOMNode* aPreviousNode, int32_t aPreviousOffset,
     nsIDOMNode* aStartNode, int32_t aStartOffset,
     nsIDOMNode* aEndNode, int32_t aEndOffset)
@@ -150,17 +150,17 @@ mozInlineSpellStatus::InitForEditorChang
     // previous anchor node is after (or the same as) the current anchor
     rv = mRange->SetStart(aAnchorNode, aAnchorOffset);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = mRange->SetEnd(aPreviousNode, aPreviousOffset);
   }
   NS_ENSURE_SUCCESS(rv, rv);
 
   // On insert save this range: DoSpellCheck optimizes things in this range.
-  // Otherwise, just leave this NULL.
+  // Otherwise, just leave this nullptr.
   if (aAction == EditAction::insertText)
     mCreatedRange = mRange;
 
   // if we were given a range, we need to expand our range to encompass it
   if (aStartNode && aEndNode) {
     rv = mRange->ComparePoint(aStartNode, aStartOffset, &cmpResult);
     NS_ENSURE_SUCCESS(rv, rv);
     if (cmpResult < 0) { // given range starts before
@@ -256,19 +256,19 @@ mozInlineSpellStatus::InitForRange(nsRan
   return NS_OK;
 }
 
 // mozInlineSpellStatus::FinishInitOnEvent
 //
 //    Called when the event is triggered to complete initialization that
 //    might require the WordUtil. This calls to the operation-specific
 //    initializer, and also sets the range to be the entire element if it
-//    is NULL.
+//    is nullptr.
 //
-//    Watch out: the range might still be NULL if there is nothing to do,
+//    Watch out: the range might still be nullptr if there is nothing to do,
 //    the caller will have to check for this.
 
 nsresult
 mozInlineSpellStatus::FinishInitOnEvent(mozInlineSpellWordUtil& aWordUtil)
 {
   nsresult rv;
   if (! mRange) {
     rv = mSpellChecker->MakeSpellCheckRange(nullptr, 0, nullptr, 0,
@@ -282,17 +282,17 @@ mozInlineSpellStatus::FinishInitOnEvent(
         return FillNoCheckRangeFromAnchor(aWordUtil);
       break;
     case eOpChangeDelete:
       if (mAnchorRange) {
         rv = FillNoCheckRangeFromAnchor(aWordUtil);
         NS_ENSURE_SUCCESS(rv, rv);
       }
       // Delete events will have no range for the changed text (because it was
-      // deleted), and InitForEditorChange will set it to NULL. Here, we select
+      // deleted), and InitForEditorChange will set it to nullptr. Here, we select
       // the entire word to cause any underlining to be removed.
       mRange = mNoCheckRange;
       break;
     case eOpNavigation:
       return FinishNavigationEvent(aWordUtil);
     case eOpSelection:
       // this gets special handling in ResumeCheck
       break;
@@ -306,17 +306,17 @@ mozInlineSpellStatus::FinishInitOnEvent(
   return NS_OK;
 }
 
 // mozInlineSpellStatus::FinishNavigationEvent
 //
 //    This verifies that we need to check the word at the previous caret
 //    position. Now that we have the word util, we can find the word belonging
 //    to the previous caret position. If the new position is inside that word,
-//    we don't want to do anything. In this case, we'll NULL out mRange so
+//    we don't want to do anything. In this case, we'll nullptr out mRange so
 //    that the caller will know not to continue.
 //
 //    Notice that we don't set mNoCheckRange. We check here whether the cursor
 //    is in the word that needs checking, so it isn't necessary. Plus, the
 //    spellchecker isn't guaranteed to only check the given word, and it could
 //    remove the underline from the new word under the cursor.
 
 nsresult
@@ -699,17 +699,17 @@ mozInlineSpellChecker::SetEnableRealTime
   return SpellCheckRange(nullptr);
 }
 
 // mozInlineSpellChecker::SpellCheckAfterEditorChange
 //
 //    Called by the editor when nearly anything happens to change the content.
 //
 //    The start and end positions specify a range for the thing that happened,
-//    but these are usually NULL, even when you'd think they would be useful
+//    but these are usually nullptr, even when you'd think they would be useful
 //    because you want the range (for example, pasting). We ignore them in
 //    this case.
 
 NS_IMETHODIMP
 mozInlineSpellChecker::SpellCheckAfterEditorChange(
     int32_t aAction, nsISelection *aSelection,
     nsIDOMNode *aPreviousSelectedNode, int32_t aPreviousSelectedOffset,
     nsIDOMNode *aStartNode, int32_t aStartOffset,
@@ -745,17 +745,17 @@ mozInlineSpellChecker::SpellCheckAfterEd
   // remember the current caret position after every change
   SaveCurrentSelectionPosition();
   return NS_OK;
 }
 
 // mozInlineSpellChecker::SpellCheckRange
 //
 //    Spellchecks all the words in the given range.
-//    Supply a NULL range and this will check the entire editor.
+//    Supply a nullptr range and this will check the entire editor.
 
 nsresult
 mozInlineSpellChecker::SpellCheckRange(nsIDOMRange* aRange)
 {
   NS_ENSURE_TRUE(mSpellCheck, NS_ERROR_NOT_INITIALIZED);
 
   mozInlineSpellStatus status(this);
   nsRange* range = static_cast<nsRange*>(aRange);
@@ -966,21 +966,21 @@ NS_IMETHODIMP mozInlineSpellChecker::Wil
 NS_IMETHODIMP mozInlineSpellChecker::DidDeleteSelection(nsISelection *aSelection)
 {
   return NS_OK;
 }
 
 // mozInlineSpellChecker::MakeSpellCheckRange
 //
 //    Given begin and end positions, this function constructs a range as
-//    required for ScheduleSpellCheck. If the start and end nodes are NULL,
+//    required for ScheduleSpellCheck. If the start and end nodes are nullptr,
 //    then the entire range will be selected, and you can supply -1 as the
 //    offset to the end range to select all of that node.
 //
-//    If the resulting range would be empty, NULL is put into *aRange and the
+//    If the resulting range would be empty, nullptr is put into *aRange and the
 //    function succeeds.
 
 nsresult
 mozInlineSpellChecker::MakeSpellCheckRange(
     nsIDOMNode* aStartNode, int32_t aStartOffset,
     nsIDOMNode* aEndNode, int32_t aEndOffset,
     nsRange** aRange)
 {
@@ -1223,22 +1223,22 @@ mozInlineSpellChecker::DoSpellCheckSelec
   }
 
   return NS_OK;
 }
 
 // mozInlineSpellChecker::DoSpellCheck
 //
 //    This function checks words intersecting the given range, excluding those
-//    inside mStatus->mNoCheckRange (can be NULL). Words inside aNoCheckRange
+//    inside mStatus->mNoCheckRange (can be nullptr). Words inside aNoCheckRange
 //    will have any spell selection removed (this is used to hide the
 //    underlining for the word that the caret is in). aNoCheckRange should be
 //    on word boundaries.
 //
-//    mResume->mCreatedRange is a possibly NULL range of new text that was
+//    mResume->mCreatedRange is a possibly nullptr range of new text that was
 //    inserted.  Inside this range, we don't bother to check whether things are
 //    inside the spellcheck selection, which speeds up large paste operations
 //    considerably.
 //
 //    Normal case when editing text by typing
 //       h e l l o   w o r k d   h o w   a r e   y o u
 //                            ^ caret
 //                   [-------] mRange
@@ -1498,17 +1498,17 @@ mozInlineSpellChecker::ResumeCheck(mozIn
 
 // mozInlineSpellChecker::IsPointInSelection
 //
 //    Determines if a given (node,offset) point is inside the given
 //    selection. If so, the specific range of the selection that
 //    intersects is places in *aRange. (There may be multiple disjoint
 //    ranges in a selection.)
 //
-//    If there is no intersection, *aRange will be NULL.
+//    If there is no intersection, *aRange will be nullptr.
 
 nsresult
 mozInlineSpellChecker::IsPointInSelection(nsISelection *aSelection,
                                           nsIDOMNode *aNode,
                                           int32_t aOffset,
                                           nsIDOMRange **aRange)
 {
   *aRange = nullptr;
--- a/extensions/spellcheck/src/mozInlineSpellChecker.h
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.h
@@ -65,28 +65,28 @@ public:
   enum Operation { eOpChange,       // for SpellCheckAfterChange except deleteSelection
                    eOpChangeDelete, // for SpellCheckAfterChange deleteSelection
                    eOpNavigation,   // for HandleNavigationEvent
                    eOpSelection,    // re-check all misspelled words
                    eOpResume };     // for resuming a previously started check
   Operation mOp;
 
   // Used for events where we have already computed the range to use. It can
-  // also be NULL in these cases where we need to check the entire range.
+  // also be nullptr in these cases where we need to check the entire range.
   nsRefPtr<nsRange> mRange;
 
   // If we happen to know something was inserted, this is that range.
-  // Can be NULL (this only allows an optimization, so not setting doesn't hurt)
+  // Can be nullptr (this only allows an optimization, so not setting doesn't hurt)
   nsCOMPtr<nsIDOMRange> mCreatedRange;
 
-  // Contains the range computed for the current word. Can be NULL.
+  // Contains the range computed for the current word. Can be nullptr.
   nsRefPtr<nsRange> mNoCheckRange;
 
   // Indicates the position of the cursor for the event (so we can compute
-  // mNoCheckRange). It can be NULL if we don't care about the cursor position
+  // mNoCheckRange). It can be nullptr if we don't care about the cursor position
   // (such as for the intial check of everything).
   //
   // For mOp == eOpNavigation, this is the NEW position of the cursor
   nsCOMPtr<nsIDOMRange> mAnchorRange;
 
   // -----
   // The following members are only for navigation events and are only
   // stored for FinishNavigationEvent to initialize the other members.
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.h
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.h
@@ -66,17 +66,17 @@ public:
   //
   // THIS CHANGES THE CURRENT POSITION AND RANGE. It is designed to be called
   // before you actually generate the range you are interested in and iterate
   // the words in it.
   nsresult GetRangeForWord(nsIDOMNode* aWordNode, int32_t aWordOffset,
                            nsRange** aRange);
 
   // Moves to the the next word in the range, and retrieves it's text and range.
-  // An empty word and a NULL range are returned when we are done checking.
+  // An empty word and a nullptr range are returned when we are done checking.
   // aSkipChecking will be set if the word is "special" and shouldn't be
   // checked (e.g., an email address).
   nsresult GetNextWord(nsAString& aText, nsRange** aRange,
                        bool* aSkipChecking);
 
   // Call to normalize some punctuation. This function takes an autostring
   // so we can access characters directly.
   static void NormalizeWord(nsSubstring& aWord);
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -284,29 +284,29 @@ mozSpellChecker::GetDictionaryList(nsTAr
   nsCOMArray<mozISpellCheckingEngine> spellCheckingEngines;
   rv = GetEngineList(&spellCheckingEngines);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (int32_t i = 0; i < spellCheckingEngines.Count(); i++) {
     nsCOMPtr<mozISpellCheckingEngine> engine = spellCheckingEngines[i];
 
     uint32_t count = 0;
-    PRUnichar **words = NULL;
+    PRUnichar **words = nullptr;
     engine->GetDictionaryList(&words, &count);
     for (uint32_t k = 0; k < count; k++) {
       nsAutoString dictName;
 
       dictName.Assign(words[k]);
 
       // Skip duplicate dictionaries. Only take the first one
       // for each name.
-      if (dictionaries.Get(dictName, NULL))
+      if (dictionaries.Get(dictName, nullptr))
         continue;
 
-      dictionaries.Put(dictName, NULL);
+      dictionaries.Put(dictName, nullptr);
 
       if (!aDictionaryList->AppendElement(dictName)) {
         NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, words);
         return NS_ERROR_OUT_OF_MEMORY;
       }
     }
 
     NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, words);
@@ -360,17 +360,17 @@ mozSpellChecker::SetCurrentDictionary(co
 
       nsXPIDLString language;
       nsCOMPtr<mozISpellI18NManager> serv(do_GetService("@mozilla.org/spellchecker/i18nmanager;1", &rv));
       NS_ENSURE_SUCCESS(rv, rv);
       return serv->GetUtil(language.get(),getter_AddRefs(mConverter));
     }
   }
 
-  mSpellCheckingEngine = NULL;
+  mSpellCheckingEngine = nullptr;
   
   // We could not find any engine with the requested dictionary
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP 
 mozSpellChecker::CheckCurrentDictionary()
 {
--- a/extensions/spellcheck/src/mozSpellCheckerFactory.cpp
+++ b/extensions/spellcheck/src/mozSpellCheckerFactory.cpp
@@ -33,38 +33,38 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(mozInline
 NS_DEFINE_NAMED_CID(MOZ_HUNSPELL_CID);
 NS_DEFINE_NAMED_CID(HUNSPELLDIRPROVIDER_CID);
 NS_DEFINE_NAMED_CID(NS_SPELLCHECKER_CID);
 NS_DEFINE_NAMED_CID(MOZ_PERSONALDICTIONARY_CID);
 NS_DEFINE_NAMED_CID(MOZ_SPELLI18NMANAGER_CID);
 NS_DEFINE_NAMED_CID(MOZ_INLINESPELLCHECKER_CID);
 
 static const mozilla::Module::CIDEntry kSpellcheckCIDs[] = {
-    { &kMOZ_HUNSPELL_CID, false, NULL, mozHunspellConstructor },
-    { &kHUNSPELLDIRPROVIDER_CID, false, NULL, mozHunspellDirProviderConstructor },
-    { &kNS_SPELLCHECKER_CID, false, NULL, mozSpellCheckerConstructor },
-    { &kMOZ_PERSONALDICTIONARY_CID, false, NULL, mozPersonalDictionaryConstructor },
-    { &kMOZ_SPELLI18NMANAGER_CID, false, NULL, mozSpellI18NManagerConstructor },
-    { &kMOZ_INLINESPELLCHECKER_CID, false, NULL, mozInlineSpellCheckerConstructor },
-    { NULL }
+    { &kMOZ_HUNSPELL_CID, false, nullptr, mozHunspellConstructor },
+    { &kHUNSPELLDIRPROVIDER_CID, false, nullptr, mozHunspellDirProviderConstructor },
+    { &kNS_SPELLCHECKER_CID, false, nullptr, mozSpellCheckerConstructor },
+    { &kMOZ_PERSONALDICTIONARY_CID, false, nullptr, mozPersonalDictionaryConstructor },
+    { &kMOZ_SPELLI18NMANAGER_CID, false, nullptr, mozSpellI18NManagerConstructor },
+    { &kMOZ_INLINESPELLCHECKER_CID, false, nullptr, mozInlineSpellCheckerConstructor },
+    { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kSpellcheckContracts[] = {
     { MOZ_HUNSPELL_CONTRACTID, &kMOZ_HUNSPELL_CID },
     { mozHunspellDirProvider::kContractID, &kHUNSPELLDIRPROVIDER_CID },
     { NS_SPELLCHECKER_CONTRACTID, &kNS_SPELLCHECKER_CID },
     { MOZ_PERSONALDICTIONARY_CONTRACTID, &kMOZ_PERSONALDICTIONARY_CID },
     { MOZ_SPELLI18NMANAGER_CONTRACTID, &kMOZ_SPELLI18NMANAGER_CID },
     { MOZ_INLINESPELLCHECKER_CONTRACTID, &kMOZ_INLINESPELLCHECKER_CID },
-    { NULL }
+    { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kSpellcheckCategories[] = {
     { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "spellcheck-directory-provider", mozHunspellDirProvider::kContractID },
-    { NULL }
+    { nullptr }
 };
 
 const mozilla::Module kSpellcheckModule = {
     mozilla::Module::kVersion,
     kSpellcheckCIDs,
     kSpellcheckContracts,
     kSpellcheckCategories
 };
--- a/extensions/spellcheck/src/mozSpellI18NManager.cpp
+++ b/extensions/spellcheck/src/mozSpellI18NManager.cpp
@@ -18,20 +18,20 @@ mozSpellI18NManager::mozSpellI18NManager
 mozSpellI18NManager::~mozSpellI18NManager()
 {
   /* destructor code */
 }
 
 /* mozISpellI18NUtil GetUtil (in wstring language); */
 NS_IMETHODIMP mozSpellI18NManager::GetUtil(const PRUnichar *aLanguage, mozISpellI18NUtil **_retval)
 {
- if( NULL == _retval) {
+ if( nullptr == _retval) {
    return NS_ERROR_NULL_POINTER;
  }
- *_retval = NULL;
+ *_retval = nullptr;
  nsAutoString lang;
  lang.Assign(aLanguage);
  if(lang.EqualsLiteral("en")){
    *_retval = new mozEnglishWordUtils;
  }
  else{
    *_retval = new mozEnglishWordUtils;   
  }
--- a/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
+++ b/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
@@ -47,31 +47,31 @@ NS_DEFINE_NAMED_CID(NS_ZHTW_STRING_PSMDE
 NS_DEFINE_NAMED_CID(NS_ZHCN_PSMDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_ZHCN_STRING_PSMDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_ZH_PSMDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_ZH_STRING_PSMDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_CJK_PSMDETECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_CJK_STRING_PSMDETECTOR_CID);
 
 static const mozilla::Module::CIDEntry kChardetCIDs[] = {
-  { &kNS_UNIVERSAL_DETECTOR_CID, false, NULL, nsUniversalXPCOMDetectorConstructor },
-  { &kNS_UNIVERSAL_STRING_DETECTOR_CID, false, NULL, nsUniversalXPCOMStringDetectorConstructor },
-  { &kNS_JA_PSMDETECTOR_CID, false, NULL, nsJAPSMDetectorConstructor },
-  { &kNS_JA_STRING_PSMDETECTOR_CID, false, NULL, nsJAStringPSMDetectorConstructor },
-  { &kNS_KO_PSMDETECTOR_CID, false, NULL, nsKOPSMDetectorConstructor },
-  { &kNS_KO_STRING_PSMDETECTOR_CID, false, NULL, nsKOStringPSMDetectorConstructor },
-  { &kNS_ZHTW_PSMDETECTOR_CID, false, NULL, nsZHTWPSMDetectorConstructor },
-  { &kNS_ZHTW_STRING_PSMDETECTOR_CID, false, NULL, nsZHTWStringPSMDetectorConstructor },
-  { &kNS_ZHCN_PSMDETECTOR_CID, false, NULL, nsZHCNPSMDetectorConstructor },
-  { &kNS_ZHCN_STRING_PSMDETECTOR_CID, false, NULL, nsZHCNStringPSMDetectorConstructor },
-  { &kNS_ZH_PSMDETECTOR_CID, false, NULL, nsZHPSMDetectorConstructor },
-  { &kNS_ZH_STRING_PSMDETECTOR_CID, false, NULL, nsZHStringPSMDetectorConstructor },
-  { &kNS_CJK_PSMDETECTOR_CID, false, NULL, nsCJKPSMDetectorConstructor },
-  { &kNS_CJK_STRING_PSMDETECTOR_CID, false, NULL, nsCJKStringPSMDetectorConstructor },
-  { NULL }
+  { &kNS_UNIVERSAL_DETECTOR_CID, false, nullptr, nsUniversalXPCOMDetectorConstructor },
+  { &kNS_UNIVERSAL_STRING_DETECTOR_CID, false, nullptr, nsUniversalXPCOMStringDetectorConstructor },
+  { &kNS_JA_PSMDETECTOR_CID, false, nullptr, nsJAPSMDetectorConstructor },
+  { &kNS_JA_STRING_PSMDETECTOR_CID, false, nullptr, nsJAStringPSMDetectorConstructor },
+  { &kNS_KO_PSMDETECTOR_CID, false, nullptr, nsKOPSMDetectorConstructor },
+  { &kNS_KO_STRING_PSMDETECTOR_CID, false, nullptr, nsKOStringPSMDetectorConstructor },
+  { &kNS_ZHTW_PSMDETECTOR_CID, false, nullptr, nsZHTWPSMDetectorConstructor },
+  { &kNS_ZHTW_STRING_PSMDETECTOR_CID, false, nullptr, nsZHTWStringPSMDetectorConstructor },
+  { &kNS_ZHCN_PSMDETECTOR_CID, false, nullptr, nsZHCNPSMDetectorConstructor },
+  { &kNS_ZHCN_STRING_PSMDETECTOR_CID, false, nullptr, nsZHCNStringPSMDetectorConstructor },
+  { &kNS_ZH_PSMDETECTOR_CID, false, nullptr, nsZHPSMDetectorConstructor },
+  { &kNS_ZH_STRING_PSMDETECTOR_CID, false, nullptr, nsZHStringPSMDetectorConstructor },
+  { &kNS_CJK_PSMDETECTOR_CID, false, nullptr, nsCJKPSMDetectorConstructor },
+  { &kNS_CJK_STRING_PSMDETECTOR_CID, false, nullptr, nsCJKStringPSMDetectorConstructor },
+  { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kChardetContracts[] = {
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "universal_charset_detector", &kNS_UNIVERSAL_DETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "universal_charset_detector", &kNS_UNIVERSAL_STRING_DETECTOR_CID },
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_PSMDETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_STRING_PSMDETECTOR_CID },
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ko_parallel_state_machine", &kNS_KO_PSMDETECTOR_CID },
@@ -79,28 +79,28 @@ static const mozilla::Module::ContractID
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "zhtw_parallel_state_machine", &kNS_ZHTW_PSMDETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "zhtw_parallel_state_machine", &kNS_ZHTW_STRING_PSMDETECTOR_CID },
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "zhcn_parallel_state_machine", &kNS_ZHCN_PSMDETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "zhcn_parallel_state_machine", &kNS_ZHCN_STRING_PSMDETECTOR_CID },
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "zh_parallel_state_machine", &kNS_ZH_PSMDETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "zh_parallel_state_machine", &kNS_ZH_STRING_PSMDETECTOR_CID },
   { NS_CHARSET_DETECTOR_CONTRACTID_BASE "cjk_parallel_state_machine", &kNS_CJK_PSMDETECTOR_CID },
   { NS_STRCDETECTOR_CONTRACTID_BASE "cjk_parallel_state_machine", &kNS_CJK_STRING_PSMDETECTOR_CID },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kChardetCategories[] = {
   { NS_CHARSET_DETECTOR_CATEGORY, "universal_charset_detector", NS_CHARSET_DETECTOR_CONTRACTID_BASE "universal_charset_detector" },
   { NS_CHARSET_DETECTOR_CATEGORY, "ja_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine" },
   { NS_CHARSET_DETECTOR_CATEGORY, "ko_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ko_parallel_state_machine" },
   { NS_CHARSET_DETECTOR_CATEGORY, "zhtw_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "zhtw_parallel_state_machine" },
   { NS_CHARSET_DETECTOR_CATEGORY, "zhcn_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "zhcn_parallel_state_machine" },
   { NS_CHARSET_DETECTOR_CATEGORY, "zh_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "zh_parallel_state_machine" },
   { NS_CHARSET_DETECTOR_CATEGORY, "cjk_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "cjk_parallel_state_machine" },
-  { NULL }
+  { nullptr }
 };
 
 static const mozilla::Module kChardetModule = {
   mozilla::Module::kVersion,
   kChardetCIDs,
   kChardetContracts,
   kChardetCategories
 };