mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
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:
parent
955e22bbdb
commit
6d75492859
@ -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"
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "MediaDataDemuxer.h"
|
||||
#include "MediaResource.h"
|
||||
#include "nsAutoPtr.h"
|
||||
namespace mozilla {
|
||||
|
||||
namespace flac {
|
||||
|
@ -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;
|
||||
|
@ -51,6 +51,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef mozilla_OwningNonNull_h
|
||||
#define mozilla_OwningNonNull_h
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionNoteChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "nsErrorService.h"
|
||||
#include "nsCRTGlue.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIFile.h"
|
||||
#include "FileUtils.h"
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <evntrace.h>
|
||||
|
||||
#include "perfprobe.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace probes {
|
||||
|
@ -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>
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
#include "nsAtom.h"
|
||||
#include "nsAtomTable.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
@ -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"
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "nsID.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "PLDHashTable.h"
|
||||
#include <new>
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "nsObserverList.h"
|
||||
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "xpcpublic.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsUnicharInputStream.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#include "nsPersistentProperties.h"
|
||||
#include "nsIProperties.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "nsBaseHashtable.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
/**
|
||||
* templated hashtable class maps keys to reference pointers.
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "SpecialSystemDirectory.h"
|
||||
#include "nsString.h"
|
||||
#include "nsDependentString.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
# include "nsIIdleService.h"
|
||||
# include "nsISimpleEnumerator.h"
|
||||
# include "nsIFile.h"
|
||||
# include "nsAutoPtr.h"
|
||||
# include "nsITimer.h"
|
||||
# include "nsCRT.h"
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsDirectoryService.h"
|
||||
#include "nsLocalFile.h"
|
||||
#include "nsDebug.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "mozilla/Utf8.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsMemory.h"
|
||||
#include "GeckoProfiler.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#define xptcprivate_h___
|
||||
|
||||
#include "xptcall.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#if !defined(__ia64) || \
|
||||
|
@ -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"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#define NS_ITESTSERVICE_IID \
|
||||
|
@ -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"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsIThread.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
#include "pratom.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsMemory.h"
|
||||
#include "nsProcess.h"
|
||||
#include "prio.h"
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "nsTimerImpl.h"
|
||||
#include "TimerThread.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadManager.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "pratom.h"
|
||||
|
Loading…
Reference in New Issue
Block a user