Bug 1241518 - Part 1: Remove unused nsAutoPtr.h includes in xpcom/ r=kmag

This removes various unused `#include "nsAutoPtr.h"` in `xpcom/`. Additionally
adds a few includes to the media stack.

Differential Revision: https://phabricator.services.mozilla.com/D58282

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eric Rahm 2020-01-07 00:06:01 +00:00
parent 955e22bbdb
commit 6d75492859
38 changed files with 31 additions and 59 deletions

View File

@ -17,6 +17,7 @@
#include "mozilla/Move.h"
#include "mozilla/dom/TreeOrderedArray.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsAtom.h"
#include "nsHashKeys.h"

View File

@ -10,6 +10,7 @@
#include "mozilla/Attributes.h"
#include "MediaDataDemuxer.h"
#include "MediaResource.h"
#include "nsAutoPtr.h"
namespace mozilla {
namespace flac {

View File

@ -11,12 +11,10 @@
#include "MoofParser.h"
#include "mozilla/Result.h"
#include "MP4Interval.h"
#include "nsAutoPtr.h"
#include "nsISupportsImpl.h"
#include "TimeUnits.h"
template <class T>
class nsAutoPtr;
namespace mozilla {
class IndiceWrapper;
struct Sample;

View File

@ -51,6 +51,7 @@
#include <string>
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"

View File

@ -9,7 +9,7 @@
#ifndef mozilla_OwningNonNull_h
#define mozilla_OwningNonNull_h
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionNoteChild.h"
namespace mozilla {

View File

@ -6,7 +6,6 @@
#include "nsErrorService.h"
#include "nsCRTGlue.h"
#include "nsAutoPtr.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/ClearOnShutdown.h"

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsAtomTable.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsPrintfCString.h"

View File

@ -12,7 +12,6 @@
#include "nsIRunnable.h"
#include "nsITimer.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsThreadUtils.h"

View File

@ -9,7 +9,6 @@
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsIFile.h"
#include "FileUtils.h"

View File

@ -12,7 +12,6 @@
#include <evntrace.h>
#include "perfprobe.h"
#include "nsAutoPtr.h"
namespace mozilla {
namespace probes {

View File

@ -20,7 +20,6 @@
#include "nsString.h"
#include "mozilla/Logging.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include <windows.h>
#undef GetStartupInfo // Prevent Windows from polluting global namespace
#include <wmistr.h>

View File

@ -13,7 +13,6 @@
#include "nsServiceManagerUtils.h"
#include "nsAutoPtr.h"
#include "nsCOMArray.h"
#include "nsInterfaceHashtable.h"

View File

@ -17,7 +17,6 @@
#include "nsAtom.h"
#include "nsAtomTable.h"
#include "nsAutoPtr.h"
#include "nsCRT.h"
#include "nsDataHashtable.h"
#include "nsGkAtoms.h"

View File

@ -11,7 +11,6 @@
#include "nsTArray.h"
#include "nsITimer.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsIEventTarget.h"
#include "nsIObserver.h"

View File

@ -9,7 +9,6 @@
#include "nsID.h"
#include "nsISupports.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "PLDHashTable.h"
#include <new>

View File

@ -7,7 +7,6 @@
#include "nsObserverList.h"
#include "mozilla/ResultExtensions.h"
#include "nsAutoPtr.h"
#include "nsCOMArray.h"
#include "xpcpublic.h"

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Logging.h"
#include "nsAutoPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsIConsoleService.h"
#include "nsIObserverService.h"

View File

@ -9,7 +9,6 @@
#include "nsCOMArray.h"
#include "nsUnicharInputStream.h"
#include "nsPrintfCString.h"
#include "nsAutoPtr.h"
#include "nsPersistentProperties.h"
#include "nsIProperties.h"

View File

@ -9,7 +9,6 @@
#include "nsBaseHashtable.h"
#include "nsHashKeys.h"
#include "nsAutoPtr.h"
/**
* templated hashtable class maps keys to reference pointers.

View File

@ -11,7 +11,6 @@
#include "nsString.h"
#include "nsCOMPtr.h"
#include "mozilla/Attributes.h"
#include "nsAutoPtr.h"
//-----------------------------------------------------------------------------

View File

@ -7,7 +7,6 @@
#include "SpecialSystemDirectory.h"
#include "nsString.h"
#include "nsDependentString.h"
#include "nsAutoPtr.h"
#if defined(XP_WIN)

View File

@ -19,7 +19,6 @@
# include "nsIIdleService.h"
# include "nsISimpleEnumerator.h"
# include "nsIFile.h"
# include "nsAutoPtr.h"
# include "nsITimer.h"
# include "nsCRT.h"

View File

@ -7,7 +7,6 @@
#include "mozilla/ArrayUtils.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsDirectoryService.h"
#include "nsLocalFile.h"
#include "nsDebug.h"

View File

@ -10,7 +10,6 @@
#include "mozilla/Utf8.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsMemory.h"
#include "GeckoProfiler.h"

View File

@ -7,7 +7,6 @@
#include "mozilla/Mutex.h"
#include "mozilla/Attributes.h"
#include "nsStreamUtils.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsICloneableInputStream.h"
#include "nsIEventTarget.h"

View File

@ -8,7 +8,6 @@
#include "nsIInputStream.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsCRT.h"
#include "nsStreamUtils.h"
#include "nsConverterInputStream.h"

View File

@ -9,7 +9,6 @@
#define xptcprivate_h___
#include "xptcall.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
#if !defined(__ia64) || \

View File

@ -19,7 +19,6 @@
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceDefs.h"

View File

@ -17,7 +17,6 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
#define NS_ITESTSERVICE_IID \

View File

@ -9,7 +9,6 @@
#include <prthread.h>
#include "nsExpirationTracker.h"
#include "nsMemory.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"

View File

@ -8,7 +8,6 @@
#include "nsXULAppAPI.h"
#include "nsIThread.h"
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
#include "nsXPCOMCIDInternal.h"
#include "pratom.h"

View File

@ -11,7 +11,6 @@
#include <stdio.h>
#include <iostream>
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"

View File

@ -15,7 +15,6 @@
#include "mozilla/ArrayUtils.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsMemory.h"
#include "nsProcess.h"
#include "prio.h"

View File

@ -13,7 +13,6 @@
#include "mozilla/SystemGroup.h"
#include "mozilla/TypeTraits.h"
#include "mozilla/Unused.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIEventTarget.h"
#include "nsIThread.h"

View File

@ -10,7 +10,6 @@
#include "nsThreadUtils.h"
#include "nsIClassInfoImpl.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsXULAppAPI.h"
#include "MainThreadQueue.h"
#include "mozilla/AbstractThread.h"
@ -47,8 +46,8 @@ class BackgroundEventTarget final : public nsIEventTarget {
nsresult Init();
already_AddRefed<nsISerialEventTarget>
CreateBackgroundTaskQueue(const char* aName);
already_AddRefed<nsISerialEventTarget> CreateBackgroundTaskQueue(
const char* aName);
void BeginShutdown(nsTArray<RefPtr<ShutdownPromise>>&);
void FinishShutdown();
@ -66,8 +65,7 @@ class BackgroundEventTarget final : public nsIEventTarget {
NS_IMPL_ISUPPORTS(BackgroundEventTarget, nsIEventTarget)
BackgroundEventTarget::BackgroundEventTarget()
: mMutex("BackgroundEventTarget::mMutex")
{}
: mMutex("BackgroundEventTarget::mMutex") {}
nsresult BackgroundEventTarget::Init() {
nsCOMPtr<nsIThreadPool> pool(new nsThreadPool());
@ -170,7 +168,8 @@ BackgroundEventTarget::DelayedDispatch(already_AddRefed<nsIRunnable> aRunnable,
return NS_ERROR_NOT_IMPLEMENTED;
}
void BackgroundEventTarget::BeginShutdown(nsTArray<RefPtr<ShutdownPromise>>& promises) {
void BackgroundEventTarget::BeginShutdown(
nsTArray<RefPtr<ShutdownPromise>>& promises) {
for (auto& queue : mTaskQueues) {
promises.AppendElement(queue->BeginShutdown());
}
@ -181,12 +180,13 @@ void BackgroundEventTarget::FinishShutdown() {
mIOPool->Shutdown();
}
already_AddRefed<nsISerialEventTarget> BackgroundEventTarget::CreateBackgroundTaskQueue(const char* aName) {
already_AddRefed<nsISerialEventTarget>
BackgroundEventTarget::CreateBackgroundTaskQueue(const char* aName) {
MutexAutoLock lock(mMutex);
RefPtr<TaskQueue> queue = new TaskQueue(do_AddRef(this), aName,
/*aSupportsTailDispatch=*/ false,
/*aRetainFlags=*/ true);
/*aSupportsTailDispatch=*/false,
/*aRetainFlags=*/true);
nsCOMPtr<nsISerialEventTarget> target(queue->WrapAsEventTarget());
mTaskQueues.AppendElement(queue.forget());
@ -426,20 +426,22 @@ void nsThreadManager::Shutdown() {
bool taskQueuesShutdown = false;
complete->Then(mMainThread, __func__,
[&](const ResolveValueT& aResolveValue) {
mBackgroundEventTarget->FinishShutdown();
taskQueuesShutdown = true;
},
[&](RejectValueT aRejectValue) {
mBackgroundEventTarget->FinishShutdown();
taskQueuesShutdown = true;
});
complete->Then(
mMainThread, __func__,
[&](const ResolveValueT& aResolveValue) {
mBackgroundEventTarget->FinishShutdown();
taskQueuesShutdown = true;
},
[&](RejectValueT aRejectValue) {
mBackgroundEventTarget->FinishShutdown();
taskQueuesShutdown = true;
});
// Wait for task queues to shutdown, so we don't shut down the underlying threads
// of the background event target in the block below, thereby preventing the task
// queues from emptying, preventing the shutdown promises from resolving, and
// prevent anything checking `taskQueuesShutdown` from working.
// Wait for task queues to shutdown, so we don't shut down the underlying
// threads of the background event target in the block below, thereby
// preventing the task queues from emptying, preventing the shutdown promises
// from resolving, and prevent anything checking `taskQueuesShutdown` from
// working.
::SpinEventLoopUntil([&]() { return taskQueuesShutdown; }, mMainThread);
{
@ -552,7 +554,8 @@ nsresult nsThreadManager::DispatchToBackgroundThread(nsIRunnable* aEvent,
return backgroundTarget->Dispatch(aEvent, aDispatchFlags);
}
already_AddRefed<nsISerialEventTarget> nsThreadManager::CreateBackgroundTaskQueue(const char* aName) {
already_AddRefed<nsISerialEventTarget>
nsThreadManager::CreateBackgroundTaskQueue(const char* aName) {
if (!mInitialized) {
return nullptr;
}

View File

@ -10,7 +10,6 @@
#include "nsThreadManager.h"
#include "nsThread.h"
#include "nsMemory.h"
#include "nsAutoPtr.h"
#include "prinrval.h"
#include "mozilla/Logging.h"
#include "mozilla/SystemGroup.h"

View File

@ -20,7 +20,6 @@
#include "nsIThread.h"
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "xpcpublic.h"
#include "mozilla/AbstractEventQueue.h"
#include "mozilla/Atomics.h"

View File

@ -6,7 +6,6 @@
#include "nsTimerImpl.h"
#include "TimerThread.h"
#include "nsAutoPtr.h"
#include "nsThreadManager.h"
#include "nsThreadUtils.h"
#include "pratom.h"