Bug 1317241 - Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in dom/. r=baku
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Mon, 14 Nov 2016 11:35:58 +0200
changeset 367575 5b3a57978bd4270560d334dc08dec509643b4984
parent 367574 494c49290b534767cd0c15d98e981ea7de5caab8
child 367576 c1c955254a8c363c238e7b30dc79747c214f2f6b
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1317241
milestone53.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 1317241 - Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in dom/. r=baku MozReview-Commit-ID: CST7fV4h20h
dom/base/nsContentUtils.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsFrameMessageManager.cpp
dom/html/PluginDocument.cpp
dom/indexedDB/ActorsParent.cpp
dom/ipc/Blob.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ProcessHangMonitor.cpp
dom/media/gmp-plugin/gmp-test-decryptor.cpp
dom/media/gmp-plugin/gmp-test-storage.cpp
dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
dom/media/ipc/VideoDecoderManagerParent.cpp
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginModuleChild.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -6318,17 +6318,17 @@ nsContentUtils::DestroyClassNameArray(vo
 // static
 void*
 nsContentUtils::AllocClassMatchingInfo(nsINode* aRootNode,
                                        const nsString* aClasses)
 {
   nsAttrValue attrValue;
   attrValue.ParseAtomArray(*aClasses);
   // nsAttrValue::Equals is sensitive to order, so we'll send an array
-  ClassMatchingInfo* info = new ClassMatchingInfo;
+  auto* info = new ClassMatchingInfo;
   if (attrValue.Type() == nsAttrValue::eAtomArray) {
     info->mClasses.SwapElements(*(attrValue.GetAtomArrayValue()));
   } else if (attrValue.Type() == nsAttrValue::eAtom) {
     info->mClasses.AppendElement(attrValue.GetAtomValue());
   }
 
   info->mCaseTreatment =
     aRootNode->OwnerDoc()->GetCompatibilityMode() == eCompatibility_NavQuirks ?
@@ -9059,17 +9059,17 @@ StartElement(Element* aContent, StringBu
 
     // Filter out any attribute starting with [-|_]moz
     nsDependentAtomString attrNameStr(attName);
     if (StringBeginsWith(attrNameStr, NS_LITERAL_STRING("_moz")) ||
         StringBeginsWith(attrNameStr, NS_LITERAL_STRING("-moz"))) {
       continue;
     }
 
-    nsAutoString* attValue = new nsAutoString();
+    auto* attValue = new nsAutoString();
     aContent->GetAttr(attNs, attName, *attValue);
 
     // Filter out special case of <br type="_moz*"> used by the editor.
     // Bug 16988.  Yuck.
     if (localName == nsGkAtoms::br && tagNS == kNameSpaceID_XHTML &&
         attName == nsGkAtoms::type && attNs == kNameSpaceID_None &&
         StringBeginsWith(*attValue, NS_LITERAL_STRING("_moz"))) {
       delete attValue;
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2087,17 +2087,17 @@ nsDOMWindowUtils::SendQueryContentEvent(
       queryEvent.Init(options);
       break;
   }
 
   nsEventStatus status;
   nsresult rv = targetWidget->DispatchEvent(&queryEvent, status);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsQueryContentEventResult* result = new nsQueryContentEventResult();
+  auto* result = new nsQueryContentEventResult();
   result->SetEventResult(widget, queryEvent);
   NS_ADDREF(*aResult = result);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendSelectionSetEvent(uint32_t aOffset,
                                         uint32_t aLength,
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -1836,18 +1836,17 @@ nsMessageManagerScriptExecutor::TryCache
     MOZ_ASSERT(script);
     aScriptp.set(script);
 
     nsAutoCString scheme;
     uri->GetScheme(scheme);
     // We don't cache data: scripts!
     if (aShouldCache && !scheme.EqualsLiteral("data")) {
       // Root the object also for caching.
-      nsMessageManagerScriptHolder* holder =
-        new nsMessageManagerScriptHolder(cx, script, aRunInGlobalScope);
+      auto* holder = new nsMessageManagerScriptHolder(cx, script, aRunInGlobalScope);
       sCachedScripts->Put(aURL, holder);
     }
   }
 }
 
 void
 nsMessageManagerScriptExecutor::TryCacheLoadAndCompileScript(
   const nsAString& aURL,
@@ -2199,19 +2198,18 @@ NS_NewChildProcessMessageManager(nsISync
 
   MessageManagerCallback* cb;
   if (XRE_IsParentProcess()) {
     cb = new SameChildProcessMessageManagerCallback();
   } else {
     cb = new ChildProcessMessageManagerCallback();
     RegisterStrongMemoryReporter(new MessageManagerReporter());
   }
-  nsFrameMessageManager* mm = new nsFrameMessageManager(cb,
-                                                        nullptr,
-                                                        MM_PROCESSMANAGER | MM_OWNSCALLBACK);
+  auto* mm = new nsFrameMessageManager(cb, nullptr,
+                                       MM_PROCESSMANAGER | MM_OWNSCALLBACK);
   nsFrameMessageManager::SetChildProcessManager(mm);
   RefPtr<ProcessGlobal> global = new ProcessGlobal(mm);
   NS_ENSURE_TRUE(global->Init(), NS_ERROR_UNEXPECTED);
   global.forget(aResult);
   return NS_OK;
 }
 
 bool
--- a/dom/html/PluginDocument.cpp
+++ b/dom/html/PluginDocument.cpp
@@ -282,17 +282,17 @@ PluginDocument::Print()
 }
 
 } // namespace dom
 } // namespace mozilla
 
 nsresult
 NS_NewPluginDocument(nsIDocument** aResult)
 {
-  mozilla::dom::PluginDocument* doc = new mozilla::dom::PluginDocument();
+  auto* doc = new mozilla::dom::PluginDocument();
 
   NS_ADDREF(doc);
   nsresult rv = doc->Init();
 
   if (NS_FAILED(rv)) {
     NS_RELEASE(doc);
   }
 
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -12025,17 +12025,17 @@ ConnectionPool::Start(const nsID& aBackg
   if (databaseInfoIsNew) {
     dbInfo = new DatabaseInfo(this, aDatabaseId);
 
     MutexAutoLock lock(mDatabasesMutex);
 
     mDatabases.Put(aDatabaseId, dbInfo);
   }
 
-  TransactionInfo* transactionInfo =
+  auto* transactionInfo =
     new TransactionInfo(dbInfo,
                         aBackgroundChildLoggingId,
                         aDatabaseId,
                         transactionId,
                         aLoggingSerialNumber,
                         aObjectStoreNames,
                         aIsWriteTransaction,
                         aTransactionOp);
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -2658,17 +2658,17 @@ CreateStreamHelper::RunInternal(RemoteBl
 
     if (!NS_IsMainThread() && GetCurrentThreadWorkerPrivate()) {
       stream =
         new RemoteInputStream(actor, mRemoteBlobImpl, mStart, mLength);
     } else {
       stream = new RemoteInputStream(mRemoteBlobImpl, mStart, mLength);
     }
 
-    InputStreamChild* streamActor = new InputStreamChild(stream);
+    auto* streamActor = new InputStreamChild(stream);
     if (actor->SendPBlobStreamConstructor(streamActor, mStart, mLength)) {
       stream.swap(mInputStream);
     }
   }
 
   mRemoteBlobImpl = nullptr;
 
   if (aNotify) {
@@ -3498,17 +3498,17 @@ BlobChild::GetOrCreateFromImpl(ChildMana
       blobParams =
         FileBlobConstructorParams(name, contentType, path, length, modDate,
                                   aBlobImpl->IsDirectory(), blobData);
     } else {
       blobParams = NormalBlobConstructorParams(contentType, length, blobData);
     }
   }
 
-  BlobChild* actor = new BlobChild(aManager, aBlobImpl);
+  auto* actor = new BlobChild(aManager, aBlobImpl);
 
   ParentBlobConstructorParams params(blobParams);
 
   if (NS_WARN_IF(!aManager->SendPBlobConstructor(actor, params))) {
     return nullptr;
   }
 
   autoIPCStreams.Clear();
@@ -3559,17 +3559,17 @@ BlobChild::SendSliceConstructor(ChildMan
   AssertCorrectThreadForManager(aManager);
   MOZ_ASSERT(aManager);
   MOZ_ASSERT(aRemoteBlobSliceImpl);
   MOZ_ASSERT(aParams.blobParams().type() ==
                AnyBlobConstructorParams::TSlicedBlobConstructorParams);
 
   const nsID& id = aParams.blobParams().get_SlicedBlobConstructorParams().id();
 
-  BlobChild* newActor = new BlobChild(aManager, id, aRemoteBlobSliceImpl);
+  auto* newActor = new BlobChild(aManager, id, aRemoteBlobSliceImpl);
 
   if (aManager->SendPBlobConstructor(newActor, aParams)) {
     if (gProcessType != GeckoProcessType_Default || !NS_IsMainThread()) {
       newActor->SendWaitForSliceCreation();
     }
     return newActor;
   }
 
@@ -4059,17 +4059,17 @@ BlobParent::GetOrCreateFromImpl(ParentMa
 
   nsID id;
   MOZ_ALWAYS_SUCCEEDS(gUUIDGenerator->GenerateUUIDInPlace(&id));
 
   RefPtr<IDTableEntry> idTableEntry =
     IDTableEntry::GetOrCreate(id, ActorManagerProcessID(aManager), aBlobImpl);
   MOZ_ASSERT(idTableEntry);
 
-  BlobParent* actor = new BlobParent(aManager, idTableEntry);
+  auto* actor = new BlobParent(aManager, idTableEntry);
 
   ChildBlobConstructorParams params(id, blobParams);
   if (NS_WARN_IF(!aManager->SendPBlobConstructor(actor, params))) {
     return nullptr;
   }
 
   return actor;
 }
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -975,17 +975,17 @@ ContentChild::InitXPCOM()
 }
 
 PMemoryReportRequestChild*
 ContentChild::AllocPMemoryReportRequestChild(const uint32_t& aGeneration,
                                              const bool &aAnonymize,
                                              const bool &aMinimizeMemoryUsage,
                                              const MaybeFileDesc& aDMDFile)
 {
-  MemoryReportRequestChild *actor =
+  auto *actor =
     new MemoryReportRequestChild(aAnonymize, aDMDFile);
   actor->AddRef();
   return actor;
 }
 
 class HandleReportCallback final : public nsIHandleReportCallback
 {
 public:
@@ -1105,17 +1105,17 @@ ContentChild::DeallocPMemoryReportReques
   return true;
 }
 
 PCycleCollectWithLogsChild*
 ContentChild::AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces,
                                               const FileDescriptor& aGCLog,
                                               const FileDescriptor& aCCLog)
 {
-  CycleCollectWithLogsChild* actor = new CycleCollectWithLogsChild(aGCLog, aCCLog);
+  auto* actor = new CycleCollectWithLogsChild(aGCLog, aCCLog);
   // Return actor with refcount 0, which is safe because it has a non-XPCOM type.
   return actor;
 }
 
 bool
 ContentChild::RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aActor,
                                                    const bool& aDumpAllTraces,
                                                    const FileDescriptor& aGCLog,
@@ -1896,33 +1896,33 @@ ContentChild::AllocPExternalHelperAppChi
                                            const nsCString& aContentDisposition,
                                            const uint32_t& aContentDispositionHint,
                                            const nsString& aContentDispositionFilename,
                                            const bool& aForceSave,
                                            const int64_t& aContentLength,
                                            const OptionalURIParams& aReferrer,
                                            PBrowserChild* aBrowser)
 {
-  ExternalHelperAppChild *child = new ExternalHelperAppChild();
+  auto *child = new ExternalHelperAppChild();
   child->AddRef();
   return child;
 }
 
 bool
 ContentChild::DeallocPExternalHelperAppChild(PExternalHelperAppChild* aService)
 {
   ExternalHelperAppChild *child = static_cast<ExternalHelperAppChild*>(aService);
   child->Release();
   return true;
 }
 
 PHandlerServiceChild*
 ContentChild::AllocPHandlerServiceChild()
 {
-  HandlerServiceChild* actor = new HandlerServiceChild();
+  auto* actor = new HandlerServiceChild();
   actor->AddRef();
   return actor;
 }
 
 bool ContentChild::DeallocPHandlerServiceChild(PHandlerServiceChild* aHandlerServiceChild)
 {
   static_cast<HandlerServiceChild*>(aHandlerServiceChild)->Release();
   return true;
@@ -1975,17 +1975,17 @@ ContentChild::DeallocPSpeechSynthesisChi
   return false;
 #endif
 }
 
 PWebrtcGlobalChild *
 ContentChild::AllocPWebrtcGlobalChild()
 {
 #ifdef MOZ_WEBRTC
-  WebrtcGlobalChild *child = new WebrtcGlobalChild();
+  auto *child = new WebrtcGlobalChild();
   return child;
 #else
   return nullptr;
 #endif
 }
 
 bool
 ContentChild::DeallocPWebrtcGlobalChild(PWebrtcGlobalChild *aActor)
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -1180,19 +1180,19 @@ ProcessHangMonitor::NotifyPluginHang(uin
 PProcessHangMonitorParent*
 mozilla::CreateHangMonitorParent(ContentParent* aContentParent,
                                  mozilla::ipc::Transport* aTransport,
                                  base::ProcessId aOtherPid)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   ProcessHangMonitor* monitor = ProcessHangMonitor::GetOrCreate();
-  HangMonitorParent* parent = new HangMonitorParent(monitor);
+  auto* parent = new HangMonitorParent(monitor);
 
-  HangMonitoredProcess* process = new HangMonitoredProcess(parent, aContentParent);
+  auto* process = new HangMonitoredProcess(parent, aContentParent);
   parent->SetProcess(process);
 
   monitor->MonitorLoop()->PostTask(NewNonOwningRunnableMethod
                                    <mozilla::ipc::Transport*,
                                     base::ProcessId,
                                     MessageLoop*>(parent,
                                                   &HangMonitorParent::Open,
                                                   aTransport, aOtherPid,
@@ -1207,17 +1207,17 @@ mozilla::CreateHangMonitorChild(mozilla:
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   JSContext* cx = danger::GetJSContext();
   JS_AddInterruptCallback(cx, InterruptCallback);
   JS::AddGCInterruptCallback(cx, InterruptCallback);
 
   ProcessHangMonitor* monitor = ProcessHangMonitor::GetOrCreate();
-  HangMonitorChild* child = new HangMonitorChild(monitor);
+  auto* child = new HangMonitorChild(monitor);
 
   monitor->MonitorLoop()->PostTask(NewNonOwningRunnableMethod
                                    <mozilla::ipc::Transport*,
                                     base::ProcessId,
                                     MessageLoop*>(child,
                                                   &HangMonitorChild::Open,
                                                   aTransport, aOtherPid,
                                                   XRE_GetIOMessageLoop()));
--- a/dom/media/gmp-plugin/gmp-test-decryptor.cpp
+++ b/dom/media/gmp-plugin/gmp-test-decryptor.cpp
@@ -386,17 +386,17 @@ public:
 private:
   const string mPrefix;
   TestManager* const mTestManager;
 };
 
 void
 FakeDecryptor::TestStorage()
 {
-  TestManager* testManager = new TestManager();
+  auto* testManager = new TestManager();
   GMPThread* thread1 = nullptr;
   GMPThread* thread2 = nullptr;
 
   // Main thread tests.
   DoTestStorage("mt1-", testManager);
   DoTestStorage("mt2-", testManager);
 
   // Off-main-thread tests.
--- a/dom/media/gmp-plugin/gmp-test-storage.cpp
+++ b/dom/media/gmp-plugin/gmp-test-storage.cpp
@@ -63,17 +63,17 @@ private:
 GMPErr
 WriteRecord(const std::string& aRecordName,
             const uint8_t* aData,
             uint32_t aNumBytes,
             GMPTask* aOnSuccess,
             GMPTask* aOnFailure)
 {
   GMPRecord* record;
-  WriteRecordClient* client = new WriteRecordClient();
+  auto* client = new WriteRecordClient();
   auto err = GMPOpenRecord(aRecordName.c_str(),
                            aRecordName.size(),
                            &record,
                            client);
   if (GMP_FAILED(err)) {
     GMPRunOnMainThread(aOnFailure);
     aOnSuccess->Destroy();
     return err;
@@ -134,17 +134,17 @@ private:
 };
 
 GMPErr
 ReadRecord(const std::string& aRecordName,
            ReadContinuation* aContinuation)
 {
   MOZ_ASSERT(aContinuation);
   GMPRecord* record;
-  ReadRecordClient* client = new ReadRecordClient();
+  auto* client = new ReadRecordClient();
   auto err = GMPOpenRecord(aRecordName.c_str(),
                            aRecordName.size(),
                            &record,
                            client);
   if (GMP_FAILED(err)) {
     return err;
   }
   return client->Init(record, aContinuation);
--- a/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
@@ -99,17 +99,17 @@ WidevineAdapter::GMPGetAPI(const char* a
     auto create = reinterpret_cast<decltype(::CreateCdmInstance)*>(
       PR_FindFunctionSymbol(mLib, "CreateCdmInstance"));
     if (!create) {
       Log("WidevineAdapter::GMPGetAPI(%s, 0x%p, 0x%p, %u) this=0x%p FAILED to find CreateCdmInstance",
         aAPIName, aHostAPI, aPluginAPI, this, aDecryptorId);
       return GMPGenericErr;
     }
 
-    WidevineDecryptor* decryptor = new WidevineDecryptor();
+    auto* decryptor = new WidevineDecryptor();
 
     auto cdm = reinterpret_cast<cdm::ContentDecryptionModule*>(
       create(cdm::ContentDecryptionModule::kVersion,
              kEMEKeySystemWidevine.get(),
              kEMEKeySystemWidevine.Length(),
              &GetCdmHost,
              decryptor));
     if (!cdm) {
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -88,17 +88,17 @@ VideoDecoderManagerParent::StartupThread
   }), NS_DISPATCH_NORMAL);
 #endif
   sVideoDecoderManagerThread->Dispatch(NS_NewRunnableFunction([]() {
     layers::VideoBridgeChild::Startup();
   }), NS_DISPATCH_NORMAL);
 
   sManagerTaskQueue = new TaskQueue(managerThread.forget());
 
-  ManagerThreadShutdownObserver* obs = new ManagerThreadShutdownObserver();
+  auto* obs = new ManagerThreadShutdownObserver();
   observerService->AddObserver(obs, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
 }
 
 void
 VideoDecoderManagerParent::ShutdownThreads()
 {
   sManagerTaskQueue->BeginShutdown();
   sManagerTaskQueue->AwaitShutdownAndIdle();
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -824,17 +824,17 @@ NPError
   if (npp && npp->ndata) {
     nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance*)npp->ndata;
 
     PluginDestructionGuard guard(inst);
 
     nsCOMPtr<nsIOutputStream> stream;
     if (NS_SUCCEEDED(inst->NewStreamFromPlugin((const char*) type, target,
                                                getter_AddRefs(stream)))) {
-      nsNPAPIStreamWrapper* wrapper = new nsNPAPIStreamWrapper(stream, nullptr);
+      auto* wrapper = new nsNPAPIStreamWrapper(stream, nullptr);
       if (wrapper) {
         (*result) = &wrapper->mNPStream;
         err = NPERR_NO_ERROR;
       } else {
         err = NPERR_OUT_OF_MEMORY_ERROR;
       }
     } else {
       err = NPERR_GENERIC_ERROR;
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -3013,17 +3013,17 @@ PluginInstanceChild::GetActorForNPObject
 
 NPError
 PluginInstanceChild::NPN_NewStream(NPMIMEType aMIMEType, const char* aWindow,
                                    NPStream** aStream)
 {
     AssertPluginThread();
     AutoStackHelper guard(this);
 
-    PluginStreamChild* ps = new PluginStreamChild();
+    auto* ps = new PluginStreamChild();
 
     NPError result;
     CallPPluginStreamConstructor(ps, nsDependentCString(aMIMEType),
                                  NullableString(aWindow), &result);
     if (NPERR_NO_ERROR != result) {
         *aStream = nullptr;
         PPluginStreamChild::Call__delete__(ps, NPERR_GENERIC_ERROR, true);
         return result;
@@ -4384,17 +4384,17 @@ PluginInstanceChild::DeallocPPluginBackg
     delete aActor;
     return true;
 }
 
 uint32_t
 PluginInstanceChild::ScheduleTimer(uint32_t interval, bool repeat,
                                    TimerFunc func)
 {
-    ChildTimer* t = new ChildTimer(this, interval, repeat, func);
+    auto* t = new ChildTimer(this, interval, repeat, func);
     if (0 == t->ID()) {
         delete t;
         return 0;
     }
 
     mTimers.AppendElement(t);
     return t->ID();
 }
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -96,17 +96,17 @@ typedef SHORT (WINAPI *GetKeyStatePtr)(i
 static GetKeyStatePtr sGetKeyStatePtrStub = nullptr;
 #endif
 
 /* static */
 PluginModuleChild*
 PluginModuleChild::CreateForContentProcess(mozilla::ipc::Transport* aTransport,
                                            base::ProcessId aOtherPid)
 {
-    PluginModuleChild* child = new PluginModuleChild(false);
+    auto* child = new PluginModuleChild(false);
 
     if (!child->InitForContent(aOtherPid, XRE_GetIOMessageLoop(), aTransport)) {
         return nullptr;
     }
 
     return child;
 }
 
@@ -1071,17 +1071,17 @@ NPError
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
 
     if (!aNPP) // nullptr check for nspluginwrapper (bug 561690)
         return NPERR_INVALID_INSTANCE_ERROR;
 
     nsCString url = NullableString(aRelativeURL);
-    StreamNotifyChild* sn = new StreamNotifyChild(url);
+    auto* sn = new StreamNotifyChild(url);
 
     NPError err;
     InstCast(aNPP)->CallPStreamNotifyConstructor(
         sn, url, NullableString(aTarget), false, nsCString(), false, &err);
 
     if (NPERR_NO_ERROR == err) {
         // If NPN_PostURLNotify fails, the parent will immediately send us
         // a PStreamNotifyDestructor, which should not call NPP_URLNotify.
@@ -1185,17 +1185,17 @@ NPError
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
 
     if (!aBuffer)
         return NPERR_INVALID_PARAM;
 
     nsCString url = NullableString(aRelativeURL);
-    StreamNotifyChild* sn = new StreamNotifyChild(url);
+    auto* sn = new StreamNotifyChild(url);
 
     NPError err;
     InstCast(aNPP)->CallPStreamNotifyConstructor(
         sn, url, NullableString(aTarget), true,
         nsCString(aBuffer, aLength), aIsFile, &err);
 
     if (NPERR_NO_ERROR == err) {
         // If NPN_PostURLNotify fails, the parent will immediately send us