forked from mirrors/gecko-dev
Bug 1363560 - Name more runnables (r=mccr8)
MozReview-Commit-ID: 3hxZDA4JlTV
This commit is contained in:
parent
64eae5b86d
commit
c197e07ff2
22 changed files with 159 additions and 61 deletions
|
|
@ -29,7 +29,10 @@ namespace dom {
|
|||
// template parameter, we need to move this class outside.
|
||||
class SurfaceHelper : public Runnable {
|
||||
public:
|
||||
explicit SurfaceHelper(already_AddRefed<layers::Image> aImage) : mImage(aImage) {}
|
||||
explicit SurfaceHelper(already_AddRefed<layers::Image> aImage)
|
||||
: Runnable("SurfaceHelper")
|
||||
, mImage(aImage)
|
||||
{}
|
||||
|
||||
// It retrieves a SourceSurface reference and convert color format on main
|
||||
// thread and passes DataSourceSurface to caller thread.
|
||||
|
|
@ -79,7 +82,8 @@ class EncodingCompleteEvent : public CancelableRunnable
|
|||
|
||||
public:
|
||||
explicit EncodingCompleteEvent(EncodeCompleteCallback* aEncodeCompleteCallback)
|
||||
: mImgSize(0)
|
||||
: CancelableRunnable("EncodingCompleteEvent")
|
||||
, mImgSize(0)
|
||||
, mType()
|
||||
, mImgData(nullptr)
|
||||
, mEncodeCompleteCallback(aEncodeCompleteCallback)
|
||||
|
|
@ -152,7 +156,8 @@ public:
|
|||
int32_t aFormat,
|
||||
const nsIntSize aSize,
|
||||
bool aUsingCustomOptions)
|
||||
: mType(aType)
|
||||
: Runnable("EncodingRunnable")
|
||||
, mType(aType)
|
||||
, mOptions(aOptions)
|
||||
, mImageBuffer(Move(aImageBuffer))
|
||||
, mImage(aImage)
|
||||
|
|
|
|||
|
|
@ -561,6 +561,7 @@ NS_INTERFACE_MAP_END_INHERITING(TimeoutHandler)
|
|||
|
||||
class IdleRequestExecutor final : public nsIRunnable
|
||||
, public nsICancelableRunnable
|
||||
, public nsINamed
|
||||
, public nsIIncrementalRunnable
|
||||
{
|
||||
public:
|
||||
|
|
@ -580,6 +581,7 @@ public:
|
|||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(IdleRequestExecutor, nsIRunnable)
|
||||
|
||||
NS_DECL_NSIRUNNABLE
|
||||
NS_DECL_NSINAMED
|
||||
nsresult Cancel() override;
|
||||
void SetDeadline(TimeStamp aDeadline) override;
|
||||
|
||||
|
|
@ -646,10 +648,24 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IdleRequestExecutor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIRunnable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsICancelableRunnable)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINamed)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIIncrementalRunnable)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIRunnable)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMETHODIMP
|
||||
IdleRequestExecutor::GetName(nsACString& aName)
|
||||
{
|
||||
aName.AssignASCII("IdleRequestExecutor");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
IdleRequestExecutor::SetName(const char* aName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
IdleRequestExecutor::Run()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ InActiveDocument(nsIContent *aContent)
|
|||
class nsAsyncInstantiateEvent : public Runnable {
|
||||
public:
|
||||
explicit nsAsyncInstantiateEvent(nsObjectLoadingContent* aContent)
|
||||
: mContent(aContent) {}
|
||||
: Runnable("nsAsyncInstantiateEvent"), mContent(aContent) {}
|
||||
|
||||
~nsAsyncInstantiateEvent() override = default;
|
||||
|
||||
|
|
@ -260,7 +260,8 @@ CheckPluginStopEvent::Run()
|
|||
class nsSimplePluginEvent : public Runnable {
|
||||
public:
|
||||
nsSimplePluginEvent(nsIContent* aTarget, const nsAString &aEvent)
|
||||
: mTarget(aTarget)
|
||||
: Runnable("nsSimplePluginEvent")
|
||||
, mTarget(aTarget)
|
||||
, mDocument(aTarget->GetComposedDoc())
|
||||
, mEvent(aEvent)
|
||||
{
|
||||
|
|
@ -325,7 +326,8 @@ public:
|
|||
const nsAString& aPluginName,
|
||||
const nsAString& aPluginFilename,
|
||||
bool submittedCrashReport)
|
||||
: mContent(aContent),
|
||||
: Runnable("nsPluginCrashedEvent"),
|
||||
mContent(aContent),
|
||||
mPluginDumpID(aPluginDumpID),
|
||||
mBrowserDumpID(aBrowserDumpID),
|
||||
mPluginName(aPluginName),
|
||||
|
|
|
|||
|
|
@ -3726,7 +3726,8 @@ WebCryptoTask::CreateUnwrapKeyTask(nsIGlobalObject* aGlobal,
|
|||
}
|
||||
|
||||
WebCryptoTask::WebCryptoTask()
|
||||
: mEarlyRv(NS_OK)
|
||||
: CancelableRunnable("WebCryptoTask")
|
||||
, mEarlyRv(NS_OK)
|
||||
, mEarlyComplete(false)
|
||||
, mOriginalThread(nullptr)
|
||||
, mReleasedNSSResources(false)
|
||||
|
|
|
|||
|
|
@ -1210,6 +1210,7 @@ public:
|
|||
// Per bug 1235183 comment 8, we can't spin the event loop from stable
|
||||
// state. Defer NS_NewChannel() to a new regular runnable.
|
||||
return NS_DispatchToMainThread(NewRunnableMethod<HTMLMediaElement*>(
|
||||
"ChannelLoader::LoadInternal",
|
||||
this, &ChannelLoader::LoadInternal, aElement));
|
||||
}
|
||||
|
||||
|
|
@ -1819,7 +1820,8 @@ void HTMLMediaElement::QueueLoadFromSourceTask()
|
|||
|
||||
ChangeDelayLoadStatus(true);
|
||||
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_LOADING);
|
||||
RefPtr<Runnable> r = NewRunnableMethod(this, &HTMLMediaElement::LoadFromSourceChildren);
|
||||
RefPtr<Runnable> r = NewRunnableMethod("HTMLMediaElement::LoadFromSourceChildren",
|
||||
this, &HTMLMediaElement::LoadFromSourceChildren);
|
||||
RunInStableState(r);
|
||||
}
|
||||
|
||||
|
|
@ -1830,7 +1832,8 @@ void HTMLMediaElement::QueueSelectResourceTask()
|
|||
return;
|
||||
mHaveQueuedSelectResource = true;
|
||||
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
|
||||
RefPtr<Runnable> r = NewRunnableMethod(this, &HTMLMediaElement::SelectResourceWrapper);
|
||||
RefPtr<Runnable> r = NewRunnableMethod("HTMLMediaElement::SelectResourceWrapper",
|
||||
this, &HTMLMediaElement::SelectResourceWrapper);
|
||||
RunInStableState(r);
|
||||
}
|
||||
|
||||
|
|
@ -1966,7 +1969,8 @@ void HTMLMediaElement::SelectResource()
|
|||
// set the networkState to NETWORK_EMPTY, and abort these steps; the
|
||||
// synchronous section ends.
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
NewRunnableMethod<nsCString>(this, &HTMLMediaElement::NoSupportedMediaSourceError, nsCString());
|
||||
NewRunnableMethod<nsCString>("HTMLMediaElement::NoSupportedMediaSourceError",
|
||||
this, &HTMLMediaElement::NoSupportedMediaSourceError, nsCString());
|
||||
NS_DispatchToMainThread(event);
|
||||
} else {
|
||||
// Otherwise, the source elements will be used.
|
||||
|
|
@ -2125,7 +2129,8 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack)
|
|||
MOZ_ASSERT(outputTrack);
|
||||
if (outputTrack) {
|
||||
NS_DispatchToMainThread(
|
||||
NewRunnableMethod(outputTrack, &MediaStreamTrack::OverrideEnded));
|
||||
NewRunnableMethod("MediaStreamTrack::OverrideEnded",
|
||||
outputTrack, &MediaStreamTrack::OverrideEnded));
|
||||
}
|
||||
|
||||
ms.mTrackPorts[i].second()->Destroy();
|
||||
|
|
@ -2171,7 +2176,8 @@ void HTMLMediaElement::DealWithFailedElement(nsIContent* aSourceElement)
|
|||
|
||||
DispatchAsyncSourceError(aSourceElement);
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
NewRunnableMethod(this, &HTMLMediaElement::QueueLoadFromSourceTask);
|
||||
NewRunnableMethod("HTMLMediaElement::QueueLoadFromSourceTask",
|
||||
this, &HTMLMediaElement::QueueLoadFromSourceTask);
|
||||
NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
||||
|
|
@ -3289,6 +3295,7 @@ HTMLMediaElement::AddCaptureMediaTrackToOutputStream(MediaTrack* aTrack,
|
|||
if (aAsyncAddtrack) {
|
||||
NS_DispatchToMainThread(
|
||||
NewRunnableMethod<StoreRefPtrPassByPtr<MediaStreamTrack>>(
|
||||
"DOMMediaStream::AddTrackInternal",
|
||||
aOutputStream.mStream, &DOMMediaStream::AddTrackInternal, track));
|
||||
} else {
|
||||
aOutputStream.mStream->AddTrackInternal(track);
|
||||
|
|
|
|||
|
|
@ -630,9 +630,11 @@ nsJSChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext)
|
|||
mPopupState = win->GetPopupControlState();
|
||||
|
||||
void (nsJSChannel::*method)();
|
||||
const char* name;
|
||||
if (mIsAsync) {
|
||||
// post an event to do the rest
|
||||
method = &nsJSChannel::EvaluateScript;
|
||||
name = "nsJSChannel::EvaluateScript";
|
||||
} else {
|
||||
EvaluateScript();
|
||||
if (mOpenedStreamChannel) {
|
||||
|
|
@ -657,10 +659,11 @@ nsJSChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext)
|
|||
// We're returning success from asyncOpen2(), but we didn't open a
|
||||
// stream channel. We'll have to notify ourselves, but make sure to do
|
||||
// it asynchronously.
|
||||
method = &nsJSChannel::NotifyListener;
|
||||
method = &nsJSChannel::NotifyListener;
|
||||
name = "nsJSChannel::NotifyListener";
|
||||
}
|
||||
|
||||
nsresult rv = NS_DispatchToCurrentThread(mozilla::NewRunnableMethod(this, method));
|
||||
nsresult rv = NS_DispatchToCurrentThread(mozilla::NewRunnableMethod(name, this, method));
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
loadGroup->RemoveRequest(this, nullptr, rv);
|
||||
|
|
|
|||
|
|
@ -1555,7 +1555,8 @@ namespace {
|
|||
class MediaStreamGraphShutDownRunnable : public Runnable {
|
||||
public:
|
||||
explicit MediaStreamGraphShutDownRunnable(MediaStreamGraphImpl* aGraph)
|
||||
: mGraph(aGraph)
|
||||
: Runnable("MediaStreamGraphShutDownRunnable")
|
||||
, mGraph(aGraph)
|
||||
{}
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
|
|
@ -2676,7 +2677,8 @@ MediaStream::AddMainThreadListener(MainThreadMediaStreamListener* aListener)
|
|||
{
|
||||
public:
|
||||
explicit NotifyRunnable(MediaStream* aStream)
|
||||
: mStream(aStream)
|
||||
: Runnable("MediaStream::NotifyRunnable")
|
||||
, mStream(aStream)
|
||||
{}
|
||||
|
||||
NS_IMETHOD Run() override
|
||||
|
|
@ -3759,8 +3761,9 @@ class GraphStartedRunnable final : public Runnable
|
|||
{
|
||||
public:
|
||||
GraphStartedRunnable(AudioNodeStream* aStream, MediaStreamGraph* aGraph)
|
||||
: mStream(aStream)
|
||||
, mGraph(aGraph)
|
||||
: Runnable("GraphStartedRunnable")
|
||||
, mStream(aStream)
|
||||
, mGraph(aGraph)
|
||||
{ }
|
||||
|
||||
NS_IMETHOD Run() override {
|
||||
|
|
|
|||
|
|
@ -676,7 +676,8 @@ AudioContext::Shutdown()
|
|||
StateChangeTask::StateChangeTask(AudioContext* aAudioContext,
|
||||
void* aPromise,
|
||||
AudioContextState aNewState)
|
||||
: mAudioContext(aAudioContext)
|
||||
: Runnable("dom::StateChangeTask")
|
||||
, mAudioContext(aAudioContext)
|
||||
, mPromise(aPromise)
|
||||
, mAudioNodeStream(nullptr)
|
||||
, mNewState(aNewState)
|
||||
|
|
@ -688,7 +689,8 @@ StateChangeTask::StateChangeTask(AudioContext* aAudioContext,
|
|||
StateChangeTask::StateChangeTask(AudioNodeStream* aStream,
|
||||
void* aPromise,
|
||||
AudioContextState aNewState)
|
||||
: mAudioContext(nullptr)
|
||||
: Runnable("dom::StateChangeTask")
|
||||
, mAudioContext(nullptr)
|
||||
, mPromise(aPromise)
|
||||
, mAudioNodeStream(aStream)
|
||||
, mNewState(aNewState)
|
||||
|
|
@ -729,7 +731,8 @@ class OnStateChangeTask final : public Runnable
|
|||
{
|
||||
public:
|
||||
explicit OnStateChangeTask(AudioContext* aAudioContext)
|
||||
: mAudioContext(aAudioContext)
|
||||
: Runnable("dom::OnStateChangeTask")
|
||||
, mAudioContext(aAudioContext)
|
||||
{}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
|||
|
|
@ -556,7 +556,8 @@ NS_IMPL_ISUPPORTS(LoaderListener, nsIStreamLoaderObserver, nsIRequestObserver)
|
|||
|
||||
class ScriptLoaderHolder;
|
||||
|
||||
class ScriptLoaderRunnable final : public nsIRunnable
|
||||
class ScriptLoaderRunnable final : public nsIRunnable,
|
||||
public nsINamed
|
||||
{
|
||||
friend class ScriptExecutorRunnable;
|
||||
friend class ScriptLoaderHolder;
|
||||
|
|
@ -611,6 +612,19 @@ private:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD
|
||||
GetName(nsACString& aName) override
|
||||
{
|
||||
aName.AssignASCII("ScriptLoaderRunnable");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD
|
||||
SetName(const char* aName) override
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void
|
||||
LoadingFinished(uint32_t aIndex, nsresult aRv)
|
||||
{
|
||||
|
|
@ -1334,7 +1348,7 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(ScriptLoaderRunnable, nsIRunnable)
|
||||
NS_IMPL_ISUPPORTS(ScriptLoaderRunnable, nsIRunnable, nsINamed)
|
||||
|
||||
class MOZ_STACK_CLASS ScriptLoaderHolder final : public WorkerHolder
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ ServiceWorkerJob::Start(Callback* aFinalCallback)
|
|||
mState = State::Started;
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NewRunnableMethod(this, &ServiceWorkerJob::AsyncExecute);
|
||||
NewRunnableMethod("ServiceWorkerJob::AsyncExecute",
|
||||
this, &ServiceWorkerJob::AsyncExecute);
|
||||
|
||||
// We may have to wait for the PBackground actor to be initialized
|
||||
// before proceeding. We should always be able to get a ServiceWorkerManager,
|
||||
|
|
|
|||
|
|
@ -473,7 +473,8 @@ class mozInlineSpellResume : public Runnable
|
|||
public:
|
||||
mozInlineSpellResume(UniquePtr<mozInlineSpellStatus>&& aStatus,
|
||||
uint32_t aDisabledAsyncToken)
|
||||
: mDisabledAsyncToken(aDisabledAsyncToken)
|
||||
: Runnable("mozInlineSpellResume")
|
||||
, mDisabledAsyncToken(aDisabledAsyncToken)
|
||||
, mStatus(Move(aStatus))
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1128,7 +1128,8 @@ VectorImage::OnSurfaceDiscarded(const SurfaceKey& aSurfaceKey)
|
|||
{
|
||||
MOZ_ASSERT(mProgressTracker);
|
||||
|
||||
NS_DispatchToMainThread(NewRunnableMethod(mProgressTracker, &ProgressTracker::OnDiscard));
|
||||
NS_DispatchToMainThread(NewRunnableMethod("ProgressTracker::OnDiscard",
|
||||
mProgressTracker, &ProgressTracker::OnDiscard));
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
|||
|
|
@ -317,7 +317,8 @@ class imgRequestMainThreadCancel : public Runnable
|
|||
{
|
||||
public:
|
||||
imgRequestMainThreadCancel(imgRequest* aImgRequest, nsresult aStatus)
|
||||
: mImgRequest(aImgRequest)
|
||||
: Runnable("imgRequestMainThreadCancel")
|
||||
, mImgRequest(aImgRequest)
|
||||
, mStatus(aStatus)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread(), "Create me off main thread only!");
|
||||
|
|
@ -367,7 +368,8 @@ class imgRequestMainThreadEvict : public Runnable
|
|||
{
|
||||
public:
|
||||
explicit imgRequestMainThreadEvict(imgRequest* aImgRequest)
|
||||
: mImgRequest(aImgRequest)
|
||||
: Runnable("imgRequestMainThreadEvict")
|
||||
, mImgRequest(aImgRequest)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread(), "Create me off main thread only!");
|
||||
MOZ_ASSERT(aImgRequest);
|
||||
|
|
@ -1053,7 +1055,8 @@ class FinishPreparingForNewPartRunnable final : public Runnable
|
|||
public:
|
||||
FinishPreparingForNewPartRunnable(imgRequest* aImgRequest,
|
||||
NewPartResult&& aResult)
|
||||
: mImgRequest(aImgRequest)
|
||||
: Runnable("FinishPreparingForNewPartRunnable")
|
||||
, mImgRequest(aImgRequest)
|
||||
, mResult(aResult)
|
||||
{
|
||||
MOZ_ASSERT(aImgRequest);
|
||||
|
|
|
|||
|
|
@ -492,7 +492,9 @@ class ParentImpl::RequestMessageLoopRunnable final : public Runnable
|
|||
|
||||
public:
|
||||
explicit RequestMessageLoopRunnable(nsIThread* aTargetThread)
|
||||
: mTargetThread(aTargetThread), mMessageLoop(nullptr)
|
||||
: Runnable("Background::ParentImpl::RequestMessageLoopRunnable")
|
||||
, mTargetThread(aTargetThread)
|
||||
, mMessageLoop(nullptr)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnMainThread();
|
||||
|
|
@ -510,6 +512,7 @@ class ParentImpl::ShutdownBackgroundThreadRunnable final : public Runnable
|
|||
{
|
||||
public:
|
||||
ShutdownBackgroundThreadRunnable()
|
||||
: Runnable("Background::ParentImpl::ShutdownBackgroundThreadRunnable")
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnMainThread();
|
||||
|
|
@ -528,7 +531,8 @@ class ParentImpl::ForceCloseBackgroundActorsRunnable final : public Runnable
|
|||
|
||||
public:
|
||||
explicit ForceCloseBackgroundActorsRunnable(nsTArray<ParentImpl*>* aActorArray)
|
||||
: mActorArray(aActorArray)
|
||||
: Runnable("Background::ParentImpl::ForceCloseBackgroundActorsRunnable")
|
||||
, mActorArray(aActorArray)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnMainThread();
|
||||
|
|
@ -548,7 +552,8 @@ class ParentImpl::CreateCallbackRunnable final : public Runnable
|
|||
|
||||
public:
|
||||
explicit CreateCallbackRunnable(CreateCallback* aCallback)
|
||||
: mCallback(aCallback)
|
||||
: Runnable("Background::ParentImpl::CreateCallbackRunnable")
|
||||
, mCallback(aCallback)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnMainThread();
|
||||
|
|
@ -572,8 +577,10 @@ public:
|
|||
ConnectActorRunnable(ParentImpl* aActor,
|
||||
Endpoint<PBackgroundParent>&& aEndpoint,
|
||||
nsTArray<ParentImpl*>* aLiveActorArray)
|
||||
: mActor(aActor), mEndpoint(Move(aEndpoint)),
|
||||
mLiveActorArray(aLiveActorArray)
|
||||
: Runnable("Background::ParentImpl::ConnectActorRunnable")
|
||||
, mActor(aActor)
|
||||
, mEndpoint(Move(aEndpoint))
|
||||
, mLiveActorArray(aLiveActorArray)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnMainThread();
|
||||
|
|
@ -634,7 +641,8 @@ class ChildImpl::CreateActorRunnable final : public Runnable
|
|||
|
||||
public:
|
||||
CreateActorRunnable()
|
||||
: mEventTarget(NS_GetCurrentThread())
|
||||
: Runnable("Background::ChildImpl::CreateActorRunnable")
|
||||
, mEventTarget(NS_GetCurrentThread())
|
||||
{
|
||||
MOZ_ASSERT(mEventTarget);
|
||||
}
|
||||
|
|
@ -678,6 +686,7 @@ class ChildImpl::AlreadyCreatedCallbackRunnable final :
|
|||
{
|
||||
public:
|
||||
AlreadyCreatedCallbackRunnable()
|
||||
: CancelableRunnable("Background::ChildImpl::AlreadyCreatedCallbackRunnable")
|
||||
{
|
||||
// May be created on any thread!
|
||||
}
|
||||
|
|
@ -694,6 +703,7 @@ class ChildImpl::FailedCreateCallbackRunnable final : public Runnable
|
|||
{
|
||||
public:
|
||||
FailedCreateCallbackRunnable()
|
||||
: Runnable("Background::ChildImpl::FailedCreateCallbackRunnable")
|
||||
{
|
||||
// May be created on any thread!
|
||||
}
|
||||
|
|
@ -713,7 +723,9 @@ class ChildImpl::OpenChildProcessActorRunnable final : public Runnable
|
|||
public:
|
||||
OpenChildProcessActorRunnable(already_AddRefed<ChildImpl>&& aActor,
|
||||
Endpoint<PBackgroundChild>&& aEndpoint)
|
||||
: mActor(aActor), mEndpoint(Move(aEndpoint))
|
||||
: Runnable("Background::ChildImpl::OpenChildProcessActorRunnable")
|
||||
, mActor(aActor)
|
||||
, mEndpoint(Move(aEndpoint))
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(mActor);
|
||||
|
|
|
|||
|
|
@ -556,6 +556,7 @@ private:
|
|||
mProcessedVsync = false;
|
||||
nsCOMPtr<nsIRunnable> vsyncEvent =
|
||||
NewRunnableMethod<>(
|
||||
"RefreshDriverVsyncObserver::NormalPriorityNotify",
|
||||
this, &RefreshDriverVsyncObserver::NormalPriorityNotify);
|
||||
NS_DispatchToMainThread(vsyncEvent);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -695,7 +695,8 @@ class PredictorLearnRunnable final : public Runnable {
|
|||
public:
|
||||
PredictorLearnRunnable(nsIURI *targetURI, nsIURI *sourceURI,
|
||||
PredictorLearnReason reason, const OriginAttributes &oa)
|
||||
: mTargetURI(targetURI)
|
||||
: Runnable("PredictorLearnRunnable")
|
||||
, mTargetURI(targetURI)
|
||||
, mSourceURI(sourceURI)
|
||||
, mReason(reason)
|
||||
, mOA(oa)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ static LazyLogModule gRedirectLog("nsRedirect");
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsAsyncRedirectVerifyHelper,
|
||||
nsIAsyncVerifyRedirectCallback,
|
||||
nsIRunnable)
|
||||
nsIRunnable,
|
||||
nsINamed)
|
||||
|
||||
class nsAsyncVerifyRedirectCallbackEvent : public Runnable {
|
||||
public:
|
||||
|
|
@ -227,6 +228,19 @@ nsAsyncRedirectVerifyHelper::InitCallback()
|
|||
ExplicitCallback(mResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncRedirectVerifyHelper::GetName(nsACString& aName)
|
||||
{
|
||||
aName.AssignASCII("nsAsyncRedirectVerifyHelper");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncRedirectVerifyHelper::SetName(const char* aName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncRedirectVerifyHelper::Run()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,10 +27,12 @@ namespace net {
|
|||
* redirect decision is returned through the callback.
|
||||
*/
|
||||
class nsAsyncRedirectVerifyHelper final : public nsIRunnable,
|
||||
public nsINamed,
|
||||
public nsIAsyncVerifyRedirectCallback
|
||||
{
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIRUNNABLE
|
||||
NS_DECL_NSINAMED
|
||||
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ class nsHtml5RefPtrReleaser : public mozilla::Runnable
|
|||
T* mPtr;
|
||||
public:
|
||||
explicit nsHtml5RefPtrReleaser(T* aPtr)
|
||||
: mPtr(aPtr)
|
||||
: mozilla::Runnable("nsHtml5RefPtrReleaser")
|
||||
, mPtr(aPtr)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,7 +120,8 @@ class nsHtml5ExecutorFlusher : public Runnable
|
|||
RefPtr<nsHtml5TreeOpExecutor> mExecutor;
|
||||
public:
|
||||
explicit nsHtml5ExecutorFlusher(nsHtml5TreeOpExecutor* aExecutor)
|
||||
: mExecutor(aExecutor)
|
||||
: Runnable("nsHtml5ExecutorFlusher")
|
||||
, mExecutor(aExecutor)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
@ -137,7 +138,8 @@ class nsHtml5LoadFlusher : public Runnable
|
|||
RefPtr<nsHtml5TreeOpExecutor> mExecutor;
|
||||
public:
|
||||
explicit nsHtml5LoadFlusher(nsHtml5TreeOpExecutor* aExecutor)
|
||||
: mExecutor(aExecutor)
|
||||
: Runnable("nsHtml5LoadFlusher")
|
||||
, mExecutor(aExecutor)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
@ -1066,7 +1068,8 @@ class nsHtml5RequestStopper : public Runnable
|
|||
nsHtml5RefPtr<nsHtml5StreamParser> mStreamParser;
|
||||
public:
|
||||
explicit nsHtml5RequestStopper(nsHtml5StreamParser* aStreamParser)
|
||||
: mStreamParser(aStreamParser)
|
||||
: Runnable("nsHtml5RequestStopper")
|
||||
, mStreamParser(aStreamParser)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
@ -1155,7 +1158,8 @@ class nsHtml5DataAvailable : public Runnable
|
|||
nsHtml5DataAvailable(nsHtml5StreamParser* aStreamParser,
|
||||
UniquePtr<uint8_t[]> aData,
|
||||
uint32_t aLength)
|
||||
: mStreamParser(aStreamParser)
|
||||
: Runnable("nsHtml5DataAvailable")
|
||||
, mStreamParser(aStreamParser)
|
||||
, mData(Move(aData))
|
||||
, mLength(aLength)
|
||||
{}
|
||||
|
|
@ -1481,7 +1485,8 @@ private:
|
|||
nsHtml5RefPtr<nsHtml5StreamParser> mStreamParser;
|
||||
public:
|
||||
explicit nsHtml5StreamParserContinuation(nsHtml5StreamParser* aStreamParser)
|
||||
: mStreamParser(aStreamParser)
|
||||
: Runnable("nsHtml5StreamParserContinuation")
|
||||
, mStreamParser(aStreamParser)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
@ -1647,7 +1652,8 @@ private:
|
|||
nsHtml5RefPtr<nsHtml5StreamParser> mStreamParser;
|
||||
public:
|
||||
explicit nsHtml5TimerKungFu(nsHtml5StreamParser* aStreamParser)
|
||||
: mStreamParser(aStreamParser)
|
||||
: Runnable("nsHtml5TimerKungFu")
|
||||
, mStreamParser(aStreamParser)
|
||||
{}
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,6 +107,16 @@ ArmIPCTimer(const StaticMutexAutoLock& lock)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
DispatchIPCTimerFired()
|
||||
{
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(
|
||||
NS_NewRunnableFunction("TelemetryIPCAccumulator::IPCTimerFired",
|
||||
[]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -123,9 +133,7 @@ TelemetryIPCAccumulator::AccumulateChildHistogram(mozilla::Telemetry::HistogramI
|
|||
gHistogramAccumulations = new nsTArray<Accumulation>();
|
||||
}
|
||||
if (gHistogramAccumulations->Length() == kHistogramAccumulationsArrayHighWaterMark) {
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
DispatchIPCTimerFired();
|
||||
}
|
||||
gHistogramAccumulations->AppendElement(Accumulation{aId, aSample});
|
||||
ArmIPCTimer(locker);
|
||||
|
|
@ -140,9 +148,7 @@ TelemetryIPCAccumulator::AccumulateChildKeyedHistogram(mozilla::Telemetry::Histo
|
|||
gKeyedHistogramAccumulations = new nsTArray<KeyedAccumulation>();
|
||||
}
|
||||
if (gKeyedHistogramAccumulations->Length() == kHistogramAccumulationsArrayHighWaterMark) {
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
DispatchIPCTimerFired();
|
||||
}
|
||||
gKeyedHistogramAccumulations->AppendElement(KeyedAccumulation{aId, aSample, aKey});
|
||||
ArmIPCTimer(locker);
|
||||
|
|
@ -158,9 +164,7 @@ TelemetryIPCAccumulator::RecordChildScalarAction(mozilla::Telemetry::ScalarID aI
|
|||
gChildScalarsActions = new nsTArray<ScalarAction>();
|
||||
}
|
||||
if (gChildScalarsActions->Length() == kScalarActionsArrayHighWaterMark) {
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
DispatchIPCTimerFired();
|
||||
}
|
||||
// Store the action.
|
||||
gChildScalarsActions->AppendElement(ScalarAction{aId, aAction, Some(aValue)});
|
||||
|
|
@ -179,9 +183,7 @@ TelemetryIPCAccumulator::RecordChildKeyedScalarAction(mozilla::Telemetry::Scalar
|
|||
gChildKeyedScalarsActions = new nsTArray<KeyedScalarAction>();
|
||||
}
|
||||
if (gChildKeyedScalarsActions->Length() == kScalarActionsArrayHighWaterMark) {
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
DispatchIPCTimerFired();
|
||||
}
|
||||
// Store the action.
|
||||
gChildKeyedScalarsActions->AppendElement(
|
||||
|
|
@ -204,9 +206,7 @@ TelemetryIPCAccumulator::RecordChildEvent(const mozilla::TimeStamp& timestamp,
|
|||
}
|
||||
|
||||
if (gChildEvents->Length() == kEventsArrayHighWaterMark) {
|
||||
TelemetryIPCAccumulator::DispatchToMainThread(NS_NewRunnableFunction([]() -> void {
|
||||
TelemetryIPCAccumulator::IPCTimerFired(nullptr, nullptr);
|
||||
}));
|
||||
DispatchIPCTimerFired();
|
||||
}
|
||||
|
||||
// Store the event.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ class nsThreadSyncDispatch : public mozilla::Runnable
|
|||
{
|
||||
public:
|
||||
nsThreadSyncDispatch(nsIThread* aOrigin, already_AddRefed<nsIRunnable>&& aTask)
|
||||
: mOrigin(aOrigin)
|
||||
: Runnable("nsThreadSyncDispatch")
|
||||
, mOrigin(aOrigin)
|
||||
, mSyncTask(mozilla::Move(aTask))
|
||||
, mIsPending(true)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue