Bug 784739 - Switch from NULL to nullptr in dom/plugins/ipc/; r=ehsan
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Wed, 23 Oct 2013 16:34:46 -0400
changeset 165716 298d6746f0afbafa3d33b812d839199b85269979
parent 165715 3656e6195ed26ec8d0a4697ca2eb90254a3a1000
child 165717 d8b4feaa9add82a7e7c7dc690ff56f776d7dc894
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs784739
milestone27.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 dom/plugins/ipc/; r=ehsan
dom/plugins/ipc/BrowserStreamChild.cpp
dom/plugins/ipc/BrowserStreamParent.cpp
dom/plugins/ipc/ChildAsyncCall.cpp
dom/plugins/ipc/MiniShmParent.cpp
dom/plugins/ipc/NPEventOSX.h
dom/plugins/ipc/NestedLoopTimer.cpp
dom/plugins/ipc/PluginHangUIParent.cpp
dom/plugins/ipc/PluginIdentifierChild.cpp
dom/plugins/ipc/PluginIdentifierChild.h
dom/plugins/ipc/PluginIdentifierParent.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginMessageUtils.h
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleChild.h
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginProcessChild.cpp
dom/plugins/ipc/PluginScriptableObjectChild.cpp
dom/plugins/ipc/PluginScriptableObjectChild.h
dom/plugins/ipc/PluginScriptableObjectParent.h
dom/plugins/ipc/PluginStreamParent.cpp
dom/plugins/ipc/StreamNotifyChild.h
dom/plugins/ipc/StreamNotifyParent.h
dom/plugins/ipc/hangui/MiniShmBase.h
dom/plugins/ipc/hangui/MiniShmChild.cpp
dom/plugins/ipc/hangui/PluginHangUIChild.cpp
--- a/dom/plugins/ipc/BrowserStreamChild.cpp
+++ b/dom/plugins/ipc/BrowserStreamChild.cpp
@@ -59,17 +59,17 @@ BrowserStreamChild::StreamConstructed(
   NPError rv = NPERR_NO_ERROR;
 
   *stype = NP_NORMAL;
   rv = mInstance->mPluginIface->newstream(
     &mInstance->mData, const_cast<char*>(NullableStringGet(mimeType)),
     &mStream, seekable, stype);
   if (rv != NPERR_NO_ERROR) {
     mState = DELETING;
-    mStreamNotify = NULL;
+    mStreamNotify = nullptr;
   }
   else {
     mState = ALIVE;
 
     if (mStreamNotify)
       mStreamNotify->SetAssociatedStream(this);
   }
 
@@ -238,17 +238,17 @@ BrowserStreamChild::Deliver()
       ->destroystream(&mInstance->mData, &mStream, mStreamStatus);
   }
   if (DESTROYED == mDestroyPending && mNotifyPending) {
     NS_ASSERTION(mStreamNotify, "mDestroyPending but no mStreamNotify?");
       
     mNotifyPending = false;
     mStreamNotify->NPP_URLNotify(mStreamStatus);
     delete mStreamNotify;
-    mStreamNotify = NULL;
+    mStreamNotify = nullptr;
   }
   if (DYING == mState && DESTROYED == mDestroyPending
       && !mStreamNotify && !mInstanceDying) {
     SendStreamDestroyed();
     mState = DELETING;
   }
 }
 
--- a/dom/plugins/ipc/BrowserStreamParent.cpp
+++ b/dom/plugins/ipc/BrowserStreamParent.cpp
@@ -56,17 +56,17 @@ BrowserStreamParent::AnswerNPN_RequestRe
     return false;
 
   nsAutoArrayPtr<NPByteRange> rp(new NPByteRange[ranges.size()]);
   for (uint32_t i = 0; i < ranges.size(); ++i) {
     rp[i].offset = ranges[i].offset;
     rp[i].length = ranges[i].length;
     rp[i].next = &rp[i + 1];
   }
-  rp[ranges.size() - 1].next = NULL;
+  rp[ranges.size() - 1].next = nullptr;
 
   *result = mNPP->mNPNIface->requestread(mStream, rp);
   return true;
 }
 
 bool
 BrowserStreamParent::RecvNPN_DestroyStream(const NPReason& reason)
 {
@@ -97,17 +97,17 @@ BrowserStreamParent::NPP_DestroyStream(N
 bool
 BrowserStreamParent::RecvStreamDestroyed()
 {
   if (DYING != mState) {
     NS_ERROR("Unexpected state");
     return false;
   }
 
-  mStreamPeer = NULL;
+  mStreamPeer = nullptr;
 
   mState = DELETING;
   return Send__delete__(this);
 }
 
 int32_t
 BrowserStreamParent::WriteReady()
 {
--- a/dom/plugins/ipc/ChildAsyncCall.cpp
+++ b/dom/plugins/ipc/ChildAsyncCall.cpp
@@ -17,19 +17,19 @@ ChildAsyncCall::ChildAsyncCall(PluginIns
   , mFunc(aFunc)
   , mData(aUserData)
 {
 }
 
 void
 ChildAsyncCall::Cancel()
 {
-  mInstance = NULL;
-  mFunc = NULL;
-  mData = NULL;
+  mInstance = nullptr;
+  mFunc = nullptr;
+  mData = nullptr;
 }
 
 void
 ChildAsyncCall::RemoveFromAsyncList()
 {
   if (mInstance) {
     MutexAutoLock lock(mInstance->mAsyncCallMutex);
     mInstance->mPendingAsyncCalls.RemoveElement(this);
--- a/dom/plugins/ipc/MiniShmParent.cpp
+++ b/dom/plugins/ipc/MiniShmParent.cpp
@@ -13,63 +13,63 @@
 namespace mozilla {
 namespace plugins {
 
 // static
 const unsigned int MiniShmParent::kDefaultMiniShmSectionSize = 0x1000;
 
 MiniShmParent::MiniShmParent()
   : mSectionSize(0),
-    mParentEvent(NULL),
-    mParentGuard(NULL),
-    mChildEvent(NULL),
-    mChildGuard(NULL),
-    mRegWait(NULL),
-    mFileMapping(NULL),
+    mParentEvent(nullptr),
+    mParentGuard(nullptr),
+    mChildEvent(nullptr),
+    mChildGuard(nullptr),
+    mRegWait(nullptr),
+    mFileMapping(nullptr),
     mView(nullptr),
     mIsConnected(false),
     mTimeout(INFINITE)
 {
 }
 
 MiniShmParent::~MiniShmParent()
 {
   CleanUp();
 }
 
 void
 MiniShmParent::CleanUp()
 {
   if (mRegWait) {
     ::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
-    mRegWait = NULL;
+    mRegWait = nullptr;
   }
   if (mParentEvent) {
     ::CloseHandle(mParentEvent);
-    mParentEvent = NULL;
+    mParentEvent = nullptr;
   }
   if (mParentGuard) {
     ::CloseHandle(mParentGuard);
-    mParentGuard = NULL;
+    mParentGuard = nullptr;
   }
   if (mChildEvent) {
     ::CloseHandle(mChildEvent);
-    mChildEvent = NULL;
+    mChildEvent = nullptr;
   }
   if (mChildGuard) {
     ::CloseHandle(mChildGuard);
-    mChildGuard = NULL;
+    mChildGuard = nullptr;
   }
   if (mView) {
     ::UnmapViewOfFile(mView);
     mView = nullptr;
   }
   if (mFileMapping) {
     ::CloseHandle(mFileMapping);
-    mFileMapping = NULL;
+    mFileMapping = nullptr;
   }
 }
 
 nsresult
 MiniShmParent::Init(MiniShmObserver* aObserver, const DWORD aTimeout,
                     const unsigned int aSectionSize)
 {
   if (!aObserver || !aSectionSize || (aSectionSize % 0x1000) || !aTimeout) {
--- a/dom/plugins/ipc/NPEventOSX.h
+++ b/dom/plugins/ipc/NPEventOSX.h
@@ -60,18 +60,18 @@ struct ParamTraits<mozilla::plugins::NPR
                 aMsg->WriteUnsignedChar(aParam.event.data.key.isARepeat);
                 aMsg->WriteUInt16(aParam.event.data.key.keyCode);
                 break;
             case NPCocoaEventFocusChanged:
             case NPCocoaEventWindowFocusChanged:
                 aMsg->WriteUnsignedChar(aParam.event.data.focus.hasFocus);
                 break;
             case NPCocoaEventDrawRect:
-                // We don't write out the context pointer, it would always be NULL
-                // and is just filled in as such on the read.
+                // We don't write out the context pointer, it would always be
+                // nullptr and is just filled in as such on the read.
                 aMsg->WriteDouble(aParam.event.data.draw.x);
                 aMsg->WriteDouble(aParam.event.data.draw.y);
                 aMsg->WriteDouble(aParam.event.data.draw.width);
                 aMsg->WriteDouble(aParam.event.data.draw.height);
                 break;
             case NPCocoaEventTextInput:
                 WriteParam(aMsg, aParam.event.data.text.text);
                 break;
@@ -148,17 +148,17 @@ struct ParamTraits<mozilla::plugins::NPR
                 break;
             case NPCocoaEventFocusChanged:
             case NPCocoaEventWindowFocusChanged:
                 if (!aMsg->ReadUnsignedChar(aIter, &aResult->event.data.focus.hasFocus)) {
                     return false;
                 }
                 break;
             case NPCocoaEventDrawRect:
-                aResult->event.data.draw.context = NULL;
+                aResult->event.data.draw.context = nullptr;
                 if (!aMsg->ReadDouble(aIter, &aResult->event.data.draw.x)) {
                     return false;
                 }
                 if (!aMsg->ReadDouble(aIter, &aResult->event.data.draw.y)) {
                     return false;
                 }
                 if (!aMsg->ReadDouble(aIter, &aResult->event.data.draw.width)) {
                     return false;
--- a/dom/plugins/ipc/NestedLoopTimer.cpp
+++ b/dom/plugins/ipc/NestedLoopTimer.cpp
@@ -8,26 +8,26 @@
 
 #include "NestedLoopTimer.h"
 #include "mozilla/plugins/PluginModuleChild.h"
 
 namespace mozilla {
 namespace plugins {
 
 NestedLoopTimer::NestedLoopTimer(PluginModuleChild *pmc):
-     QObject(), mModule(pmc), mQTimer(NULL)
+     QObject(), mModule(pmc), mQTimer(nullptr)
 {
 }
 
 NestedLoopTimer::~NestedLoopTimer()
 {
     if (mQTimer) {
         mQTimer->stop();
         delete mQTimer;
-        mQTimer = NULL;
+        mQTimer = nullptr;
     }
 }
 
 void NestedLoopTimer::timeOut()
 {
     // just detected a nested loop; start a timer that will
     // periodically rpc-call back into the browser and process some
     // events
--- a/dom/plugins/ipc/PluginHangUIParent.cpp
+++ b/dom/plugins/ipc/PluginHangUIParent.cpp
@@ -74,20 +74,20 @@ PluginHangUIParent::PluginHangUIParent(P
                                        const int32_t aChildTimeoutPref)
   : mMutex("mozilla::plugins::PluginHangUIParent::mMutex"),
     mModule(aModule),
     mTimeoutPrefMs(static_cast<uint32_t>(aHangUITimeoutPref) * 1000U),
     mIPCTimeoutMs(static_cast<uint32_t>(aChildTimeoutPref) * 1000U),
     mMainThreadMessageLoop(MessageLoop::current()),
     mIsShowing(false),
     mLastUserResponse(0),
-    mHangUIProcessHandle(NULL),
-    mMainWindowHandle(NULL),
-    mRegWait(NULL),
-    mShowEvent(NULL),
+    mHangUIProcessHandle(nullptr),
+    mMainWindowHandle(nullptr),
+    mRegWait(nullptr),
+    mShowEvent(nullptr),
     mShowTicks(0),
     mResponseTicks(0)
 {
 }
 
 PluginHangUIParent::~PluginHangUIParent()
 {
   { // Scope for lock
@@ -219,25 +219,25 @@ PluginHangUIParent::Init(const nsString&
 
   std::wstring ipcCookie;
   rv = mMiniShm.GetCookie(ipcCookie);
   if (NS_FAILED(rv)) {
     return false;
   }
   commandLine.AppendLooseValue(ipcCookie);
 
-  ScopedHandle showEvent(::CreateEvent(NULL, FALSE, FALSE, NULL));
+  ScopedHandle showEvent(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
   if (!showEvent.IsValid()) {
     return false;
   }
   mShowEvent = showEvent.Get();
 
   MutexAutoLock lock(mMutex);
   STARTUPINFO startupInfo = { sizeof(STARTUPINFO) };
-  PROCESS_INFORMATION processInfo = { NULL };
+  PROCESS_INFORMATION processInfo = { nullptr };
   BOOL isProcessCreated = ::CreateProcess(exePath.value().c_str(),
                                           const_cast<wchar_t*>(commandLine.command_line_string().c_str()),
                                           nullptr,
                                           nullptr,
                                           TRUE,
                                           DETACHED_PROCESS,
                                           nullptr,
                                           nullptr,
@@ -256,17 +256,17 @@ PluginHangUIParent::Init(const nsString&
                                                             : mIPCTimeoutMs);
     // Setting this to true even if we time out on mShowEvent. This timeout 
     // typically occurs when the machine is thrashing so badly that 
     // plugin-hang-ui.exe is taking a while to start. If we didn't set 
     // this to true, Firefox would keep spawning additional plugin-hang-ui 
     // processes, which is not what we want.
     mIsShowing = true;
   }
-  mShowEvent = NULL;
+  mShowEvent = nullptr;
   return !(!isProcessCreated);
 }
 
 // static
 VOID CALLBACK PluginHangUIParent::SOnHangUIProcessExit(PVOID aContext,
                                                        BOOLEAN aIsTimer)
 {
   PluginHangUIParent* object = static_cast<PluginHangUIParent*>(aContext);
@@ -281,32 +281,32 @@ VOID CALLBACK PluginHangUIParent::SOnHan
 }
 
 // A precondition for this function is that the caller has locked mMutex
 bool
 PluginHangUIParent::UnwatchHangUIChildProcess(bool aWait)
 {
   mMutex.AssertCurrentThreadOwns();
   if (mRegWait) {
-    // If aWait is false then we want to pass a NULL (i.e. default constructor)
-    // completionEvent
+    // If aWait is false then we want to pass a nullptr (i.e. default
+    // constructor) completionEvent
     ScopedHandle completionEvent;
     if (aWait) {
-      completionEvent.Set(::CreateEvent(NULL, FALSE, FALSE, NULL));
+      completionEvent.Set(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
       if (!completionEvent.IsValid()) {
         return false;
       }
     }
 
     // if aWait == false and UnregisterWaitEx fails with ERROR_IO_PENDING,
     // it is okay to clear mRegWait; Windows is telling us that the wait's
     // callback is running but will be cleaned up once the callback returns.
     if (::UnregisterWaitEx(mRegWait, completionEvent) ||
         !aWait && ::GetLastError() == ERROR_IO_PENDING) {
-      mRegWait = NULL;
+      mRegWait = nullptr;
       if (aWait) {
         // We must temporarily unlock mMutex while waiting for the registered
         // wait callback to complete, or else we could deadlock.
         MutexAutoUnlock unlock(mMutex);
         ::WaitForSingleObject(completionEvent, INFINITE);
       }
       return true;
     }
@@ -369,17 +369,17 @@ PluginHangUIParent::RecvUserResponse(con
                                                                mTimeoutPrefMs);
   NS_DispatchToMainThread(workItem, NS_DISPATCH_NORMAL);
   return true;
 }
 
 nsresult
 PluginHangUIParent::GetHangUIOwnerWindowHandle(NativeWindowHandle& windowHandle)
 {
-  windowHandle = NULL;
+  windowHandle = nullptr;
 
   nsresult rv;
   nsCOMPtr<nsIWindowMediator> winMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID,
                                                         &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDOMWindow> navWin;
   rv = winMediator->GetMostRecentWindow(NS_LITERAL_STRING("navigator:browser").get(),
--- a/dom/plugins/ipc/PluginIdentifierChild.cpp
+++ b/dom/plugins/ipc/PluginIdentifierChild.cpp
@@ -97,17 +97,17 @@ PluginIdentifierChildString::GetCanonica
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
   return module->mStringIdentifiers.Get(mString);
 }
 
 void
 PluginIdentifierChildString::Hash()
 {
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
-  NS_ASSERTION(module->mStringIdentifiers.Get(mString) == NULL, "Replacing Hash?");
+  NS_ASSERTION(module->mStringIdentifiers.Get(mString) == nullptr, "Replacing Hash?");
   module->mStringIdentifiers.Put(mString, this);
 }
 
 void
 PluginIdentifierChildString::Unhash()
 {
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
   NS_ASSERTION(module->mStringIdentifiers.Get(mString) == this, "Incorrect identifier hash?");
@@ -120,17 +120,17 @@ PluginIdentifierChildInt::GetCanonical()
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
   return module->mIntIdentifiers.Get(mInt);
 }
 
 void
 PluginIdentifierChildInt::Hash()
 {
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
-  NS_ASSERTION(module->mIntIdentifiers.Get(mInt) == NULL, "Replacing Hash?");
+  NS_ASSERTION(module->mIntIdentifiers.Get(mInt) == nullptr, "Replacing Hash?");
   module->mIntIdentifiers.Put(mInt, this);
 }
 
 void
 PluginIdentifierChildInt::Unhash()
 {
   PluginModuleChild* module = static_cast<PluginModuleChild*>(Manager());
   NS_ASSERTION(module->mIntIdentifiers.Get(mInt) == this, "Incorrect identifier hash?");
--- a/dom/plugins/ipc/PluginIdentifierChild.h
+++ b/dom/plugins/ipc/PluginIdentifierChild.h
@@ -63,17 +63,17 @@ public:
     PluginIdentifierChild* operator->() { return mIdentifier; }
 
   private:
     PluginIdentifierChild* mIdentifier;
   };
 
 protected:
   PluginIdentifierChild(bool aIsString)
-    : mCanonicalIdentifier(NULL)
+    : mCanonicalIdentifier(nullptr)
     , mHashed(false)
     , mTemporaryRefs(0)
     , mIsString(aIsString)
   {
     MOZ_COUNT_CTOR(PluginIdentifierChild);
   }
 
   virtual ~PluginIdentifierChild()
@@ -94,17 +94,17 @@ private:
   // There's a possibility that we already have an actor that wraps the same
   // string or int because we do all this identifier construction
   // asynchronously. In this case we need to hand out the canonical version
   // created by the child side.
   //
   // In order to deal with temporary identifiers which appear on the stack,
   // identifiers use the following state invariants:
   //
-  // * mCanonicalIdentifier is non-NULL: this is a duplicate identifier, no
+  // * mCanonicalIdentifier is non-nullptr: this is a duplicate identifier, no
   //   further information is necessary.
   // * mHashed is false: this identifier is a newborn, non-permanent identifier
   // * mHashed is true, mTemporaryRefs is 0: this identifier is permanent
   // * mHashed is true, mTemporaryRefs is non-0: this identifier is temporary;
   //   if NPN_GetFooIdentifier is called for it, we need to retain it. If
   //   all stack references are lost, unhash it because it will soon be 
   //   deleted.
 
--- a/dom/plugins/ipc/PluginIdentifierParent.cpp
+++ b/dom/plugins/ipc/PluginIdentifierParent.cpp
@@ -45,17 +45,17 @@ PluginIdentifierParent::RecvRetain()
 PluginIdentifierParent::StackIdentifier::StackIdentifier
     (PluginInstanceParent* inst, NPIdentifier aIdentifier)
   : mIdentifier(inst->Module()->GetIdentifierForNPIdentifier(inst->GetNPP(), aIdentifier))
 {
 }
 
 PluginIdentifierParent::StackIdentifier::StackIdentifier
     (NPObject* aObject, NPIdentifier aIdentifier)
-  : mIdentifier(NULL)
+  : mIdentifier(nullptr)
 {
   PluginInstanceParent* inst = GetInstance(aObject);
   mIdentifier = inst->Module()->GetIdentifierForNPIdentifier(inst->GetNPP(), aIdentifier);
 }
 
 PluginIdentifierParent::StackIdentifier::~StackIdentifier()
 {
   if (!mIdentifier) {
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -63,18 +63,18 @@ using namespace std;
 typedef BOOL (WINAPI *User32TrackPopupMenu)(HMENU hMenu,
                                             UINT uFlags,
                                             int x,
                                             int y,
                                             int nReserved,
                                             HWND hWnd,
                                             CONST RECT *prcRect);
 static WindowsDllInterceptor sUser32Intercept;
-static HWND sWinlessPopupSurrogateHWND = NULL;
-static User32TrackPopupMenu sUser32TrackPopupMenuStub = NULL;
+static HWND sWinlessPopupSurrogateHWND = nullptr;
+static User32TrackPopupMenu sUser32TrackPopupMenuStub = nullptr;
 
 using mozilla::gfx::SharedDIB;
 
 #include <windows.h>
 #include <windowsx.h>
 
 // Flash WM_USER message delay time for PostDelayedTask. Borrowed
 // from Chromium's web plugin delegate src. See 'flash msg throttling
@@ -126,18 +126,18 @@ PluginInstanceChild::PluginInstanceChild
 #endif
     , mShColorSpace(nullptr)
     , mShContext(nullptr)
     , mCGLayer(nullptr)
     , mCurrentEvent(nullptr)
 #endif
     , mLayersRendering(false)
 #ifdef XP_WIN
-    , mCurrentSurfaceActor(NULL)
-    , mBackSurfaceActor(NULL)
+    , mCurrentSurfaceActor(nullptr)
+    , mBackSurfaceActor(nullptr)
 #endif
     , mAccumulatedInvalidRect(0,0,0,0)
     , mIsTransparent(false)
     , mSurfaceType(gfxSurfaceTypeMax)
     , mCurrentInvalidateTask(nullptr)
     , mCurrentAsyncSetWindowTask(nullptr)
     , mPendingPluginCall(false)
     , mDoAlphaExtraction(false)
@@ -147,18 +147,18 @@ PluginInstanceChild::PluginInstanceChild
     memset(&mWindow, 0, sizeof(mWindow));
     mWindow.type = NPWindowTypeWindow;
     mData.ndata = (void*) this;
     mData.pdata = nullptr;
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
     mWindow.ws_info = &mWsInfo;
     memset(&mWsInfo, 0, sizeof(mWsInfo));
 #if (MOZ_WIDGET_GTK == 2)
-    mWsInfo.display = NULL;
-    mXtClient.top_widget = NULL;
+    mWsInfo.display = nullptr;
+    mXtClient.top_widget = nullptr;
 #else
     mWsInfo.display = DefaultXDisplay();
 #endif
 #endif // MOZ_X11 && XP_UNIX && !XP_MACOSX
 #if defined(OS_WIN)
     memset(&mAlphaExtract, 0, sizeof(mAlphaExtract));
 #endif // OS_WIN
 #if defined(OS_WIN)
@@ -192,17 +192,17 @@ PluginInstanceChild::GetQuirks()
 {
     return PluginModuleChild::current()->GetQuirks();
 }
 
 NPError
 PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
                                                  NPObject** aObject)
 {
-    PluginScriptableObjectChild* actor = NULL;
+    PluginScriptableObjectChild* actor = nullptr;
     NPError result = NPERR_NO_ERROR;
 
     switch (aValue) {
         case NPNVWindowNPObject:
             if (!(actor = mCachedWindowActor)) {
                 PPluginScriptableObjectChild* actorProtocol;
                 CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result);
                 if (result == NPERR_NO_ERROR) {
@@ -670,17 +670,17 @@ bool
 PluginInstanceChild::AnswerNPP_GetValue_NPPVpluginNativeAccessibleAtkPlugId(
                                           nsCString* aPlugId,
                                           NPError* aResult)
 {
     AssertPluginThread();
 
 #if MOZ_ACCESSIBILITY_ATK
 
-    char* plugId = NULL;
+    char* plugId = nullptr;
     NPError result = NPERR_GENERIC_ERROR;
     if (mPluginIface->getvalue) {
         result = mPluginIface->getvalue(GetNPP(),
                                         NPPVpluginNativeAccessibleAtkPlugId,
                                         &plugId);
     }
 
     *aPlugId = nsCString(plugId);
@@ -1053,17 +1053,17 @@ void PluginInstanceChild::DeleteWindow()
 
   if (!mWindow.window)
       return;
 
 #if (MOZ_WIDGET_GTK == 2)
   if (mXtClient.top_widget) {     
       xt_client_unrealize(&mXtClient);
       xt_client_destroy(&mXtClient); 
-      mXtClient.top_widget = NULL;
+      mXtClient.top_widget = nullptr;
   }
 #endif
 
   // We don't have to keep the plug-in window ID any longer.
   mWindow.window = nullptr;
 }
 #endif
 
@@ -1098,31 +1098,31 @@ PluginInstanceChild::AnswerNPP_SetWindow
                        &mWsInfo.visual, &depth);
     mWsInfo.depth = depth;
 
     if (!mWindow.window && mWindow.type == NPWindowTypeWindow) {
         CreateWindow(aWindow);
     }
 
 #if (MOZ_WIDGET_GTK == 2)
-    if (mXEmbed && gtk_check_version(2,18,7) != NULL) { // older
+    if (mXEmbed && gtk_check_version(2,18,7) != nullptr) { // older
         if (aWindow.type == NPWindowTypeWindow) {
             GdkWindow* socket_window = gdk_window_lookup(static_cast<GdkNativeWindow>(aWindow.window));
             if (socket_window) {
                 // A GdkWindow for the socket already exists.  Need to
                 // workaround https://bugzilla.gnome.org/show_bug.cgi?id=607061
                 // See wrap_gtk_plug_embedded in PluginModuleChild.cpp.
                 g_object_set_data(G_OBJECT(socket_window),
                                   "moz-existed-before-set-window",
                                   GUINT_TO_POINTER(1));
             }
         }
 
         if (aWindow.visualID != None
-            && gtk_check_version(2, 12, 10) != NULL) { // older
+            && gtk_check_version(2, 12, 10) != nullptr) { // older
             // Workaround for a bug in Gtk+ (prior to 2.12.10) where deleting
             // a foreign GdkColormap will also free the XColormap.
             // http://git.gnome.org/browse/gtk+/log/gdk/x11/gdkcolor-x11.c?id=GTK_2_12_10
             GdkVisual *gdkvisual = gdkx_visual_get(aWindow.visualID);
             GdkColormap *gdkcolor =
                 gdk_x11_colormap_foreign_new(gdkvisual, aWindow.colormap);
 
             if (g_object_get_data(G_OBJECT(gdkcolor), "moz-have-extra-ref")) {
@@ -1282,17 +1282,17 @@ PluginInstanceChild::RegisterWindowClass
     alreadyRegistered = true;
 
     WNDCLASSEX wcex;
     wcex.cbSize         = sizeof(WNDCLASSEX);
     wcex.style          = CS_DBLCLKS;
     wcex.lpfnWndProc    = DummyWindowProc;
     wcex.cbClsExtra     = 0;
     wcex.cbWndExtra     = 0;
-    wcex.hInstance      = GetModuleHandle(NULL);
+    wcex.hInstance      = GetModuleHandle(nullptr);
     wcex.hIcon          = 0;
     wcex.hCursor        = 0;
     wcex.hbrBackground  = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1);
     wcex.lpszMenuName   = 0;
     wcex.lpszClassName  = kWindowClassName;
     wcex.hIconSm        = 0;
 
     return RegisterClassEx(&wcex) ? true : false;
@@ -1309,17 +1309,17 @@ PluginInstanceChild::CreatePluginWindow(
         return false;
 
     mPluginWindowHWND =
         CreateWindowEx(WS_EX_LEFT | WS_EX_LTRREADING |
                        WS_EX_NOPARENTNOTIFY | // XXXbent Get rid of this!
                        WS_EX_RIGHTSCROLLBAR,
                        kWindowClassName, 0,
                        WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0,
-                       0, 0, NULL, 0, GetModuleHandle(NULL), 0);
+                       0, 0, nullptr, 0, GetModuleHandle(nullptr), 0);
     if (!mPluginWindowHWND)
         return false;
     if (!SetProp(mPluginWindowHWND, kPluginInstanceChildProperty, this))
         return false;
 
     // Apparently some plugins require an ASCII WndProc.
     SetWindowLongPtrA(mPluginWindowHWND, GWLP_WNDPROC,
                       reinterpret_cast<LONG_PTR>(DefWindowProcA));
@@ -1368,17 +1368,17 @@ PluginInstanceChild::ReparentPluginWindo
 
 void
 PluginInstanceChild::SizePluginWindow(int width,
                                       int height)
 {
     if (mPluginWindowHWND) {
         mPluginSize.x = width;
         mPluginSize.y = height;
-        SetWindowPos(mPluginWindowHWND, NULL, 0, 0, width, height,
+        SetWindowPos(mPluginWindowHWND, nullptr, 0, 0, width, height,
                      SWP_NOZORDER | SWP_NOREPOSITION);
     }
 }
 
 // See chromium's webplugin_delegate_impl.cc for explanation of this function.
 // static
 LRESULT CALLBACK
 PluginInstanceChild::DummyWindowProc(HWND hWnd,
@@ -1441,17 +1441,17 @@ PluginInstanceChild::PluginWindowProcInt
 
     // The plugin received keyboard focus, let the parent know so the dom is up to date.
     if (message == WM_MOUSEACTIVATE)
       self->CallPluginFocusChange(true);
 
     // Prevent lockups due to plugins making rpc calls when the parent
     // is making a synchronous SendMessage call to the child window. Add
     // more messages as needed.
-    if ((InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
+    if ((InSendMessageEx(nullptr)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
         switch(message) {
             case WM_KILLFOCUS:
             ReplyMessage(0);
             break;
         }
     }
 
     if (message == WM_KILLFOCUS)
@@ -1511,29 +1511,29 @@ PluginInstanceChild::PluginWindowProcInt
 typedef LONG_PTR
   (WINAPI *User32SetWindowLongPtrA)(HWND hWnd,
                                     int nIndex,
                                     LONG_PTR dwNewLong);
 typedef LONG_PTR
   (WINAPI *User32SetWindowLongPtrW)(HWND hWnd,
                                     int nIndex,
                                     LONG_PTR dwNewLong);
-static User32SetWindowLongPtrA sUser32SetWindowLongAHookStub = NULL;
-static User32SetWindowLongPtrW sUser32SetWindowLongWHookStub = NULL;
+static User32SetWindowLongPtrA sUser32SetWindowLongAHookStub = nullptr;
+static User32SetWindowLongPtrW sUser32SetWindowLongWHookStub = nullptr;
 #else
 typedef LONG
 (WINAPI *User32SetWindowLongA)(HWND hWnd,
                                int nIndex,
                                LONG dwNewLong);
 typedef LONG
 (WINAPI *User32SetWindowLongW)(HWND hWnd,
                                int nIndex,
                                LONG dwNewLong);
-static User32SetWindowLongA sUser32SetWindowLongAHookStub = NULL;
-static User32SetWindowLongW sUser32SetWindowLongWHookStub = NULL;
+static User32SetWindowLongA sUser32SetWindowLongAHookStub = nullptr;
+static User32SetWindowLongW sUser32SetWindowLongWHookStub = nullptr;
 #endif
 
 extern LRESULT CALLBACK
 NeuteredWindowProc(HWND hwnd,
                    UINT uMsg,
                    WPARAM wParam,
                    LPARAM lParam);
 
@@ -1689,17 +1689,17 @@ PluginInstanceChild::TrackPopupHookProc(
   if (!sWinlessPopupSurrogateHWND) {
       NS_WARNING(
           "Untraced TrackPopupHookProc call! Menu might not work right!");
       return sUser32TrackPopupMenuStub(hMenu, uFlags, x, y, nReserved,
                                        hWnd, prcRect);
   }
 
   HWND surrogateHwnd = sWinlessPopupSurrogateHWND;
-  sWinlessPopupSurrogateHWND = NULL;
+  sWinlessPopupSurrogateHWND = nullptr;
 
   // Popups that don't use TPM_RETURNCMD expect a final command message
   // when an item is selected and the context closes. Since we replace
   // the parent, we need to forward this back to the real parent so it
   // can act on the menu item selected.
   bool isRetCmdCall = (uFlags & TPM_RETURNCMD);
 
   DWORD res = sUser32TrackPopupMenuStub(hMenu, uFlags|TPM_RETURNCMD, x, y,
@@ -1732,52 +1732,52 @@ PluginInstanceChild::InitPopupMenuHook()
 
 void
 PluginInstanceChild::CreateWinlessPopupSurrogate()
 {
     // already initialized
     if (mWinlessPopupSurrogateHWND)
         return;
 
-    HWND hwnd = NULL;
+    HWND hwnd = nullptr;
     NPError result;
     if (!CallNPN_GetValue_NPNVnetscapeWindow(&hwnd, &result)) {
         NS_ERROR("CallNPN_GetValue_NPNVnetscapeWindow failed.");
         return;
     }
 
     mWinlessPopupSurrogateHWND =
-        CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD, 0, 0,
-                       0, 0, hwnd, 0, GetModuleHandle(NULL), 0);
+        CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", nullptr, WS_CHILD,
+                       0, 0, 0, 0, hwnd, 0, GetModuleHandle(nullptr), 0);
     if (!mWinlessPopupSurrogateHWND) {
         NS_ERROR("CreateWindowEx failed for winless placeholder!");
         return;
     }
     return;
 }
 
 void
 PluginInstanceChild::DestroyWinlessPopupSurrogate()
 {
     if (mWinlessPopupSurrogateHWND)
         DestroyWindow(mWinlessPopupSurrogateHWND);
-    mWinlessPopupSurrogateHWND = NULL;
+    mWinlessPopupSurrogateHWND = nullptr;
 }
 
 int16_t
 PluginInstanceChild::WinlessHandleEvent(NPEvent& event)
 {
     if (!mPluginIface->event)
         return false;
 
     // Events that might generate nested event dispatch loops need
     // special handling during delivery.
     int16_t handled;
     
-    HWND focusHwnd = NULL;
+    HWND focusHwnd = nullptr;
 
     // TrackPopupMenu will fail if the parent window is not associated with
     // our ui thread. So we hook TrackPopupMenu so we can hand in a surrogate
     // parent created in the child process.
     if ((GetQuirks() & PluginModuleChild::QUIRK_WINLESS_TRACKPOPUP_HOOK) && // XXX turn on by default?
           (event.event == WM_RBUTTONDOWN || // flash
            event.event == WM_RBUTTONUP)) {  // silverlight
       sWinlessPopupSurrogateHWND = mWinlessPopupSurrogateHWND;
@@ -1787,17 +1787,17 @@ PluginInstanceChild::WinlessHandleEvent(
       focusHwnd = SetFocus(mWinlessPopupSurrogateHWND);
     }
 
     MessageLoop* loop = MessageLoop::current();
     AutoRestore<bool> modalLoop(loop->os_modal_loop());
 
     handled = mPluginIface->event(&mData, reinterpret_cast<void*>(&event));
 
-    sWinlessPopupSurrogateHWND = NULL;
+    sWinlessPopupSurrogateHWND = nullptr;
 
     if (IsWindow(focusHwnd)) {
       SetFocus(focusHwnd);
     }
 
     return handled;
 }
 
@@ -1827,17 +1827,18 @@ PluginInstanceChild::SharedSurfaceSetWin
     // NPRemoteWindow's origin is the origin of our shared dib.
     mWindow.x      = aWindow.x;
     mWindow.y      = aWindow.y;
     mWindow.width  = aWindow.width;
     mWindow.height = aWindow.height;
     mWindow.type   = aWindow.type;
 
     mWindow.window = reinterpret_cast<void*>(mSharedSurfaceDib.GetHDC());
-    ::SetViewportOrgEx(mSharedSurfaceDib.GetHDC(), -aWindow.x, -aWindow.y, NULL);
+    ::SetViewportOrgEx(mSharedSurfaceDib.GetHDC(),
+                       -aWindow.x, -aWindow.y, nullptr);
 
     if (mPluginIface->setwindow)
         mPluginIface->setwindow(&mData, &mWindow);
 
     return true;
 }
 
 void
@@ -1850,17 +1851,17 @@ PluginInstanceChild::SharedSurfaceReleas
 /* double pass cache buffer - (rarely) used in cases where alpha extraction
  * occurs for windowless plugins. */
  
 bool
 PluginInstanceChild::AlphaExtractCacheSetup()
 {
     AlphaExtractCacheRelease();
 
-    mAlphaExtract.hdc = ::CreateCompatibleDC(NULL);
+    mAlphaExtract.hdc = ::CreateCompatibleDC(nullptr);
 
     if (!mAlphaExtract.hdc)
         return false;
 
     BITMAPINFOHEADER bmih;
     memset((void*)&bmih, 0, sizeof(BITMAPINFOHEADER));
     bmih.biSize        = sizeof(BITMAPINFOHEADER);
     bmih.biWidth       = mWindow.width;
@@ -1869,17 +1870,17 @@ PluginInstanceChild::AlphaExtractCacheSe
     bmih.biBitCount    = 32;
     bmih.biCompression = BI_RGB;
 
     void* ppvBits = nullptr;
     mAlphaExtract.bmp = ::CreateDIBSection(mAlphaExtract.hdc,
                                            (BITMAPINFO*)&bmih,
                                            DIB_RGB_COLORS,
                                            (void**)&ppvBits,
-                                           NULL,
+                                           nullptr,
                                            (unsigned long)sizeof(BITMAPINFOHEADER));
     if (!mAlphaExtract.bmp)
       return false;
 
     DeleteObject(::SelectObject(mAlphaExtract.hdc, mAlphaExtract.bmp));
     return true;
 }
 
@@ -1887,18 +1888,18 @@ void
 PluginInstanceChild::AlphaExtractCacheRelease()
 {
     if (mAlphaExtract.bmp)
         ::DeleteObject(mAlphaExtract.bmp);
 
     if (mAlphaExtract.hdc)
         ::DeleteObject(mAlphaExtract.hdc);
 
-    mAlphaExtract.bmp = NULL;
-    mAlphaExtract.hdc = NULL;
+    mAlphaExtract.bmp = nullptr;
+    mAlphaExtract.hdc = nullptr;
 }
 
 void
 PluginInstanceChild::UpdatePaintClipRect(RECT* aRect)
 {
     if (aRect) {
         // Update the clip rect on our internal hdc
         HRGN clip = ::CreateRectRgnIndirect(aRect);
@@ -2288,17 +2289,17 @@ PluginInstanceChild::DeallocPBrowserStre
 }
 
 PPluginStreamChild*
 PluginInstanceChild::AllocPPluginStreamChild(const nsCString& mimeType,
                                              const nsCString& target,
                                              NPError* result)
 {
     NS_RUNTIMEABORT("not callable");
-    return NULL;
+    return nullptr;
 }
 
 bool
 PluginInstanceChild::DeallocPPluginStreamChild(PPluginStreamChild* stream)
 {
     AssertPluginThread();
     delete stream;
     return true;
@@ -2309,28 +2310,28 @@ PluginInstanceChild::AllocPStreamNotifyC
                                              const nsCString& target,
                                              const bool& post,
                                              const nsCString& buffer,
                                              const bool& file,
                                              NPError* result)
 {
     AssertPluginThread();
     NS_RUNTIMEABORT("not reached");
-    return NULL;
+    return nullptr;
 }
 
 void
 StreamNotifyChild::ActorDestroy(ActorDestroyReason why)
 {
     if (AncestorDeletion == why && mBrowserStream) {
         NS_ERROR("Pending NPP_URLNotify not called when closing an instance.");
 
         // reclaim responsibility for deleting ourself
-        mBrowserStream->mStreamNotify = NULL;
-        mBrowserStream = NULL;
+        mBrowserStream->mStreamNotify = nullptr;
+        mBrowserStream = nullptr;
     }
 }
 
 
 void
 StreamNotifyChild::SetAssociatedStream(BrowserStreamChild* bs)
 {
     NS_ASSERTION(bs, "Shouldn't be null");
@@ -2427,17 +2428,17 @@ PluginInstanceChild::NPN_NewStream(NPMIM
     AssertPluginThread();
 
     PluginStreamChild* ps = new PluginStreamChild();
 
     NPError result;
     CallPPluginStreamConstructor(ps, nsDependentCString(aMIMEType),
                                  NullableString(aWindow), &result);
     if (NPERR_NO_ERROR != result) {
-        *aStream = NULL;
+        *aStream = nullptr;
         PPluginStreamChild::Call__delete__(ps, NPERR_GENERIC_ERROR, true);
         return result;
     }
 
     *aStream = &ps->mStream;
     return NPERR_NO_ERROR;
 }
 
@@ -2484,17 +2485,17 @@ PluginInstanceChild::IsAsyncDrawing()
 }
 
 NPError
 PluginInstanceChild::NPN_InitAsyncSurface(NPSize *size, NPImageFormat format,
                                           void *initData, NPAsyncSurface *surface)
 {
     AssertPluginThread();
 
-    surface->bitmap.data = NULL;
+    surface->bitmap.data = nullptr;
 
     if (!IsAsyncDrawing()) {
         return NPERR_GENERIC_ERROR;
     }
 
     switch (mDrawingModel) {
     case NPDrawingModelAsyncBitmapSurface: {
             if (mAsyncBitmaps.Get(surface, nullptr)) {
@@ -2571,32 +2572,32 @@ PluginInstanceChild::NPN_FinalizeAsyncSu
             if (!mAsyncBitmaps.Get(surface, &bitmapData)) {
                 return NPERR_GENERIC_ERROR;
             }
 
             {
                 CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
                 RemoteImageData *data = mRemoteImageData;
                 if (data->mBitmap.mData == bitmapData->mRemotePtr) {
-                    data->mBitmap.mData = NULL;
+                    data->mBitmap.mData = nullptr;
                     data->mSize = gfxIntSize(0, 0);
                     data->mWasUpdated = true;
                 }
             }
 
             return DeallocateAsyncBitmapSurface(surface);
         }
 #ifdef XP_WIN
     case NPDrawingModelAsyncWindowsDXGISurface: {
             
             {
                 CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
                 RemoteImageData *data = mRemoteImageData;
                 if (data->mTextureHandle == surface->sharedHandle) {
-                    data->mTextureHandle = NULL;
+                    data->mTextureHandle = nullptr;
                     data->mSize = gfxIntSize(0, 0);
                     data->mWasUpdated = true;
                 }
             }
 
             SendReleaseDXGISharedSurface(surface->sharedHandle);
             return NPERR_NO_ERROR;
         }
@@ -2612,17 +2613,17 @@ PluginInstanceChild::NPN_SetCurrentAsync
     if (!IsAsyncDrawing()) {
         return;
     }
 
     RemoteImageData *data = mRemoteImageData;
 
     if (!surface) {
         CrossProcessMutexAutoLock autoLock(*mRemoteImageDataMutex);
-        data->mBitmap.mData = NULL;
+        data->mBitmap.mData = nullptr;
         data->mSize = gfxIntSize(0, 0);
         data->mWasUpdated = true;
     } else {
         switch (mDrawingModel) {
         case NPDrawingModelAsyncBitmapSurface:
             {
                 AsyncBitmapData *bitmapData;
         
@@ -2667,17 +2668,17 @@ PluginInstanceChild::NPN_SetCurrentAsync
     }
 }
 
 void
 PluginInstanceChild::DoAsyncRedraw()
 {
     {
         MutexAutoLock autoLock(mAsyncInvalidateMutex);
-        mAsyncInvalidateTask = NULL;
+        mAsyncInvalidateTask = nullptr;
     }
 
     SendRedrawPlugin();
 }
 
 bool
 PluginInstanceChild::RecvAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
                                         const NPRemoteWindow& aWindow)
@@ -2720,17 +2721,17 @@ PluginInstanceChild::DoAsyncSetWindow(co
 
     if (aIsAsync) {
         if (!mCurrentAsyncSetWindowTask) {
             return;
         }
         mCurrentAsyncSetWindowTask = nullptr;
     }
 
-    mWindow.window = NULL;
+    mWindow.window = nullptr;
     if (mWindow.width != aWindow.width || mWindow.height != aWindow.height ||
         mWindow.clipRect.top != aWindow.clipRect.top ||
         mWindow.clipRect.left != aWindow.clipRect.left ||
         mWindow.clipRect.bottom != aWindow.clipRect.bottom ||
         mWindow.clipRect.right != aWindow.clipRect.right)
         mAccumulatedInvalidRect = nsIntRect(0, 0, aWindow.width, aWindow.height);
 
     mWindow.x = aWindow.x;
@@ -3018,17 +3019,17 @@ PluginInstanceChild::UpdateWindowAttribu
         if (visual != mWsInfo.visual || colormap != mWsInfo.colormap) {
             mWsInfo.visual = visual;
             mWsInfo.colormap = colormap;
             needWindowUpdate = true;
         }
     }
 #endif // MOZ_X11
 #ifdef XP_WIN
-    HDC dc = NULL;
+    HDC dc = nullptr;
 
     if (curSurface) {
         if (!SharedDIBSurface::IsSharedDIBSurface(curSurface))
             NS_RUNTIMEABORT("Expected SharedDIBSurface!");
 
         SharedDIBSurface* dibsurf = static_cast<SharedDIBSurface*>(curSurface.get());
         dc = dibsurf->GetHDC();
     }
@@ -3137,18 +3138,18 @@ PluginInstanceChild::PaintRectToPlatform
         mWindow.y + aRect.YMost()
     };
     NPEvent paintEvent = {
         WM_PAINT,
         uintptr_t(mWindow.window),
         uintptr_t(&rect)
     };
 
-    ::SetViewportOrgEx((HDC) mWindow.window, -mWindow.x, -mWindow.y, NULL);
-    ::SelectClipRgn((HDC) mWindow.window, NULL);
+    ::SetViewportOrgEx((HDC) mWindow.window, -mWindow.x, -mWindow.y, nullptr);
+    ::SelectClipRgn((HDC) mWindow.window, nullptr);
     ::IntersectClipRect((HDC) mWindow.window, rect.left, rect.top, rect.right, rect.bottom);
     mPluginIface->event(&mData, reinterpret_cast<void*>(&paintEvent));
 #else
     NS_RUNTIMEABORT("Surface type not implemented.");
 #endif
 }
 
 void
@@ -3489,17 +3490,17 @@ PluginInstanceChild::ShowPluginFrame()
         // before giving drawable to another process
         XSync(mWsInfo.display, False);
     } else
 #endif
 #ifdef XP_WIN
     if (SharedDIBSurface::IsSharedDIBSurface(mCurrentSurface)) {
         SharedDIBSurface* s = static_cast<SharedDIBSurface*>(mCurrentSurface.get());
         if (!mCurrentSurfaceActor) {
-            base::SharedMemoryHandle handle = NULL;
+            base::SharedMemoryHandle handle = nullptr;
             s->ShareToProcess(PluginModuleChild::current()->OtherProcess(), &handle);
 
             mCurrentSurfaceActor =
                 SendPPluginSurfaceConstructor(handle,
                                               mCurrentSurface->GetSize(),
                                               haveTransparentPixels);
         }
         currSurf = mCurrentSurfaceActor;
@@ -3841,17 +3842,17 @@ PluginInstanceChild::ClearCurrentSurface
 #ifdef MOZ_WIDGET_COCOA
     if (mDoubleBufferCARenderer.HasFrontSurface()) {
         mDoubleBufferCARenderer.ClearFrontSurface();
     }
 #endif
 #ifdef XP_WIN
     if (mCurrentSurfaceActor) {
         PPluginSurfaceChild::Send__delete__(mCurrentSurfaceActor);
-        mCurrentSurfaceActor = NULL;
+        mCurrentSurfaceActor = nullptr;
     }
 #endif
     mHelperSurface = nullptr;
 }
 
 void
 PluginInstanceChild::ClearAllSurfaces()
 {
@@ -3867,21 +3868,21 @@ PluginInstanceChild::ClearAllSurfaces()
     if (gfxSharedImageSurface::IsSharedImage(mBackSurface))
         DeallocShmem(static_cast<gfxSharedImageSurface*>(mBackSurface.get())->GetShmem());
     mCurrentSurface = nullptr;
     mBackSurface = nullptr;
 
 #ifdef XP_WIN
     if (mCurrentSurfaceActor) {
         PPluginSurfaceChild::Send__delete__(mCurrentSurfaceActor);
-        mCurrentSurfaceActor = NULL;
+        mCurrentSurfaceActor = nullptr;
     }
     if (mBackSurfaceActor) {
         PPluginSurfaceChild::Send__delete__(mBackSurfaceActor);
-        mBackSurfaceActor = NULL;
+        mBackSurfaceActor = nullptr;
     }
 #endif
 
 #ifdef MOZ_WIDGET_COCOA
     if (mDoubleBufferCARenderer.HasBackSurface()) {
         // Get last surface back, and drop it
         SurfaceDescriptor temp = null_t();
         NPRect r = { 0, 0, 1, 1 };
@@ -3956,18 +3957,18 @@ PluginInstanceChild::AnswerNPP_Destroy(N
         }
     }
 
     ClearAllSurfaces();
 
     mDeletingHash = new nsTHashtable<DeletingObjectEntry>;
     PluginModuleChild::current()->FindNPObjectsForInstance(this);
 
-    mDeletingHash->EnumerateEntries(InvalidateObject, NULL);
-    mDeletingHash->EnumerateEntries(DeleteObject, NULL);
+    mDeletingHash->EnumerateEntries(InvalidateObject, nullptr);
+    mDeletingHash->EnumerateEntries(DeleteObject, nullptr);
 
     // Null out our cached actors as they should have been killed in the
     // PluginInstanceDestroyed call above.
     mCachedWindowActor = nullptr;
     mCachedElementActor = nullptr;
 
 #if defined(OS_WIN)
     SharedSurfaceRelease();
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -64,32 +64,32 @@ PluginInstanceParent::PluginInstancePare
                                            const nsCString& aMimeType,
                                            const NPNetscapeFuncs* npniface)
   : mParent(parent)
     , mNPP(npp)
     , mNPNIface(npniface)
     , mWindowType(NPWindowTypeWindow)
     , mDrawingModel(kDefaultDrawingModel)
 #if defined(OS_WIN)
-    , mPluginHWND(NULL)
-    , mPluginWndProc(NULL)
+    , mPluginHWND(nullptr)
+    , mPluginWndProc(nullptr)
     , mNestedEventState(false)
 #endif // defined(XP_WIN)
 #if defined(XP_MACOSX)
     , mShWidth(0)
     , mShHeight(0)
     , mShColorSpace(nullptr)
 #endif
 {
 }
 
 PluginInstanceParent::~PluginInstanceParent()
 {
     if (mNPP)
-        mNPP->pdata = NULL;
+        mNPP->pdata = nullptr;
 
 #if defined(OS_WIN)
     NS_ASSERTION(!(mPluginHWND || mPluginWndProc),
         "Subclass was not reset correctly before the dtor was reached!");
 #endif
 #if defined(MOZ_WIDGET_COCOA)
     if (mShWidth != 0 && mShHeight != 0) {
         DeallocShmem(mShSurface);
@@ -122,17 +122,17 @@ PluginInstanceParent::ActorDestroy(Actor
         SharedSurfaceRelease();
         UnsubclassPluginWindow();
     }
 #endif
     // After this method, the data backing the remote surface may no
     // longer be valid. The X surface may be destroyed, or the shared
     // memory backing this surface may no longer be valid.
     if (mFrontSurface) {
-        mFrontSurface = NULL;
+        mFrontSurface = nullptr;
         if (mImageContainer) {
             mImageContainer->SetCurrentImage(nullptr);
         }
 #ifdef MOZ_X11
         FinishX(DefaultXDisplay());
 #endif
     }
 }
@@ -159,17 +159,17 @@ PluginInstanceParent::AllocPBrowserStrea
                                                 PStreamNotifyParent* notifyData,
                                                 const nsCString& headers,
                                                 const nsCString& mimeType,
                                                 const bool& seekable,
                                                 NPError* rv,
                                                 uint16_t *stype)
 {
     NS_RUNTIMEABORT("Not reachable");
-    return NULL;
+    return nullptr;
 }
 
 bool
 PluginInstanceParent::DeallocPBrowserStreamParent(PBrowserStreamParent* stream)
 {
     delete stream;
     return true;
 }
@@ -422,17 +422,17 @@ PluginInstanceParent::AnswerNPN_SetValue
                                       (void*)(intptr_t)drawingModel);
 
         if (mRemoteImageDataShmem.IsWritable()) {
             if (mImageContainer) {
                 mImageContainer->SetRemoteImageData(nullptr, nullptr);
                 mImageContainer->SetCompositionNotifySink(nullptr);
             }
             DeallocShmem(mRemoteImageDataShmem);
-            mRemoteImageDataMutex = NULL;
+            mRemoteImageDataMutex = nullptr;
         }
     } else {
         *result = NPERR_GENERIC_ERROR;
     }
     return true;
 }
 
 bool
@@ -680,17 +680,17 @@ PluginInstanceParent::AsyncSetWindow(NPW
 
     return NS_OK;
 }
 
 nsresult
 PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
 {
 #ifdef XP_MACOSX
-    MacIOSurface* ioSurface = NULL;
+    MacIOSurface* ioSurface = nullptr;
   
     if (mFrontIOSurface) {
       ioSurface = mFrontIOSurface;
     } else if (mIOSurface) {
       ioSurface = mIOSurface;
     }
 
     if (!mFrontSurface && !ioSurface)
@@ -1581,17 +1581,17 @@ PPluginSurfaceParent*
 PluginInstanceParent::AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
                                                 const gfxIntSize& size,
                                                 const bool& transparent)
 {
 #ifdef XP_WIN
     return new PluginSurfaceParent(handle, size, transparent);
 #else
     NS_ERROR("This shouldn't be called!");
-    return NULL;
+    return nullptr;
 #endif
 }
 
 bool
 PluginInstanceParent::DeallocPPluginSurfaceParent(PPluginSurfaceParent* s)
 {
 #ifdef XP_WIN
     delete s;
@@ -1720,17 +1720,17 @@ PluginInstanceParent::AnswerNPN_InitAsyn
     case NPDrawingModelAsyncWindowsDXGISurface: {
             ID3D10Device1 *device = gfxWindowsPlatform::GetPlatform()->GetD3D10Device();
 
             nsRefPtr<ID3D10Texture2D> texture;
             
             CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, size.width, size.height, 1, 1);
             desc.MiscFlags = D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX;
             desc.BindFlags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
-            if (FAILED(device->CreateTexture2D(&desc, NULL, getter_AddRefs(texture)))) {
+            if (FAILED(device->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture)))) {
                 *result = false;
                 return true;
             }
 
             nsRefPtr<IDXGIResource> resource;
             if (FAILED(texture->QueryInterface(IID_IDXGIResource, getter_AddRefs(resource)))) {
                 *result = false;
                 return true;
@@ -1867,18 +1867,18 @@ void
 PluginInstanceParent::UnsubclassPluginWindow()
 {
     if (mPluginHWND && mPluginWndProc) {
         ::SetWindowLongPtrA(mPluginHWND, GWLP_WNDPROC,
                             reinterpret_cast<LONG_PTR>(mPluginWndProc));
 
         ::RemovePropW(mPluginHWND, kPluginInstanceParentProperty);
 
-        mPluginWndProc = NULL;
-        mPluginHWND = NULL;
+        mPluginWndProc = nullptr;
+        mPluginHWND = nullptr;
     }
 }
 
 /* windowless drawing helpers */
 
 /*
  * Origin info:
  *
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -227,34 +227,34 @@ inline void AssertPluginThread()
       NS_WARNING("Not running on the plugin's main thread!"); \
       return; \
     } \
   PR_END_MACRO
 
 void DeferNPObjectLastRelease(const NPNetscapeFuncs* f, NPObject* o);
 void DeferNPVariantLastRelease(const NPNetscapeFuncs* f, NPVariant* v);
 
-// in NPAPI, char* == NULL is sometimes meaningful.  the following is
+// in NPAPI, char* == nullptr is sometimes meaningful.  the following is
 // helper code for dealing with nullable nsCString's
 inline nsCString
 NullableString(const char* aString)
 {
     if (!aString) {
         nsCString str;
         str.SetIsVoid(true);
         return str;
     }
     return nsCString(aString);
 }
 
 inline const char*
 NullableStringGet(const nsCString& str)
 {
   if (str.IsVoid())
-    return NULL;
+    return nullptr;
 
   return str.get();
 }
 
 struct DeletingObjectEntry : public nsPtrHashKey<NPObject>
 {
   DeletingObjectEntry(const NPObject* key)
     : nsPtrHashKey<NPObject>(key)
@@ -494,22 +494,22 @@ struct ParamTraits<NPString>
 
 #ifdef XP_MACOSX
 template <>
 struct ParamTraits<NPNSString*>
 {
   typedef NPNSString* paramType;
 
   // Empty string writes a length of 0 and no buffer.
-  // We don't write a NULL terminating character in buffers.
+  // We don't write a nullptr terminating character in buffers.
   static void Write(Message* aMsg, const paramType& aParam)
   {
     CFStringRef cfString = (CFStringRef)aParam;
 
-    // Write true if we have a string, false represents NULL.
+    // Write true if we have a string, false represents nullptr.
     aMsg->WriteBool(!!cfString);
     if (!cfString) {
       return;
     }
 
     long length = ::CFStringGetLength(cfString);
     WriteParam(aMsg, length);
     if (length == 0) {
@@ -529,17 +529,17 @@ struct ParamTraits<NPNSString*>
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     bool haveString = false;
     if (!aMsg->ReadBool(aIter, &haveString)) {
       return false;
     }
     if (!haveString) {
-      *aResult = NULL;
+      *aResult = nullptr;
       return true;
     }
 
     long length;
     if (!ReadParam(aMsg, aIter, &length)) {
       return false;
     }
 
@@ -604,17 +604,17 @@ struct ParamTraits<NSCursorInfo>
       return false;
     }
 
     uint32_t dataLength;
     if (!ReadParam(aMsg, aIter, &dataLength)) {
       return false;
     }
 
-    uint8_t* data = NULL;
+    uint8_t* data = nullptr;
     if (dataLength != 0) {
       if (!aMsg->ReadBytes(aIter, (const char**)&data, dataLength) || !data) {
         return false;
       }
     }
 
     aResult->SetType(type);
     aResult->SetHotSpot(nsPoint(hotSpotX, hotSpotY));
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -79,36 +79,36 @@ static PRLibrary *sGtkLib = nullptr;
 #endif
 
 #ifdef XP_WIN
 // Used with fix for flash fullscreen window loosing focus.
 static bool gDelayFlashFocusReplyUntilEval = false;
 // Used to fix GetWindowInfo problems with internal flash settings dialogs
 static WindowsDllInterceptor sUser32Intercept;
 typedef BOOL (WINAPI *GetWindowInfoPtr)(HWND hwnd, PWINDOWINFO pwi);
-static GetWindowInfoPtr sGetWindowInfoPtrStub = NULL;
-static HWND sBrowserHwnd = NULL;
+static GetWindowInfoPtr sGetWindowInfoPtrStub = nullptr;
+static HWND sBrowserHwnd = nullptr;
 #endif
 
 PluginModuleChild::PluginModuleChild()
   : mLibrary(0)
   , mPluginFilename("")
   , mQuirks(QUIRKS_NOT_INITIALIZED)
   , mShutdownFunc(0)
   , mInitializeFunc(0)
 #if defined(OS_WIN) || defined(OS_MACOSX)
   , mGetEntryPointsFunc(0)
 #elif defined(MOZ_WIDGET_GTK)
   , mNestedLoopTimerId(0)
 #elif defined(MOZ_WIDGET_QT)
   , mNestedLoopTimerObject(0)
 #endif
 #ifdef OS_WIN
-  , mNestedEventHook(NULL)
-  , mGlobalCallWndProcHook(NULL)
+  , mNestedEventHook(nullptr)
+  , mGlobalCallWndProcHook(nullptr)
 #endif
 {
     NS_ASSERTION(!gInstance, "Something terribly wrong here!");
     memset(&mFunctions, 0, sizeof(mFunctions));
     memset(&mSavedData, 0, sizeof(mSavedData));
     gInstance = this;
     mUserAgent.SetIsVoid(true);
 #ifdef XP_MACOSX
@@ -254,19 +254,19 @@ wrap_gtk_plug_dispose(GObject* object) {
     // using g_object_unref instead of gtk_widget_destroy.  The
     // reference that Flash is removing actually belongs to the
     // GtkPlug.  During real_gtk_plug_dispose, the GtkPlug removes its
     // reference.
     //
     // A toggle ref is added to prevent premature deletion of the object
     // caused by Flash Player's extra unref, and to detect when there are
     // unexpectedly no other references.
-    g_object_add_toggle_ref(object, undo_bogus_unref, NULL);
+    g_object_add_toggle_ref(object, undo_bogus_unref, nullptr);
     (*real_gtk_plug_dispose)(object);
-    g_object_remove_toggle_ref(object, undo_bogus_unref, NULL);
+    g_object_remove_toggle_ref(object, undo_bogus_unref, nullptr);
 }
 
 static gboolean
 gtk_plug_scroll_event(GtkWidget *widget, GdkEventScroll *gdk_event)
 {
     if (!gtk_widget_is_toplevel(widget)) // in same process as its GtkSocket
         return FALSE; // event not handled; propagate to GtkSocket
 
@@ -349,17 +349,17 @@ gtk_plug_scroll_event(GtkWidget *widget,
 
     return TRUE; // event handled
 }
 
 static void
 wrap_gtk_plug_embedded(GtkPlug* plug) {
     GdkWindow* socket_window = gtk_plug_get_socket_window(plug);
     if (socket_window) {
-        if (gtk_check_version(2,18,7) != NULL // older
+        if (gtk_check_version(2,18,7) != nullptr // older
             && g_object_get_data(G_OBJECT(socket_window),
                                  "moz-existed-before-set-window")) {
             // Add missing reference for
             // https://bugzilla.gnome.org/show_bug.cgi?id=607061
             g_object_ref(socket_window);
         }
 
         // Ensure the window exists to make this GtkPlug behave like an
@@ -400,17 +400,17 @@ PluginModuleChild::DetectNestedEventLoop
     // just detected a nested loop; start a timer that will
     // periodically rpc-call back into the browser and process some
     // events
     pmc->mNestedLoopTimerId =
         g_timeout_add_full(kBrowserEventPriority,
                            kBrowserEventIntervalMs,
                            PluginModuleChild::ProcessBrowserEvents,
                            data,
-                           NULL);
+                           nullptr);
     // cancel the nested-loop detection timer
     return FALSE;
 }
 
 // static
 gboolean
 PluginModuleChild::ProcessBrowserEvents(gpointer data)
 {
@@ -430,17 +430,17 @@ PluginModuleChild::EnteredCxxStack()
     NS_ABORT_IF_FALSE(0 == mNestedLoopTimerId,
                       "previous timer not descheduled");
 
     mNestedLoopTimerId =
         g_timeout_add_full(kNestedLoopDetectorPriority,
                            kNestedLoopDetectorIntervalMs,
                            PluginModuleChild::DetectNestedEventLoop,
                            this,
-                           NULL);
+                           nullptr);
 
 #ifdef DEBUG
     mTopLoopDepth = g_main_depth();
 #endif
 }
 
 void
 PluginModuleChild::ExitedCxxStack()
@@ -451,30 +451,30 @@ PluginModuleChild::ExitedCxxStack()
     g_source_remove(mNestedLoopTimerId);
     mNestedLoopTimerId = 0;
 }
 #elif defined (MOZ_WIDGET_QT)
 
 void
 PluginModuleChild::EnteredCxxStack()
 {
-    NS_ABORT_IF_FALSE(mNestedLoopTimerObject == NULL,
+    NS_ABORT_IF_FALSE(mNestedLoopTimerObject == nullptr,
                       "previous timer not descheduled");
     mNestedLoopTimerObject = new NestedLoopTimer(this);
     QTimer::singleShot(kNestedLoopDetectorIntervalMs,
                        mNestedLoopTimerObject, SLOT(timeOut()));
 }
 
 void
 PluginModuleChild::ExitedCxxStack()
 {
-    NS_ABORT_IF_FALSE(mNestedLoopTimerObject != NULL,
+    NS_ABORT_IF_FALSE(mNestedLoopTimerObject != nullptr,
                       "nested loop timeout not scheduled");
     delete mNestedLoopTimerObject;
-    mNestedLoopTimerObject = NULL;
+    mNestedLoopTimerObject = nullptr;
 }
 
 #endif
 
 bool
 PluginModuleChild::RecvSetParentHangTimeout(const uint32_t& aSeconds)
 {
 #ifdef XP_WIN
@@ -707,17 +707,17 @@ void
 PluginModuleChild::CleanUp()
 {
 }
 
 const char*
 PluginModuleChild::GetUserAgent()
 {
     if (mUserAgent.IsVoid() && !CallNPN_UserAgent(&mUserAgent))
-        return NULL;
+        return nullptr;
 
     return NullableStringGet(mUserAgent);
 }
 
 bool
 PluginModuleChild::RegisterActorForNPObject(NPObject* aObject,
                                             PluginScriptableObjectChild* aActor)
 {
@@ -738,30 +738,30 @@ void
 PluginModuleChild::UnregisterActorForNPObject(NPObject* aObject)
 {
     AssertPluginThread();
     NS_ASSERTION(aObject, "Null pointer!");
 
     NPObjectData* d = mObjectMap.GetEntry(aObject);
     NS_ASSERTION(d, "NPObject not in object table");
     if (d) {
-        d->actor = NULL;
+        d->actor = nullptr;
     }
 }
 
 PluginScriptableObjectChild*
 PluginModuleChild::GetActorForNPObject(NPObject* aObject)
 {
     AssertPluginThread();
     NS_ASSERTION(aObject, "Null pointer!");
 
     NPObjectData* d = mObjectMap.GetEntry(aObject);
     if (!d) {
         NS_ERROR("Plugin using object not created with NPN_CreateObject?");
-        return NULL;
+        return nullptr;
     }
 
     return d->actor;
 }
 
 #ifdef DEBUG
 bool
 PluginModuleChild::NPObjectIsRegistered(NPObject* aObject)
@@ -995,18 +995,18 @@ const NPNetscapeFuncs PluginModuleChild:
     mozilla::plugins::child::_construct,
     mozilla::plugins::child::_getvalueforurl,
     mozilla::plugins::child::_setvalueforurl,
     mozilla::plugins::child::_getauthenticationinfo,
     mozilla::plugins::child::_scheduletimer,
     mozilla::plugins::child::_unscheduletimer,
     mozilla::plugins::child::_popupcontextmenu,
     mozilla::plugins::child::_convertpoint,
-    NULL, // handleevent, unimplemented
-    NULL, // unfocusinstance, unimplemented
+    nullptr, // handleevent, unimplemented
+    nullptr, // unfocusinstance, unimplemented
     mozilla::plugins::child::_urlredirectresponse,
     mozilla::plugins::child::_initasyncsurface,
     mozilla::plugins::child::_finalizeasyncsurface,
     mozilla::plugins::child::_setcurrentasyncsurface
 };
 
 PluginInstanceChild*
 InstCast(NPP aNPP)
@@ -1036,17 +1036,17 @@ NPError NP_CALLBACK
 _geturlnotify(NPP aNPP,
               const char* aRelativeURL,
               const char* aTarget,
               void* aNotifyData)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
 
-    if (!aNPP) // NULL check for nspluginwrapper (bug 561690)
+    if (!aNPP) // nullptr check for nspluginwrapper (bug 561690)
         return NPERR_INVALID_INSTANCE_ERROR;
 
     nsCString url = NullableString(aRelativeURL);
     StreamNotifyChild* sn = new StreamNotifyChild(url);
 
     NPError err;
     InstCast(aNPP)->CallPStreamNotifyConstructor(
         sn, url, NullableString(aTarget), false, nsCString(), false, &err);
@@ -1279,17 +1279,17 @@ void NP_CALLBACK
 }
 
 void NP_CALLBACK
 _invalidaterect(NPP aNPP,
                 NPRect* aInvalidRect)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD_VOID();
-    // NULL check for nspluginwrapper (bug 548434)
+    // nullptr check for nspluginwrapper (bug 548434)
     if (aNPP) {
         InstCast(aNPP)->InvalidateRect(aInvalidRect);
     }
 }
 
 void NP_CALLBACK
 _invalidateregion(NPP aNPP,
                   NPRegion aInvalidRegion)
@@ -1541,17 +1541,17 @@ void NP_CALLBACK
 void NP_CALLBACK
 _setexception(NPObject* aNPObj,
               const NPUTF8* aMessage)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD_VOID();
 
     PluginModuleChild* self = PluginModuleChild::current();
-    PluginScriptableObjectChild* actor = NULL;
+    PluginScriptableObjectChild* actor = nullptr;
     if (aNPObj) {
         actor = self->GetActorForNPObject(aNPObj);
         if (!actor) {
             NS_ERROR("Failed to get actor!");
             return;
         }
     }
 
@@ -2081,17 +2081,17 @@ NPObject* NP_CALLBACK
 PluginModuleChild::NPN_CreateObject(NPP aNPP, NPClass* aClass)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD(nullptr);
 
     PluginInstanceChild* i = InstCast(aNPP);
     if (i->mDeletingHash) {
         NS_ERROR("Plugin used NPP after NPP_Destroy");
-        return NULL;
+        return nullptr;
     }
 
     NPObject* newObject;
     if (aClass && aClass->allocate) {
         newObject = aClass->allocate(aNPP, aClass);
     }
     else {
         newObject = reinterpret_cast<NPObject*>(child::_memalloc(sizeof(NPObject)));
@@ -2131,17 +2131,17 @@ PluginModuleChild::NPN_ReleaseObject(NPO
     AssertPluginThread();
 
     NPObjectData* d = current()->mObjectMap.GetEntry(aNPObj);
     if (!d) {
         NS_ERROR("Releasing object not in mObjectMap?");
         return;
     }
 
-    DeletingObjectEntry* doe = NULL;
+    DeletingObjectEntry* doe = nullptr;
     if (d->instance->mDeletingHash) {
         doe = d->instance->mDeletingHash->GetEntry(aNPObj);
         if (!doe) {
             NS_ERROR("An object for a destroyed instance isn't in the instance deletion hash");
             return;
         }
         if (doe->mDeleted)
             return;
@@ -2319,33 +2319,33 @@ PluginModuleChild::ExitedCall()
 }
 
 LRESULT CALLBACK
 PluginModuleChild::CallWindowProcHook(int nCode, WPARAM wParam, LPARAM lParam)
 {
     // Trap and reply to anything we recognize as the source of a
     // potential send message deadlock.
     if (nCode >= 0 &&
-        (InSendMessageEx(NULL)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
+        (InSendMessageEx(nullptr)&(ISMEX_REPLIED|ISMEX_SEND)) == ISMEX_SEND) {
         CWPSTRUCT* pCwp = reinterpret_cast<CWPSTRUCT*>(lParam);
         if (pCwp->message == WM_KILLFOCUS) {
             // Fix for flash fullscreen window loosing focus. On single
             // core systems, sync killfocus events need to be handled
             // after the flash fullscreen window procedure processes this
             // message, otherwise fullscreen focus will not work correctly.
             PRUnichar szClass[26];
             if (GetClassNameW(pCwp->hwnd, szClass,
                               sizeof(szClass)/sizeof(PRUnichar)) &&
                 !wcscmp(szClass, kFlashFullscreenClass)) {
                 gDelayFlashFocusReplyUntilEval = true;
             }
         }
     }
 
-    return CallNextHookEx(NULL, nCode, wParam, lParam);
+    return CallNextHookEx(nullptr, nCode, wParam, lParam);
 }
 
 LRESULT CALLBACK
 PluginModuleChild::NestedInputEventHook(int nCode, WPARAM wParam, LPARAM lParam)
 {
     PluginModuleChild* self = current();
     uint32_t len = self->mIncallPumpingStack.Length();
     if (nCode >= 0 && len && !self->mIncallPumpingStack[len - 1]._spinning) {
@@ -2353,53 +2353,53 @@ PluginModuleChild::NestedInputEventHook(
         self->SendProcessNativeEventsInInterruptCall();
         IncallFrame& f = self->mIncallPumpingStack[len - 1];
         f._spinning = true;
         f._savedNestableTasksAllowed = loop->NestableTasksAllowed();
         loop->SetNestableTasksAllowed(true);
         loop->set_os_modal_loop(true);
     }
 
-    return CallNextHookEx(NULL, nCode, wParam, lParam);
+    return CallNextHookEx(nullptr, nCode, wParam, lParam);
 }
 
 void
 PluginModuleChild::SetEventHooks()
 {
     NS_ASSERTION(!mNestedEventHook,
         "mNestedEventHook already setup in call to SetNestedInputEventHook?");
     NS_ASSERTION(!mGlobalCallWndProcHook,
         "mGlobalCallWndProcHook already setup in call to CallWindowProcHook?");
 
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 
     // WH_MSGFILTER event hook for detecting modal loops in the child.
     mNestedEventHook = SetWindowsHookEx(WH_MSGFILTER,
                                         NestedInputEventHook,
-                                        NULL,
+                                        nullptr,
                                         GetCurrentThreadId());
 
     // WH_CALLWNDPROC event hook for trapping sync messages sent from
     // parent that can cause deadlocks.
     mGlobalCallWndProcHook = SetWindowsHookEx(WH_CALLWNDPROC,
                                               CallWindowProcHook,
-                                              NULL,
+                                              nullptr,
                                               GetCurrentThreadId());
 }
 
 void
 PluginModuleChild::ResetEventHooks()
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
     if (mNestedEventHook)
         UnhookWindowsHookEx(mNestedEventHook);
-    mNestedEventHook = NULL;
+    mNestedEventHook = nullptr;
     if (mGlobalCallWndProcHook)
         UnhookWindowsHookEx(mGlobalCallWndProcHook);
-    mGlobalCallWndProcHook = NULL;
+    mGlobalCallWndProcHook = nullptr;
 }
 #endif
 
 bool
 PluginModuleChild::RecvProcessNativeEventsInInterruptCall()
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 #if defined(OS_WIN)
@@ -2417,17 +2417,17 @@ void
 PluginModuleChild::ProcessNativeEvents() {
     CallProcessSomeEvents();    
 }
 #endif
 
 bool
 PluginModuleChild::AnswerGeckoGetProfile(nsCString* aProfile) {
     char* profile = profiler_get_profile();
-    if (profile != NULL) {
+    if (profile != nullptr) {
         *aProfile = nsCString(profile, strlen(profile));
         free(profile);
     } else {
         *aProfile = nsCString("", 0);
     }
     return true;
 }
 
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -379,24 +379,24 @@ private:
 #elif defined (MOZ_WIDGET_QT)
     NestedLoopTimer *mNestedLoopTimerObject;
 #endif
 
     struct NPObjectData : public nsPtrHashKey<NPObject>
     {
         NPObjectData(const NPObject* key)
             : nsPtrHashKey<NPObject>(key)
-            , instance(NULL)
-            , actor(NULL)
+            , instance(nullptr)
+            , actor(nullptr)
         { }
 
-        // never NULL
+        // never nullptr
         PluginInstanceChild* instance;
 
-        // sometimes NULL (no actor associated with an NPObject)
+        // sometimes nullptr (no actor associated with an NPObject)
         PluginScriptableObjectChild* actor;
     };
     /**
      * mObjectMap contains all the currently active NPObjects (from NPN_CreateObject until the
      * final release/dealloc, whether or not an actor is currently associated with the object.
      */
     nsTHashtable<NPObjectData> mObjectMap;
 
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -117,18 +117,18 @@ PluginModuleParent::LoadModule(const cha
 }
 
 
 PluginModuleParent::PluginModuleParent(const char* aFilePath)
     : mSubprocess(new PluginProcessParent(aFilePath))
     , mShutdown(false)
     , mClearSiteDataSupported(false)
     , mGetSitesWithDataSupported(false)
-    , mNPNIface(NULL)
-    , mPlugin(NULL)
+    , mNPNIface(nullptr)
+    , mPlugin(nullptr)
     , mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
 #ifdef XP_WIN
     , mPluginCpuUsageOnHang()
     , mHangUIParent(nullptr)
     , mHangUIEnabled(true)
     , mIsTimerReset(true)
 #endif
 #ifdef MOZ_CRASHREPORTER_INJECTOR
@@ -749,17 +749,17 @@ PluginModuleParent::NotifyPluginCrashed(
 
 PPluginIdentifierParent*
 PluginModuleParent::AllocPPluginIdentifierParent(const nsCString& aString,
                                                  const int32_t& aInt,
                                                  const bool& aTemporary)
 {
     if (aTemporary) {
         NS_ERROR("Plugins don't create temporary identifiers.");
-        return NULL; // should abort the plugin
+        return nullptr; // should abort the plugin
     }
 
     NPIdentifier npident = aString.IsVoid() ?
         mozilla::plugins::parent::_getintidentifier(aInt) :
         mozilla::plugins::parent::_getstringidentifier(aString.get());
 
     if (!npident) {
         NS_WARNING("Failed to get identifier!");
@@ -781,17 +781,17 @@ PluginModuleParent::DeallocPPluginIdenti
 PPluginInstanceParent*
 PluginModuleParent::AllocPPluginInstanceParent(const nsCString& aMimeType,
                                                const uint16_t& aMode,
                                                const InfallibleTArray<nsCString>& aNames,
                                                const InfallibleTArray<nsCString>& aValues,
                                                NPError* rv)
 {
     NS_ERROR("Not reachable!");
-    return NULL;
+    return nullptr;
 }
 
 bool
 PluginModuleParent::DeallocPPluginInstanceParent(PPluginInstanceParent* aActor)
 {
     PLUGIN_LOG_DEBUG_METHOD;
     delete aActor;
     return true;
@@ -799,35 +799,35 @@ PluginModuleParent::DeallocPPluginInstan
 
 void
 PluginModuleParent::SetPluginFuncs(NPPluginFuncs* aFuncs)
 {
     aFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
     aFuncs->javaClass = nullptr;
 
     // Gecko should always call these functions through a PluginLibrary object.
-    aFuncs->newp = NULL;
-    aFuncs->clearsitedata = NULL;
-    aFuncs->getsiteswithdata = NULL;
+    aFuncs->newp = nullptr;
+    aFuncs->clearsitedata = nullptr;
+    aFuncs->getsiteswithdata = nullptr;
 
     aFuncs->destroy = NPP_Destroy;
     aFuncs->setwindow = NPP_SetWindow;
     aFuncs->newstream = NPP_NewStream;
     aFuncs->destroystream = NPP_DestroyStream;
     aFuncs->asfile = NPP_StreamAsFile;
     aFuncs->writeready = NPP_WriteReady;
     aFuncs->write = NPP_Write;
     aFuncs->print = NPP_Print;
     aFuncs->event = NPP_HandleEvent;
     aFuncs->urlnotify = NPP_URLNotify;
     aFuncs->getvalue = NPP_GetValue;
     aFuncs->setvalue = NPP_SetValue;
-    aFuncs->gotfocus = NULL;
-    aFuncs->lostfocus = NULL;
-    aFuncs->urlredirectnotify = NULL;
+    aFuncs->gotfocus = nullptr;
+    aFuncs->lostfocus = nullptr;
+    aFuncs->urlredirectnotify = nullptr;
 
     // Provide 'NPP_URLRedirectNotify', 'NPP_ClearSiteData', and
     // 'NPP_GetSitesWithData' functionality if it is supported by the plugin.
     bool urlRedirectSupported = false;
     unused << CallOptionalFunctionsSupported(&urlRedirectSupported,
                                              &mClearSiteDataSupported,
                                              &mGetSitesWithDataSupported);
     if (urlRedirectSupported) {
@@ -1057,33 +1057,33 @@ PluginModuleParent::GetIdentifierForNPId
 
 PluginInstanceParent*
 PluginModuleParent::InstCast(NPP instance)
 {
     PluginInstanceParent* ip =
         static_cast<PluginInstanceParent*>(instance->pdata);
 
     // If the plugin crashed and the PluginInstanceParent was deleted,
-    // instance->pdata will be NULL.
+    // instance->pdata will be nullptr.
     if (!ip)
-        return NULL;
+        return nullptr;
 
     if (instance != ip->mNPP) {
         NS_RUNTIMEABORT("Corrupted plugin data.");
     }
     return ip;
 }
 
 BrowserStreamParent*
 PluginModuleParent::StreamCast(NPP instance,
                                NPStream* s)
 {
     PluginInstanceParent* ip = InstCast(instance);
     if (!ip)
-        return NULL;
+        return nullptr;
 
     BrowserStreamParent* sp =
         static_cast<BrowserStreamParent*>(static_cast<AStream*>(s->pdata));
     if (sp->mNPP != ip || s != sp->mStream) {
         NS_RUNTIMEABORT("Corrupted plugin stream data.");
     }
     return sp;
 }
@@ -1274,17 +1274,17 @@ PluginModuleParent::NP_GetValue(void *fu
 #if defined(XP_WIN) || defined(XP_MACOSX) || defined(XP_OS2)
 nsresult
 PluginModuleParent::NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error)
 {
     NS_ASSERTION(pFuncs, "Null pointer!");
 
     // We need to have the child process update its function table
     // here by actually calling NP_GetEntryPoints since the parent's
-    // function table can reflect NULL entries in the child's table.
+    // function table can reflect nullptr entries in the child's table.
     if (!CallNP_GetEntryPoints(error)) {
         return NS_ERROR_FAILURE;
     }
     else if (*error != NPERR_NO_ERROR) {
         return NS_OK;
     }
 
     SetPluginFuncs(pFuncs);
@@ -1451,17 +1451,17 @@ static const int kMaxChancesToProcessEve
 
 bool
 PluginModuleParent::AnswerProcessSomeEvents()
 {
     PLUGIN_LOG_DEBUG(("Spinning mini nested loop ..."));
 
     int i = 0;
     for (; i < kMaxChancesToProcessEvents; ++i)
-        if (!g_main_context_iteration(NULL, FALSE))
+        if (!g_main_context_iteration(nullptr, FALSE))
             break;
 
     PLUGIN_LOG_DEBUG(("... quitting mini nested loop; processed %i tasks", i));
 
     return true;
 }
 #endif
 
@@ -1611,17 +1611,17 @@ PluginModuleParent::RecvGetNativeCursors
 }
 
 bool
 PluginModuleParent::RecvNPN_SetException(PPluginScriptableObjectParent* aActor,
                                          const nsCString& aMessage)
 {
     PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
 
-    NPObject* aNPObj = NULL;
+    NPObject* aNPObj = nullptr;
     if (aActor) {
         aNPObj = static_cast<PluginScriptableObjectParent*>(aActor)->GetObject(true);
         if (!aNPObj) {
             NS_ERROR("Failed to get object!");
             return false;
         }
     }
     mozilla::plugins::parent::_setexception(aNPObj, NullableStringGet(aMessage));
--- a/dom/plugins/ipc/PluginProcessChild.cpp
+++ b/dom/plugins/ipc/PluginProcessChild.cpp
@@ -76,17 +76,17 @@ PluginProcessChild::Init()
             PR_SetEnv(setInterposePtr);
         }
     }
 #endif
 
 #ifdef XP_WIN
     // Drag-and-drop needs OleInitialize to be called, and Silverlight depends
     // on the host calling CoInitialize (which is called by OleInitialize).
-    ::OleInitialize(NULL);
+    ::OleInitialize(nullptr);
 #endif
 
     // Certain plugins, such as flash, steal the unhandled exception filter
     // thus we never get crash reports when they fault. This call fixes it.
     message_loop()->set_exception_restoration(true);
 
     std::string pluginFilename;
 
--- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp
@@ -581,17 +581,17 @@ PluginScriptableObjectChild::DropNPObjec
 }
 
 void
 PluginScriptableObjectChild::NPObjectDestroyed()
 {
   NS_ASSERTION(LocalObject == mType,
                "ScriptableDeallocate should have handled this for proxies");
   mInvalidated = true;
-  mObject = NULL;
+  mObject = nullptr;
 }
 
 bool
 PluginScriptableObjectChild::AnswerInvalidate()
 {
   AssertPluginThread();
 
   if (mInvalidated) {
--- a/dom/plugins/ipc/PluginScriptableObjectChild.h
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.h
@@ -16,17 +16,17 @@ namespace plugins {
 
 class PluginInstanceChild;
 class PluginScriptableObjectChild;
 class PPluginIdentifierChild;
 
 struct ChildNPObject : NPObject
 {
   ChildNPObject()
-    : NPObject(), parent(NULL), invalidated(false)
+    : NPObject(), parent(nullptr), invalidated(false)
   {
     MOZ_COUNT_CTOR(ChildNPObject);
   }
 
   ~ChildNPObject()
   {
     MOZ_COUNT_DTOR(ChildNPObject);
   }
--- a/dom/plugins/ipc/PluginScriptableObjectParent.h
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.h
@@ -17,17 +17,17 @@ namespace plugins {
 
 class PluginInstanceParent;
 class PluginScriptableObjectParent;
 class PPluginIdentifierParent;
 
 struct ParentNPObject : NPObject
 {
   ParentNPObject()
-    : NPObject(), parent(NULL), invalidated(false) { }
+    : NPObject(), parent(nullptr), invalidated(false) { }
 
   // |parent| is always valid as long as the actor is alive. Once the actor is
   // destroyed this will be set to null.
   PluginScriptableObjectParent* parent;
   bool invalidated;
 };
 
 class PluginScriptableObjectParent : public PPluginScriptableObjectParent
--- a/dom/plugins/ipc/PluginStreamParent.cpp
+++ b/dom/plugins/ipc/PluginStreamParent.cpp
@@ -18,17 +18,17 @@ PluginStreamParent::PluginStreamParent(P
 {
   *result = mInstance->mNPNIface->newstream(mInstance->mNPP,
                                             const_cast<char*>(mimeType.get()),
                                             NullableStringGet(target),
                                             &mStream);
   if (*result == NPERR_NO_ERROR)
     mStream->pdata = static_cast<AStream*>(this);
   else
-    mStream = NULL;
+    mStream = nullptr;
 }
 
 bool
 PluginStreamParent::AnswerNPN_Write(const Buffer& data, int32_t* written)
 {
   if (mClosed) {
     *written = -1;
     return true;
--- a/dom/plugins/ipc/StreamNotifyChild.h
+++ b/dom/plugins/ipc/StreamNotifyChild.h
@@ -17,18 +17,18 @@ class BrowserStreamChild;
 class StreamNotifyChild : public PStreamNotifyChild
 {
   friend class PluginInstanceChild;
   friend class BrowserStreamChild;
 
 public:
   StreamNotifyChild(const nsCString& aURL)
     : mURL(aURL)
-    , mClosure(NULL)
-    , mBrowserStream(NULL)
+    , mClosure(nullptr)
+    , mBrowserStream(nullptr)
   { }
 
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   void SetValid(void* aClosure) {
     mClosure = aClosure;
   }
 
--- a/dom/plugins/ipc/StreamNotifyParent.h
+++ b/dom/plugins/ipc/StreamNotifyParent.h
@@ -12,31 +12,31 @@
 namespace mozilla {
 namespace plugins {
 
 class StreamNotifyParent : public PStreamNotifyParent
 {
   friend class PluginInstanceParent;
 
   StreamNotifyParent()
-    : mDestructionFlag(NULL)
+    : mDestructionFlag(nullptr)
   { }
   ~StreamNotifyParent() {
     if (mDestructionFlag)
       *mDestructionFlag = true;
   }
 
 public:
   // If we are destroyed within the call to NPN_GetURLNotify, notify the caller
   // so that we aren't destroyed again. see bug 536437.
   void SetDestructionFlag(bool* flag) {
     mDestructionFlag = flag;
   }
   void ClearDestructionFlag() {
-    mDestructionFlag = NULL;
+    mDestructionFlag = nullptr;
   }
 
 private:
   bool RecvRedirectNotifyResponse(const bool& allow);
 
   bool* mDestructionFlag;
 };
 
--- a/dom/plugins/ipc/hangui/MiniShmBase.h
+++ b/dom/plugins/ipc/hangui/MiniShmBase.h
@@ -219,17 +219,17 @@ protected:
     bool      mSucceeded;
   };
 
   MiniShmBase()
     : mObserver(nullptr),
       mWriteHeader(nullptr),
       mReadHeader(nullptr),
       mPayloadMaxLen(0),
-      mGuard(NULL),
+      mGuard(nullptr),
       mTimeout(INFINITE)
   {
   }
   virtual ~MiniShmBase()
   { }
 
   virtual void
   OnEvent()
--- a/dom/plugins/ipc/hangui/MiniShmChild.cpp
+++ b/dom/plugins/ipc/hangui/MiniShmChild.cpp
@@ -8,22 +8,22 @@
 
 #include <limits>
 #include <sstream>
 
 namespace mozilla {
 namespace plugins {
 
 MiniShmChild::MiniShmChild()
-  : mParentEvent(NULL),
-    mParentGuard(NULL),
-    mChildEvent(NULL),
-    mChildGuard(NULL),
-    mFileMapping(NULL),
-    mRegWait(NULL),
+  : mParentEvent(nullptr),
+    mParentGuard(nullptr),
+    mChildEvent(nullptr),
+    mChildGuard(nullptr),
+    mFileMapping(nullptr),
+    mRegWait(nullptr),
     mView(nullptr),
     mTimeout(INFINITE)
 {}
 
 MiniShmChild::~MiniShmChild()
 {
   if (mRegWait) {
     ::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
@@ -56,17 +56,17 @@ MiniShmChild::Init(MiniShmObserver* aObs
 {
   if (aCookie.empty() || !aTimeout) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   if (mFileMapping) {
     return NS_ERROR_ALREADY_INITIALIZED;
   }
   std::wistringstream iss(aCookie);
-  HANDLE mapHandle = NULL;
+  HANDLE mapHandle = nullptr;
   iss >> mapHandle;
   if (!iss) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   ScopedMappedFileView view(::MapViewOfFile(mapHandle,
                                             FILE_MAP_WRITE,
                                             0, 0, 0));
   if (!view.IsValid()) {
@@ -109,17 +109,17 @@ MiniShmChild::Init(MiniShmObserver* aObs
                                      WT_EXECUTEDEFAULT)) {
     return NS_ERROR_FAILURE;
   }
 
   MiniShmInitComplete* initCompleteStruct = nullptr;
   rv = GetWritePtrInternal(initCompleteStruct);
   if (NS_FAILED(rv)) {
     ::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
-    mRegWait = NULL;
+    mRegWait = nullptr;
     return NS_ERROR_FAILURE;
   }
 
   initCompleteStruct->mSucceeded = true;
 
   // We must set the member variables before we signal the event
   mFileMapping = mapHandle;
   mView = view.Take();
@@ -128,25 +128,25 @@ MiniShmChild::Init(MiniShmObserver* aObs
   mChildEvent = initStruct->mChildEvent;
   mChildGuard = initStruct->mChildGuard;
   SetObserver(aObserver);
   mTimeout = aTimeout;
 
   rv = Send();
   if (NS_FAILED(rv)) {
     initCompleteStruct->mSucceeded = false;
-    mFileMapping = NULL;
+    mFileMapping = nullptr;
     view.Set(mView);
     mView = nullptr;
-    mParentEvent = NULL;
-    mParentGuard = NULL;
-    mChildEvent = NULL;
-    mChildGuard = NULL;
+    mParentEvent = nullptr;
+    mParentGuard = nullptr;
+    mChildEvent = nullptr;
+    mChildGuard = nullptr;
     ::UnregisterWaitEx(mRegWait, INVALID_HANDLE_VALUE);
-    mRegWait = NULL;
+    mRegWait = nullptr;
     return rv;
   }
 
   OnConnect();
   return NS_OK;
 }
 
 nsresult
--- a/dom/plugins/ipc/hangui/PluginHangUIChild.cpp
+++ b/dom/plugins/ipc/hangui/PluginHangUIChild.cpp
@@ -35,21 +35,21 @@ struct WinInfo
 };
 typedef std::vector<WinInfo> WinInfoVec;
 
 PluginHangUIChild* PluginHangUIChild::sSelf = nullptr;
 const int PluginHangUIChild::kExpectedMinimumArgc = 10;
 
 PluginHangUIChild::PluginHangUIChild()
   : mResponseBits(0),
-    mParentWindow(NULL),
-    mDlgHandle(NULL),
-    mMainThread(NULL),
-    mParentProcess(NULL),
-    mRegWaitProcess(NULL),
+    mParentWindow(nullptr),
+    mDlgHandle(nullptr),
+    mMainThread(nullptr),
+    mParentProcess(nullptr),
+    mRegWaitProcess(nullptr),
     mIPCTimeoutMs(0)
 {
 }
 
 PluginHangUIChild::~PluginHangUIChild()
 {
   if (mMainThread) {
     CloseHandle(mMainThread);
@@ -220,17 +220,18 @@ PluginHangUIChild::ResizeButtons()
   if (!hwp) {
     return;
   }
   for (WinInfoVec::const_iterator itr = winInfo.begin();
        itr != winInfo.end(); ++itr) {
     // deltaX accumulates the size changes so that each button's x coordinate 
     // can compensate for the width increases
     deltaX += idealSize.cx - itr->size.cx;
-    hwp = DeferWindowPos(hwp, itr->hwnd, NULL, itr->pos.x - deltaX, itr->pos.y,
+    hwp = DeferWindowPos(hwp, itr->hwnd, nullptr,
+                         itr->pos.x - deltaX, itr->pos.y,
                          idealSize.cx, itr->size.cy,
                          SWP_NOZORDER | SWP_NOACTIVATE);
     if (!hwp) {
       return;
     }
   }
   EndDeferWindowPos(hwp);
 }
@@ -251,17 +252,17 @@ PluginHangUIChild::HangUIDlgProc(HWND aD
                                   INFINITE,
                                   WT_EXECUTEDEFAULT | WT_EXECUTEONLYONCE);
       SetWindowText(aDlgHandle, mWindowTitle);
       SetDlgItemText(aDlgHandle, IDC_MSG, mMessageText);
       SetDlgItemText(aDlgHandle, IDC_NOFUTURE, mNoFutureText);
       SetDlgItemText(aDlgHandle, IDC_CONTINUE, mWaitBtnText);
       SetDlgItemText(aDlgHandle, IDC_STOP, mKillBtnText);
       ResizeButtons();
-      HANDLE icon = LoadImage(NULL, IDI_QUESTION, IMAGE_ICON, 0, 0,
+      HANDLE icon = LoadImage(nullptr, IDI_QUESTION, IMAGE_ICON, 0, 0,
                               LR_DEFAULTSIZE | LR_SHARED);
       if (icon) {
         SendDlgItemMessage(aDlgHandle, IDC_DLGICON, STM_SETICON, (WPARAM)icon, 0);
       }
       EnableWindow(mParentWindow, FALSE);
       return TRUE;
     }
     case WM_CLOSE: {
@@ -331,21 +332,21 @@ PluginHangUIChild::RecvShow()
   return (QueueUserAPC(&ShowAPC,
                        mMainThread,
                        reinterpret_cast<ULONG_PTR>(this)));
 }
 
 bool
 PluginHangUIChild::Show()
 {
-  INT_PTR dlgResult = DialogBox(GetModuleHandle(NULL),
+  INT_PTR dlgResult = DialogBox(GetModuleHandle(nullptr),
                                 MAKEINTRESOURCE(IDD_HANGUIDLG),
-                                NULL,
+                                nullptr,
                                 &SHangUIDlgProc);
-  mDlgHandle = NULL;
+  mDlgHandle = nullptr;
   assert(dlgResult != -1);
   bool result = false;
   if (dlgResult != -1) {
     PluginHangUIResponse* response = nullptr;
     nsresult rv = mMiniShm.GetWritePtr(response);
     if (NS_SUCCEEDED(rv)) {
       response->mResponseBits = mResponseBits;
       result = NS_SUCCEEDED(mMiniShm.Send());
@@ -384,17 +385,17 @@ PluginHangUIChild::WaitForDismissal()
          waitResult == WAIT_IO_COMPLETION;
 }
 
 bool
 PluginHangUIChild::SetMainThread()
 {
   if (mMainThread) {
     CloseHandle(mMainThread);
-    mMainThread = NULL;
+    mMainThread = nullptr;
   }
   mMainThread = OpenThread(THREAD_SET_CONTEXT,
                            FALSE,
                            GetCurrentThreadId());
   return !(!mMainThread);
 }
 
 } // namespace plugins