Bug 1142841: Convert all nsRefPtr<nsIRunnable> to nsCOMPtr<nsIRunnable>. r=ehsan
This patch was generated by a script. Here's the source of the script for future reference: find . \( -iname "*.cpp" -o -iname "*.h" \) | \ xargs -n 1 sed -i "s/nsRefPtr<nsIRunnable>/nsCOMPtr<nsIRunnable>/g"
This commit is contained in:
@@ -1406,7 +1406,7 @@ nsSHistory::RemoveEntries(nsTArray<uint64_t>& aIDs, int32_t aStartIndex)
|
|||||||
--index;
|
--index;
|
||||||
}
|
}
|
||||||
if (didRemove && mRootDocShell) {
|
if (didRemove && mRootDocShell) {
|
||||||
nsRefPtr<nsIRunnable> ev =
|
nsCOMPtr<nsIRunnable> ev =
|
||||||
NS_NewRunnableMethod(static_cast<nsDocShell*>(mRootDocShell),
|
NS_NewRunnableMethod(static_cast<nsDocShell*>(mRootDocShell),
|
||||||
&nsDocShell::FireDummyOnLocationChange);
|
&nsDocShell::FireDummyOnLocationChange);
|
||||||
NS_DispatchToCurrentThread(ev);
|
NS_DispatchToCurrentThread(ev);
|
||||||
|
|||||||
@@ -4412,7 +4412,7 @@ nsDocument::SetStyleSheetApplicableState(nsIStyleSheet* aSheet,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!mSSApplicableStateNotificationPending) {
|
if (!mSSApplicableStateNotificationPending) {
|
||||||
nsRefPtr<nsIRunnable> notification = NS_NewRunnableMethod(this,
|
nsCOMPtr<nsIRunnable> notification = NS_NewRunnableMethod(this,
|
||||||
&nsDocument::NotifyStyleSheetApplicableStateChanged);
|
&nsDocument::NotifyStyleSheetApplicableStateChanged);
|
||||||
mSSApplicableStateNotificationPending =
|
mSSApplicableStateNotificationPending =
|
||||||
NS_SUCCEEDED(NS_DispatchToCurrentThread(notification));
|
NS_SUCCEEDED(NS_DispatchToCurrentThread(notification));
|
||||||
@@ -5232,7 +5232,7 @@ nsDocument::UnblockDOMContentLoaded()
|
|||||||
|
|
||||||
MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
|
MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
|
||||||
if (!mSynchronousDOMContentLoaded) {
|
if (!mSynchronousDOMContentLoaded) {
|
||||||
nsRefPtr<nsIRunnable> ev =
|
nsCOMPtr<nsIRunnable> ev =
|
||||||
NS_NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
|
NS_NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
|
||||||
NS_DispatchToCurrentThread(ev);
|
NS_DispatchToCurrentThread(ev);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2360,7 +2360,7 @@ nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mChildMessageManager) {
|
if (mChildMessageManager) {
|
||||||
nsRefPtr<nsIRunnable> ev = new nsAsyncMessageToChild(aCx, this, aMessage,
|
nsCOMPtr<nsIRunnable> ev = new nsAsyncMessageToChild(aCx, this, aMessage,
|
||||||
aData, aCpows,
|
aData, aCpows,
|
||||||
aPrincipal);
|
aPrincipal);
|
||||||
NS_DispatchToCurrentThread(ev);
|
NS_DispatchToCurrentThread(ev);
|
||||||
|
|||||||
@@ -1752,7 +1752,7 @@ public:
|
|||||||
JS::Handle<JSObject *> aCpows,
|
JS::Handle<JSObject *> aCpows,
|
||||||
nsIPrincipal* aPrincipal) MOZ_OVERRIDE
|
nsIPrincipal* aPrincipal) MOZ_OVERRIDE
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> ev =
|
nsCOMPtr<nsIRunnable> ev =
|
||||||
new nsAsyncMessageToSameProcessChild(aCx, aMessage, aData, aCpows,
|
new nsAsyncMessageToSameProcessChild(aCx, aMessage, aData, aCpows,
|
||||||
aPrincipal);
|
aPrincipal);
|
||||||
NS_DispatchToCurrentThread(ev);
|
NS_DispatchToCurrentThread(ev);
|
||||||
|
|||||||
@@ -8897,7 +8897,7 @@ private:
|
|||||||
void
|
void
|
||||||
nsGlobalWindow::NotifyWindowIDDestroyed(const char* aTopic)
|
nsGlobalWindow::NotifyWindowIDDestroyed(const char* aTopic)
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> runnable = new WindowDestroyedEvent(this, mWindowID, aTopic);
|
nsCOMPtr<nsIRunnable> runnable = new WindowDestroyedEvent(this, mWindowID, aTopic);
|
||||||
nsresult rv = NS_DispatchToCurrentThread(runnable);
|
nsresult rv = NS_DispatchToCurrentThread(runnable);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
mNotifiedIDDestroyed = true;
|
mNotifiedIDDestroyed = true;
|
||||||
|
|||||||
2
dom/cache/FetchPut.cpp
vendored
2
dom/cache/FetchPut.cpp
vendored
@@ -162,7 +162,7 @@ FetchPut::DispatchToMainThread()
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(!mRunnable);
|
MOZ_ASSERT(!mRunnable);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable = new Runnable(this);
|
nsCOMPtr<nsIRunnable> runnable = new Runnable(this);
|
||||||
|
|
||||||
nsresult rv = NS_DispatchToMainThread(runnable, nsIThread::DISPATCH_NORMAL);
|
nsresult rv = NS_DispatchToMainThread(runnable, nsIThread::DISPATCH_NORMAL);
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static const TrackID TRACK_VIDEO = 2;
|
|||||||
void
|
void
|
||||||
FakeMediaStreamGraph::DispatchToMainThreadAfterStreamStateUpdate(already_AddRefed<nsIRunnable> aRunnable)
|
FakeMediaStreamGraph::DispatchToMainThreadAfterStreamStateUpdate(already_AddRefed<nsIRunnable> aRunnable)
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> task = aRunnable;
|
nsCOMPtr<nsIRunnable> task = aRunnable;
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ public:
|
|||||||
MediaStreamGraph* aGraph,
|
MediaStreamGraph* aGraph,
|
||||||
MediaStreamListener::MediaStreamGraphEvent event) MOZ_OVERRIDE {
|
MediaStreamListener::MediaStreamGraphEvent event) MOZ_OVERRIDE {
|
||||||
if (event == EVENT_FINISHED) {
|
if (event == EVENT_FINISHED) {
|
||||||
nsRefPtr<nsIRunnable> r = NS_NewRunnableMethod(
|
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(
|
||||||
this, &OutputStreamListener::DoNotifyFinished);
|
this, &OutputStreamListener::DoNotifyFinished);
|
||||||
aGraph->DispatchToMainThreadAfterStreamStateUpdate(r.forget());
|
aGraph->DispatchToMainThreadAfterStreamStateUpdate(r.forget());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ class MediaRecorder::Session: public nsIObserver
|
|||||||
LOG(PR_LOG_DEBUG, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown()));
|
LOG(PR_LOG_DEBUG, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown()));
|
||||||
if (!mSession->mEncoder->IsShutdown()) {
|
if (!mSession->mEncoder->IsShutdown()) {
|
||||||
mSession->Extract(false);
|
mSession->Extract(false);
|
||||||
nsRefPtr<nsIRunnable> event = new ExtractRunnable(mSession);
|
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(mSession);
|
||||||
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
|
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
|
||||||
NS_WARNING("Failed to dispatch ExtractRunnable to encoder thread");
|
NS_WARNING("Failed to dispatch ExtractRunnable to encoder thread");
|
||||||
}
|
}
|
||||||
@@ -612,7 +612,7 @@ private:
|
|||||||
// shutdown notification and stop Read Thread.
|
// shutdown notification and stop Read Thread.
|
||||||
nsContentUtils::RegisterShutdownObserver(this);
|
nsContentUtils::RegisterShutdownObserver(this);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> event = new ExtractRunnable(this);
|
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(this);
|
||||||
if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) {
|
if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) {
|
||||||
NS_WARNING("Failed to dispatch ExtractRunnable at beginning");
|
NS_WARNING("Failed to dispatch ExtractRunnable at beginning");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2234,7 +2234,7 @@ MediaStream::RunAfterPendingUpdates(already_AddRefed<nsIRunnable> aRunnable)
|
|||||||
NS_DispatchToCurrentThread(mRunnable);
|
NS_DispatchToCurrentThread(mRunnable);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
nsRefPtr<nsIRunnable> mRunnable;
|
nsCOMPtr<nsIRunnable> mRunnable;
|
||||||
};
|
};
|
||||||
|
|
||||||
graph->AppendMessage(new Message(this, runnable.forget()));
|
graph->AppendMessage(new Message(this, runnable.forget()));
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ CDMCallbackProxy::SetSessionId(uint32_t aToken,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task(new SetSessionIdTask(mProxy,
|
nsCOMPtr<nsIRunnable> task(new SetSessionIdTask(mProxy,
|
||||||
aToken,
|
aToken,
|
||||||
aSessionId));
|
aSessionId));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
@@ -82,7 +82,7 @@ CDMCallbackProxy::ResolveLoadSessionPromise(uint32_t aPromiseId, bool aSuccess)
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task(new LoadSessionTask(mProxy,
|
nsCOMPtr<nsIRunnable> task(new LoadSessionTask(mProxy,
|
||||||
aPromiseId,
|
aPromiseId,
|
||||||
aSuccess));
|
aSuccess));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
@@ -129,7 +129,7 @@ CDMCallbackProxy::RejectPromise(uint32_t aPromiseId,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = new RejectPromiseTask(mProxy,
|
task = new RejectPromiseTask(mProxy,
|
||||||
aPromiseId,
|
aPromiseId,
|
||||||
aException,
|
aException,
|
||||||
@@ -169,7 +169,7 @@ CDMCallbackProxy::SessionMessage(const nsCString& aSessionId,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = new SessionMessageTask(mProxy,
|
task = new SessionMessageTask(mProxy,
|
||||||
aSessionId,
|
aSessionId,
|
||||||
aMessageType,
|
aMessageType,
|
||||||
@@ -203,7 +203,7 @@ CDMCallbackProxy::ExpirationChange(const nsCString& aSessionId,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = new ExpirationChangeTask(mProxy,
|
task = new ExpirationChangeTask(mProxy,
|
||||||
aSessionId,
|
aSessionId,
|
||||||
aExpiryTime);
|
aExpiryTime);
|
||||||
@@ -215,7 +215,7 @@ CDMCallbackProxy::SessionClosed(const nsCString& aSessionId)
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
|
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
|
||||||
&CDMProxy::OnSessionClosed,
|
&CDMProxy::OnSessionClosed,
|
||||||
NS_ConvertUTF8toUTF16(aSessionId));
|
NS_ConvertUTF8toUTF16(aSessionId));
|
||||||
@@ -257,7 +257,7 @@ CDMCallbackProxy::SessionError(const nsCString& aSessionId,
|
|||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = new SessionErrorTask(mProxy,
|
task = new SessionErrorTask(mProxy,
|
||||||
aSessionId,
|
aSessionId,
|
||||||
aException,
|
aException,
|
||||||
@@ -281,7 +281,7 @@ CDMCallbackProxy::KeyStatusChanged(const nsCString& aSessionId,
|
|||||||
aStatus);
|
aStatus);
|
||||||
}
|
}
|
||||||
if (keyStatusesChange) {
|
if (keyStatusesChange) {
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
|
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
|
||||||
&CDMProxy::OnKeyStatusesChange,
|
&CDMProxy::OnKeyStatusesChange,
|
||||||
NS_ConvertUTF8toUTF16(aSessionId));
|
NS_ConvertUTF8toUTF16(aSessionId));
|
||||||
@@ -312,7 +312,7 @@ void
|
|||||||
CDMCallbackProxy::Terminated()
|
CDMCallbackProxy::Terminated()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
MOZ_ASSERT(mProxy->IsOnGMPThread());
|
||||||
nsRefPtr<nsIRunnable> task = NS_NewRunnableMethod(mProxy, &CDMProxy::Terminated);
|
nsCOMPtr<nsIRunnable> task = NS_NewRunnableMethod(mProxy, &CDMProxy::Terminated);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ private:
|
|||||||
|
|
||||||
nsTArray<WaitForKeys> mWaitForKeys;
|
nsTArray<WaitForKeys> mWaitForKeys;
|
||||||
|
|
||||||
nsTArray<nsRefPtr<nsIRunnable>> mWaitForCaps;
|
nsTArray<nsCOMPtr<nsIRunnable>> mWaitForCaps;
|
||||||
uint64_t mCaps;
|
uint64_t mCaps;
|
||||||
|
|
||||||
// It is not safe to copy this object.
|
// It is not safe to copy this object.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ CDMProxy::Init(PromiseId aPromiseId,
|
|||||||
data->mOrigin = aOrigin;
|
data->mOrigin = aOrigin;
|
||||||
data->mTopLevelOrigin = aTopLevelOrigin;
|
data->mTopLevelOrigin = aTopLevelOrigin;
|
||||||
data->mInPrivateBrowsing = aInPrivateBrowsing;
|
data->mInPrivateBrowsing = aInPrivateBrowsing;
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<InitData>>(this,
|
NS_NewRunnableMethodWithArg<nsAutoPtr<InitData>>(this,
|
||||||
&CDMProxy::gmp_Init,
|
&CDMProxy::gmp_Init,
|
||||||
data));
|
data));
|
||||||
@@ -118,7 +118,7 @@ CDMProxy::gmp_Init(nsAutoPtr<InitData> aData)
|
|||||||
} else {
|
} else {
|
||||||
mCallback = new CDMCallbackProxy(this);
|
mCallback = new CDMCallbackProxy(this);
|
||||||
mCDM->Init(mCallback);
|
mCDM->Init(mCallback);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<uint32_t>(this,
|
NS_NewRunnableMethodWithArg<uint32_t>(this,
|
||||||
&CDMProxy::OnCDMCreated,
|
&CDMProxy::OnCDMCreated,
|
||||||
aData->mPromiseId));
|
aData->mPromiseId));
|
||||||
@@ -154,7 +154,7 @@ CDMProxy::CreateSession(uint32_t aCreateSessionToken,
|
|||||||
data->mInitDataType = NS_ConvertUTF16toUTF8(aInitDataType);
|
data->mInitDataType = NS_ConvertUTF16toUTF8(aInitDataType);
|
||||||
data->mInitData = Move(aInitData);
|
data->mInitData = Move(aInitData);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<CreateSessionData>>(this, &CDMProxy::gmp_CreateSession, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<CreateSessionData>>(this, &CDMProxy::gmp_CreateSession, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ CDMProxy::LoadSession(PromiseId aPromiseId,
|
|||||||
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
||||||
data->mPromiseId = aPromiseId;
|
data->mPromiseId = aPromiseId;
|
||||||
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_LoadSession, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_LoadSession, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ CDMProxy::SetServerCertificate(PromiseId aPromiseId,
|
|||||||
nsAutoPtr<SetServerCertificateData> data;
|
nsAutoPtr<SetServerCertificateData> data;
|
||||||
data->mPromiseId = aPromiseId;
|
data->mPromiseId = aPromiseId;
|
||||||
data->mCert = Move(aCert);
|
data->mCert = Move(aCert);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<SetServerCertificateData>>(this, &CDMProxy::gmp_SetServerCertificate, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<SetServerCertificateData>>(this, &CDMProxy::gmp_SetServerCertificate, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ CDMProxy::UpdateSession(const nsAString& aSessionId,
|
|||||||
data->mPromiseId = aPromiseId;
|
data->mPromiseId = aPromiseId;
|
||||||
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
||||||
data->mResponse = Move(aResponse);
|
data->mResponse = Move(aResponse);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<UpdateSessionData>>(this, &CDMProxy::gmp_UpdateSession, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<UpdateSessionData>>(this, &CDMProxy::gmp_UpdateSession, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ CDMProxy::CloseSession(const nsAString& aSessionId,
|
|||||||
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
||||||
data->mPromiseId = aPromiseId;
|
data->mPromiseId = aPromiseId;
|
||||||
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_CloseSession, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_CloseSession, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ CDMProxy::RemoveSession(const nsAString& aSessionId,
|
|||||||
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
nsAutoPtr<SessionOpData> data(new SessionOpData());
|
||||||
data->mPromiseId = aPromiseId;
|
data->mPromiseId = aPromiseId;
|
||||||
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_RemoveSession, data));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_RemoveSession, data));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ CDMProxy::Shutdown()
|
|||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
mKeys.Clear();
|
mKeys.Clear();
|
||||||
// Note: This may end up being the last owning reference to the CDMProxy.
|
// Note: This may end up being the last owning reference to the CDMProxy.
|
||||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(this, &CDMProxy::gmp_Shutdown));
|
nsCOMPtr<nsIRunnable> task(NS_NewRunnableMethod(this, &CDMProxy::gmp_Shutdown));
|
||||||
if (mGMPThread) {
|
if (mGMPThread) {
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,7 @@ CDMProxy::RejectPromise(PromiseId aId, nsresult aCode)
|
|||||||
mKeys->RejectPromise(aId, aCode);
|
mKeys->RejectPromise(aId, aCode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> task(new RejectPromiseTask(this, aId, aCode));
|
nsCOMPtr<nsIRunnable> task(new RejectPromiseTask(this, aId, aCode));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,7 +372,7 @@ CDMProxy::ResolvePromise(PromiseId aId)
|
|||||||
NS_WARNING("CDMProxy unable to resolve promise!");
|
NS_WARNING("CDMProxy unable to resolve promise!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethodWithArg<PromiseId>(this,
|
task = NS_NewRunnableMethodWithArg<PromiseId>(this,
|
||||||
&CDMProxy::ResolvePromise,
|
&CDMProxy::ResolvePromise,
|
||||||
aId);
|
aId);
|
||||||
@@ -525,7 +525,7 @@ CDMProxy::Decrypt(mp4_demuxer::MP4Sample* aSample,
|
|||||||
DecryptionClient* aClient)
|
DecryptionClient* aClient)
|
||||||
{
|
{
|
||||||
nsAutoPtr<DecryptJob> job(new DecryptJob(aSample, aClient));
|
nsAutoPtr<DecryptJob> job(new DecryptJob(aSample, aClient));
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethodWithArg<nsAutoPtr<DecryptJob>>(this, &CDMProxy::gmp_Decrypt, job));
|
NS_NewRunnableMethodWithArg<nsAutoPtr<DecryptJob>>(this, &CDMProxy::gmp_Decrypt, job));
|
||||||
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ MP4Decoder::SetCDMProxy(CDMProxy* aProxy)
|
|||||||
// and the CDMProxy knows the capabilities of the CDM. The MP4Reader
|
// and the CDMProxy knows the capabilities of the CDM. The MP4Reader
|
||||||
// remains in "waiting for resources" state until then.
|
// remains in "waiting for resources" state until then.
|
||||||
CDMCaps::AutoLock caps(aProxy->Capabilites());
|
CDMCaps::AutoLock caps(aProxy->Capabilites());
|
||||||
nsRefPtr<nsIRunnable> task(
|
nsCOMPtr<nsIRunnable> task(
|
||||||
NS_NewRunnableMethod(this, &MediaDecoder::NotifyWaitingForResourcesStatusChanged));
|
NS_NewRunnableMethod(this, &MediaDecoder::NotifyWaitingForResourcesStatusChanged));
|
||||||
caps.CallOnMainThreadWhenCapsAvailable(task);
|
caps.CallOnMainThreadWhenCapsAvailable(task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ AppleDecoderModule::CanDecode()
|
|||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
Init();
|
Init();
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> task(new InitTask());
|
nsCOMPtr<nsIRunnable> task(new InitTask());
|
||||||
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
|
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ AppleDecoderModule::Startup()
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task(new LinkTask());
|
nsCOMPtr<nsIRunnable> task(new LinkTask());
|
||||||
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
|
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -152,7 +152,7 @@ public:
|
|||||||
nsresult
|
nsresult
|
||||||
AppleDecoderModule::Shutdown()
|
AppleDecoderModule::Shutdown()
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> task(new UnlinkTask());
|
nsCOMPtr<nsIRunnable> task(new UnlinkTask());
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ MediaDataDecoderProxy::Input(mp4_demuxer::MP4Sample* aSample)
|
|||||||
MOZ_ASSERT(!IsOnProxyThread());
|
MOZ_ASSERT(!IsOnProxyThread());
|
||||||
MOZ_ASSERT(!mIsShutdown);
|
MOZ_ASSERT(!mIsShutdown);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task(new InputTask(mProxyDecoder, aSample));
|
nsCOMPtr<nsIRunnable> task(new InputTask(mProxyDecoder, aSample));
|
||||||
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ MediaDataDecoderProxy::Flush()
|
|||||||
|
|
||||||
mFlushComplete.Set(false);
|
mFlushComplete.Set(false);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Flush);
|
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Flush);
|
||||||
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
@@ -69,7 +69,7 @@ MediaDataDecoderProxy::Drain()
|
|||||||
MOZ_ASSERT(!IsOnProxyThread());
|
MOZ_ASSERT(!IsOnProxyThread());
|
||||||
MOZ_ASSERT(!mIsShutdown);
|
MOZ_ASSERT(!mIsShutdown);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Drain);
|
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Drain);
|
||||||
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
@@ -84,7 +84,7 @@ MediaDataDecoderProxy::Shutdown()
|
|||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
mIsShutdown = true;
|
mIsShutdown = true;
|
||||||
#endif
|
#endif
|
||||||
nsRefPtr<nsIRunnable> task;
|
nsCOMPtr<nsIRunnable> task;
|
||||||
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Shutdown);
|
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Shutdown);
|
||||||
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_SYNC);
|
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_SYNC);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ GeckoMediaPluginService::AsyncShutdownComplete(GMPParent* aParent)
|
|||||||
if (mAsyncShutdownPlugins.IsEmpty() && mShuttingDownOnGMPThread) {
|
if (mAsyncShutdownPlugins.IsEmpty() && mShuttingDownOnGMPThread) {
|
||||||
// The main thread may be waiting for async shutdown of plugins,
|
// The main thread may be waiting for async shutdown of plugins,
|
||||||
// which has completed. Break the main thread out of its waiting loop.
|
// which has completed. Break the main thread out of its waiting loop.
|
||||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
nsCOMPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
||||||
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
@@ -592,7 +592,7 @@ GeckoMediaPluginService::UnloadPlugins()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mAsyncShutdownPlugins.IsEmpty()) {
|
if (mAsyncShutdownPlugins.IsEmpty()) {
|
||||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
nsCOMPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
||||||
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,8 +221,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~GMPShutdownObserver() {}
|
virtual ~GMPShutdownObserver() {}
|
||||||
nsRefPtr<nsIRunnable> mShutdownTask;
|
nsCOMPtr<nsIRunnable> mShutdownTask;
|
||||||
nsRefPtr<nsIRunnable> mContinuation;
|
nsCOMPtr<nsIRunnable> mContinuation;
|
||||||
const nsString mNodeId;
|
const nsString mNodeId;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~ClearGMPStorageTask() {}
|
virtual ~ClearGMPStorageTask() {}
|
||||||
nsRefPtr<nsIRunnable> mContinuation;
|
nsCOMPtr<nsIRunnable> mContinuation;
|
||||||
nsCOMPtr<nsIThread> mTarget;
|
nsCOMPtr<nsIThread> mTarget;
|
||||||
const PRTime mSince;
|
const PRTime mSince;
|
||||||
};
|
};
|
||||||
@@ -1093,7 +1093,7 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
|
|||||||
bool matches = mExpected[0].mMessage.Equals(msg);
|
bool matches = mExpected[0].mMessage.Equals(msg);
|
||||||
EXPECT_STREQ(mExpected[0].mMessage.get(), msg.get());
|
EXPECT_STREQ(mExpected[0].mMessage.get(), msg.get());
|
||||||
if (mExpected.Length() > 0 && matches) {
|
if (mExpected.Length() > 0 && matches) {
|
||||||
nsRefPtr<nsIRunnable> continuation = mExpected[0].mContinuation;
|
nsCOMPtr<nsIRunnable> continuation = mExpected[0].mContinuation;
|
||||||
mExpected.RemoveElementAt(0);
|
mExpected.RemoveElementAt(0);
|
||||||
if (continuation) {
|
if (continuation) {
|
||||||
NS_DispatchToCurrentThread(continuation);
|
NS_DispatchToCurrentThread(continuation);
|
||||||
@@ -1134,7 +1134,7 @@ private:
|
|||||||
, mContinuation(aContinuation)
|
, mContinuation(aContinuation)
|
||||||
{}
|
{}
|
||||||
nsCString mMessage;
|
nsCString mMessage;
|
||||||
nsRefPtr<nsIRunnable> mContinuation;
|
nsCOMPtr<nsIRunnable> mContinuation;
|
||||||
};
|
};
|
||||||
|
|
||||||
nsTArray<ExpectedMessage> mExpected;
|
nsTArray<ExpectedMessage> mExpected;
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ MediaSource::QueueInitializationEvent()
|
|||||||
}
|
}
|
||||||
mFirstSourceBufferInitialized = true;
|
mFirstSourceBufferInitialized = true;
|
||||||
MSE_DEBUG("");
|
MSE_DEBUG("");
|
||||||
nsRefPtr<nsIRunnable> task =
|
nsCOMPtr<nsIRunnable> task =
|
||||||
NS_NewRunnableMethod(this, &MediaSource::InitializationEvent);
|
NS_NewRunnableMethod(this, &MediaSource::InitializationEvent);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ MediaSourceDecoder::ScheduleDurationChange(double aOldDuration,
|
|||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
DurationChanged(aOldDuration, aNewDuration);
|
DurationChanged(aOldDuration, aNewDuration);
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> task =
|
nsCOMPtr<nsIRunnable> task =
|
||||||
new DurationChangedRunnable(this, aOldDuration, aNewDuration);
|
new DurationChangedRunnable(this, aOldDuration, aNewDuration);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ SourceBuffer::Remove(double aStart, double aEnd, ErrorResult& aRv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
StartUpdating();
|
StartUpdating();
|
||||||
nsRefPtr<nsIRunnable> task = new RangeRemovalRunnable(this, aStart, aEnd);
|
nsCOMPtr<nsIRunnable> task = new RangeRemovalRunnable(this, aStart, aEnd);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ SourceBuffer::RangeRemoval(double aStart, double aEnd)
|
|||||||
{
|
{
|
||||||
StartUpdating();
|
StartUpdating();
|
||||||
DoRangeRemoval(aStart, aEnd);
|
DoRangeRemoval(aStart, aEnd);
|
||||||
nsRefPtr<nsIRunnable> task =
|
nsCOMPtr<nsIRunnable> task =
|
||||||
NS_NewRunnableMethod(this, &SourceBuffer::StopUpdating);
|
NS_NewRunnableMethod(this, &SourceBuffer::StopUpdating);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
@@ -432,7 +432,7 @@ SourceBuffer::AppendData(const uint8_t* aData, uint32_t aLength, ErrorResult& aR
|
|||||||
|
|
||||||
MOZ_ASSERT(mAppendMode == SourceBufferAppendMode::Segments,
|
MOZ_ASSERT(mAppendMode == SourceBufferAppendMode::Segments,
|
||||||
"We don't handle timestampOffset for sequence mode yet");
|
"We don't handle timestampOffset for sequence mode yet");
|
||||||
nsRefPtr<nsIRunnable> task =
|
nsCOMPtr<nsIRunnable> task =
|
||||||
new AppendDataRunnable(this, data, mTimestampOffset, mUpdateID);
|
new AppendDataRunnable(this, data, mTimestampOffset, mUpdateID);
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
|
|||||||
// Remove one instance of 'dest' from mOutputNodes. There could be
|
// Remove one instance of 'dest' from mOutputNodes. There could be
|
||||||
// others, and it's not correct to remove them all since some of them
|
// others, and it's not correct to remove them all since some of them
|
||||||
// could be for different output ports.
|
// could be for different output ports.
|
||||||
nsRefPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new RunnableRelease(mOutputNodes[i].forget());
|
new RunnableRelease(mOutputNodes[i].forget());
|
||||||
mOutputNodes.RemoveElementAt(i);
|
mOutputNodes.RemoveElementAt(i);
|
||||||
mStream->RunAfterPendingUpdates(runnable.forget());
|
mStream->RunAfterPendingUpdates(runnable.forget());
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ bool
|
|||||||
Promise::PerformMicroTaskCheckpoint()
|
Promise::PerformMicroTaskCheckpoint()
|
||||||
{
|
{
|
||||||
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
|
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
|
||||||
nsTArray<nsRefPtr<nsIRunnable>>& microtaskQueue =
|
nsTArray<nsCOMPtr<nsIRunnable>>& microtaskQueue =
|
||||||
runtime->GetPromiseMicroTaskQueue();
|
runtime->GetPromiseMicroTaskQueue();
|
||||||
|
|
||||||
if (microtaskQueue.IsEmpty()) {
|
if (microtaskQueue.IsEmpty()) {
|
||||||
@@ -427,7 +427,7 @@ Promise::PerformMicroTaskCheckpoint()
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
nsRefPtr<nsIRunnable> runnable = microtaskQueue.ElementAt(0);
|
nsCOMPtr<nsIRunnable> runnable = microtaskQueue.ElementAt(0);
|
||||||
MOZ_ASSERT(runnable);
|
MOZ_ASSERT(runnable);
|
||||||
|
|
||||||
// This function can re-enter, so we remove the element before calling.
|
// This function can re-enter, so we remove the element before calling.
|
||||||
@@ -1065,7 +1065,7 @@ Promise::DispatchToMicroTask(nsIRunnable* aRunnable)
|
|||||||
MOZ_ASSERT(aRunnable);
|
MOZ_ASSERT(aRunnable);
|
||||||
|
|
||||||
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
|
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
|
||||||
nsTArray<nsRefPtr<nsIRunnable>>& microtaskQueue =
|
nsTArray<nsCOMPtr<nsIRunnable>>& microtaskQueue =
|
||||||
runtime->GetPromiseMicroTaskQueue();
|
runtime->GetPromiseMicroTaskQueue();
|
||||||
|
|
||||||
microtaskQueue.AppendElement(aRunnable);
|
microtaskQueue.AppendElement(aRunnable);
|
||||||
|
|||||||
@@ -1297,7 +1297,7 @@ ServiceWorkerManager::GetRegistrations(nsIDOMWindow* aWindow,
|
|||||||
return result.ErrorCode();
|
return result.ErrorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new GetRegistrationsRunnable(window, promise);
|
new GetRegistrationsRunnable(window, promise);
|
||||||
promise.forget(aPromise);
|
promise.forget(aPromise);
|
||||||
return NS_DispatchToCurrentThread(runnable);
|
return NS_DispatchToCurrentThread(runnable);
|
||||||
@@ -1398,7 +1398,7 @@ ServiceWorkerManager::GetRegistration(nsIDOMWindow* aWindow,
|
|||||||
return result.ErrorCode();
|
return result.ErrorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new GetRegistrationRunnable(window, promise, aDocumentURL);
|
new GetRegistrationRunnable(window, promise, aDocumentURL);
|
||||||
promise.forget(aPromise);
|
promise.forget(aPromise);
|
||||||
return NS_DispatchToCurrentThread(runnable);
|
return NS_DispatchToCurrentThread(runnable);
|
||||||
@@ -1464,7 +1464,7 @@ ServiceWorkerManager::GetReadyPromise(nsIDOMWindow* aWindow,
|
|||||||
return result.ErrorCode();
|
return result.ErrorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new GetReadyPromiseRunnable(window, promise);
|
new GetReadyPromiseRunnable(window, promise);
|
||||||
promise.forget(aPromise);
|
promise.forget(aPromise);
|
||||||
return NS_DispatchToCurrentThread(runnable);
|
return NS_DispatchToCurrentThread(runnable);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ private:
|
|||||||
|
|
||||||
RefPtr<AndroidNativeWindow> mNativeWindow;
|
RefPtr<AndroidNativeWindow> mNativeWindow;
|
||||||
int mID;
|
int mID;
|
||||||
nsRefPtr<nsIRunnable> mFrameAvailableCallback;
|
nsCOMPtr<nsIRunnable> mFrameAvailableCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ VsyncParent::NotifyVsync(TimeStamp aTimeStamp)
|
|||||||
{
|
{
|
||||||
// Called on hardware vsync thread. We should post to current ipc thread.
|
// Called on hardware vsync thread. We should post to current ipc thread.
|
||||||
MOZ_ASSERT(!IsOnBackgroundThread());
|
MOZ_ASSERT(!IsOnBackgroundThread());
|
||||||
nsRefPtr<nsIRunnable> vsyncEvent =
|
nsCOMPtr<nsIRunnable> vsyncEvent =
|
||||||
NS_NewRunnableMethodWithArg<TimeStamp>(this,
|
NS_NewRunnableMethodWithArg<TimeStamp>(this,
|
||||||
&VsyncParent::DispatchVsyncEvent,
|
&VsyncParent::DispatchVsyncEvent,
|
||||||
aTimeStamp);
|
aTimeStamp);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ private:
|
|||||||
// ready to go, since blocking on this init is just begging for deadlock.
|
// ready to go, since blocking on this init is just begging for deadlock.
|
||||||
nsCOMPtr<mozIGeckoMediaPluginService> mGMPService;
|
nsCOMPtr<mozIGeckoMediaPluginService> mGMPService;
|
||||||
bool mGMPReady;
|
bool mGMPReady;
|
||||||
nsTArray<nsRefPtr<nsIRunnable>> mQueuedJSEPOperations;
|
nsTArray<nsCOMPtr<nsIRunnable>> mQueuedJSEPOperations;
|
||||||
|
|
||||||
static PeerConnectionCtx *gInstance;
|
static PeerConnectionCtx *gInstance;
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ PeerConnectionMedia::StartIceChecks(const JsepSession& session) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable(
|
nsCOMPtr<nsIRunnable> runnable(
|
||||||
WrapRunnable(
|
WrapRunnable(
|
||||||
RefPtr<PeerConnectionMedia>(this),
|
RefPtr<PeerConnectionMedia>(this),
|
||||||
&PeerConnectionMedia::StartIceChecks_s,
|
&PeerConnectionMedia::StartIceChecks_s,
|
||||||
@@ -516,7 +516,7 @@ void
|
|||||||
PeerConnectionMedia::GatherIfReady() {
|
PeerConnectionMedia::GatherIfReady() {
|
||||||
ASSERT_ON_THREAD(mMainThread);
|
ASSERT_ON_THREAD(mMainThread);
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> runnable(WrapRunnable(
|
nsCOMPtr<nsIRunnable> runnable(WrapRunnable(
|
||||||
RefPtr<PeerConnectionMedia>(this),
|
RefPtr<PeerConnectionMedia>(this),
|
||||||
&PeerConnectionMedia::EnsureIceGathering_s));
|
&PeerConnectionMedia::EnsureIceGathering_s));
|
||||||
|
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ class PeerConnectionMedia : public sigslot::has_slots<> {
|
|||||||
// on our ICE ctx, but are not ready to do so at the moment (eg; we are
|
// on our ICE ctx, but are not ready to do so at the moment (eg; we are
|
||||||
// waiting to get a callback with our http proxy config before we start
|
// waiting to get a callback with our http proxy config before we start
|
||||||
// gathering or start checking)
|
// gathering or start checking)
|
||||||
std::vector<nsRefPtr<nsIRunnable>> mQueuedIceCtxOperations;
|
std::vector<nsCOMPtr<nsIRunnable>> mQueuedIceCtxOperations;
|
||||||
|
|
||||||
// Used to cancel any ongoing proxy request.
|
// Used to cancel any ongoing proxy request.
|
||||||
nsCOMPtr<nsICancelable> mProxyRequest;
|
nsCOMPtr<nsICancelable> mProxyRequest;
|
||||||
|
|||||||
@@ -296,6 +296,6 @@ NetworkActivityMonitor::DataInOut(Direction direction)
|
|||||||
void
|
void
|
||||||
NetworkActivityMonitor::PostNotification(Direction direction)
|
NetworkActivityMonitor::PostNotification(Direction direction)
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> ev = new NotifyNetworkActivity(direction);
|
nsCOMPtr<nsIRunnable> ev = new NotifyNetworkActivity(direction);
|
||||||
NS_DispatchToMainThread(ev);
|
NS_DispatchToMainThread(ev);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ OfflineObserver::RegisterOfflineObserver()
|
|||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
RegisterOfflineObserverMainThread();
|
RegisterOfflineObserverMainThread();
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> event =
|
nsCOMPtr<nsIRunnable> event =
|
||||||
NS_NewRunnableMethod(this, &OfflineObserver::RegisterOfflineObserverMainThread);
|
NS_NewRunnableMethod(this, &OfflineObserver::RegisterOfflineObserverMainThread);
|
||||||
NS_DispatchToMainThread(event);
|
NS_DispatchToMainThread(event);
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ OfflineObserver::RemoveOfflineObserver()
|
|||||||
if (NS_IsMainThread()) {
|
if (NS_IsMainThread()) {
|
||||||
RemoveOfflineObserverMainThread();
|
RemoveOfflineObserverMainThread();
|
||||||
} else {
|
} else {
|
||||||
nsRefPtr<nsIRunnable> event =
|
nsCOMPtr<nsIRunnable> event =
|
||||||
NS_NewRunnableMethod(this, &OfflineObserver::RemoveOfflineObserverMainThread);
|
NS_NewRunnableMethod(this, &OfflineObserver::RemoveOfflineObserverMainThread);
|
||||||
NS_DispatchToMainThread(event);
|
NS_DispatchToMainThread(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Tickler::~Tickler()
|
|||||||
|
|
||||||
// Shutting down a thread can spin the event loop - which is a surprising
|
// Shutting down a thread can spin the event loop - which is a surprising
|
||||||
// thing to do from a dtor. Running it on its own event is safer.
|
// thing to do from a dtor. Running it on its own event is safer.
|
||||||
nsRefPtr<nsIRunnable> event = new TicklerThreadDestructor(mThread);
|
nsCOMPtr<nsIRunnable> event = new TicklerThreadDestructor(mThread);
|
||||||
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
|
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
|
||||||
mThread->Shutdown();
|
mThread->Shutdown();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ nsAsyncRedirectVerifyHelper::ExplicitCallback(nsresult result)
|
|||||||
mWaitingForRedirectCallback = false;
|
mWaitingForRedirectCallback = false;
|
||||||
|
|
||||||
// Now, dispatch the callback on the event-target which called Init()
|
// Now, dispatch the callback on the event-target which called Init()
|
||||||
nsRefPtr<nsIRunnable> event =
|
nsCOMPtr<nsIRunnable> event =
|
||||||
new nsAsyncVerifyRedirectCallbackEvent(callback, result);
|
new nsAsyncVerifyRedirectCallbackEvent(callback, result);
|
||||||
if (!event) {
|
if (!event) {
|
||||||
NS_WARNING("nsAsyncRedirectVerifyHelper::ExplicitCallback() "
|
NS_WARNING("nsAsyncRedirectVerifyHelper::ExplicitCallback() "
|
||||||
|
|||||||
2
netwerk/cache/nsCacheEntryDescriptor.cpp
vendored
2
netwerk/cache/nsCacheEntryDescriptor.cpp
vendored
@@ -536,7 +536,7 @@ nsCacheEntryDescriptor::AsyncDoom(nsICacheListener *listener)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> event = new nsAsyncDoomEvent(this, listener);
|
nsCOMPtr<nsIRunnable> event = new nsAsyncDoomEvent(this, listener);
|
||||||
return nsCacheService::DispatchToCacheIOThread(event);
|
return nsCacheService::DispatchToCacheIOThread(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
2
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
@@ -757,7 +757,7 @@ nsApplicationCache::Discard()
|
|||||||
|
|
||||||
mValid = false;
|
mValid = false;
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> ev =
|
nsCOMPtr<nsIRunnable> ev =
|
||||||
new nsOfflineCacheDiscardCache(mDevice, mGroup, mClientID);
|
new nsOfflineCacheDiscardCache(mDevice, mGroup, mClientID);
|
||||||
nsresult rv = nsCacheService::DispatchToCacheIOThread(ev);
|
nsresult rv = nsCacheService::DispatchToCacheIOThread(ev);
|
||||||
return rv;
|
return rv;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ void CacheIOThread::LoopOneLevel(uint32_t aLevel)
|
|||||||
eventtracer::AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone,
|
eventtracer::AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone,
|
||||||
sLevelTraceName[aLevel]);
|
sLevelTraceName[aLevel]);
|
||||||
|
|
||||||
nsTArray<nsRefPtr<nsIRunnable> > events;
|
nsTArray<nsCOMPtr<nsIRunnable> > events;
|
||||||
events.SwapElements(mEventQueue[aLevel]);
|
events.SwapElements(mEventQueue[aLevel]);
|
||||||
uint32_t length = events.Length();
|
uint32_t length = events.Length();
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ private:
|
|||||||
nsCOMPtr<nsIThread> mXPCOMThread;
|
nsCOMPtr<nsIThread> mXPCOMThread;
|
||||||
uint32_t mLowestLevelWaiting;
|
uint32_t mLowestLevelWaiting;
|
||||||
uint32_t mCurrentlyExecutingLevel;
|
uint32_t mCurrentlyExecutingLevel;
|
||||||
nsTArray<nsRefPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
|
nsTArray<nsCOMPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
|
||||||
|
|
||||||
bool mHasXPCOMEvents;
|
bool mHasXPCOMEvents;
|
||||||
bool mRerunCurrentEvent;
|
bool mRerunCurrentEvent;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ nsHttpActivityDistributor::ObserveActivity(nsISupports *aHttpChannel,
|
|||||||
uint64_t aExtraSizeData,
|
uint64_t aExtraSizeData,
|
||||||
const nsACString & aExtraStringData)
|
const nsACString & aExtraStringData)
|
||||||
{
|
{
|
||||||
nsRefPtr<nsIRunnable> event;
|
nsCOMPtr<nsIRunnable> event;
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(mLock);
|
MutexAutoLock lock(mLock);
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ nsHttpConnectionMgr::PostEvent(nsConnEventHandler handler, int32_t iparam, void
|
|||||||
rv = NS_ERROR_NOT_INITIALIZED;
|
rv = NS_ERROR_NOT_INITIALIZED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nsRefPtr<nsIRunnable> event = new nsConnEvent(this, handler, iparam, vparam);
|
nsCOMPtr<nsIRunnable> event = new nsConnEvent(this, handler, iparam, vparam);
|
||||||
rv = mSocketThreadTarget->Dispatch(event, NS_DISPATCH_NORMAL);
|
rv = mSocketThreadTarget->Dispatch(event, NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
@@ -2376,7 +2376,7 @@ nsHttpConnectionMgr::OnMsgShutdown(int32_t, void *param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// signal shutdown complete
|
// signal shutdown complete
|
||||||
nsRefPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new nsConnEvent(this, &nsHttpConnectionMgr::OnMsgShutdownConfirm,
|
new nsConnEvent(this, &nsHttpConnectionMgr::OnMsgShutdownConfirm,
|
||||||
0, param);
|
0, param);
|
||||||
NS_DispatchToMainThread(runnable);
|
NS_DispatchToMainThread(runnable);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ extern "C" {
|
|||||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||||
|
|
||||||
jclass foundClass;
|
jclass foundClass;
|
||||||
nsRefPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
|
nsCOMPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
|
||||||
&foundClass));
|
&foundClass));
|
||||||
mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC);
|
mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC);
|
||||||
if (!foundClass)
|
if (!foundClass)
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ nsMemoryPressureWatcher::Observe(nsISupports* aSubject, const char* aTopic,
|
|||||||
MOZ_ASSERT(!strcmp(aTopic, "memory-pressure"), "Unknown topic");
|
MOZ_ASSERT(!strcmp(aTopic, "memory-pressure"), "Unknown topic");
|
||||||
|
|
||||||
if (sFreeDirtyPages) {
|
if (sFreeDirtyPages) {
|
||||||
nsRefPtr<nsIRunnable> runnable = new nsJemallocFreeDirtyPagesRunnable();
|
nsCOMPtr<nsIRunnable> runnable = new nsJemallocFreeDirtyPagesRunnable();
|
||||||
|
|
||||||
NS_DispatchToMainThread(runnable);
|
NS_DispatchToMainThread(runnable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -937,7 +937,7 @@ CycleCollectedJSRuntime::SetPendingException(nsIException* aException)
|
|||||||
mPendingException = aException;
|
mPendingException = aException;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsTArray<nsRefPtr<nsIRunnable>>&
|
nsTArray<nsCOMPtr<nsIRunnable>>&
|
||||||
CycleCollectedJSRuntime::GetPromiseMicroTaskQueue()
|
CycleCollectedJSRuntime::GetPromiseMicroTaskQueue()
|
||||||
{
|
{
|
||||||
return mPromiseMicroTaskQueue;
|
return mPromiseMicroTaskQueue;
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ public:
|
|||||||
already_AddRefed<nsIException> GetPendingException() const;
|
already_AddRefed<nsIException> GetPendingException() const;
|
||||||
void SetPendingException(nsIException* aException);
|
void SetPendingException(nsIException* aException);
|
||||||
|
|
||||||
nsTArray<nsRefPtr<nsIRunnable>>& GetPromiseMicroTaskQueue();
|
nsTArray<nsCOMPtr<nsIRunnable>>& GetPromiseMicroTaskQueue();
|
||||||
|
|
||||||
nsCycleCollectionParticipant* GCThingParticipant();
|
nsCycleCollectionParticipant* GCThingParticipant();
|
||||||
nsCycleCollectionParticipant* ZoneParticipant();
|
nsCycleCollectionParticipant* ZoneParticipant();
|
||||||
@@ -309,7 +309,7 @@ private:
|
|||||||
|
|
||||||
nsCOMPtr<nsIException> mPendingException;
|
nsCOMPtr<nsIException> mPendingException;
|
||||||
|
|
||||||
nsTArray<nsRefPtr<nsIRunnable>> mPromiseMicroTaskQueue;
|
nsTArray<nsCOMPtr<nsIRunnable>> mPromiseMicroTaskQueue;
|
||||||
|
|
||||||
OOMState mOutOfMemoryState;
|
OOMState mOutOfMemoryState;
|
||||||
OOMState mLargeAllocationFailureState;
|
OOMState mLargeAllocationFailureState;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ NS_ProxyRelease(nsIEventTarget* aTarget, nsISupports* aDoomed,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> ev = new nsProxyReleaseEvent(aDoomed);
|
nsCOMPtr<nsIRunnable> ev = new nsProxyReleaseEvent(aDoomed);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
// we do not release aDoomed here since it may cause a delete on the
|
// we do not release aDoomed here since it may cause a delete on the
|
||||||
// wrong thread. better to leak than crash.
|
// wrong thread. better to leak than crash.
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ nsInputStreamTee::TeeSegment(const char* aBuf, uint32_t aCount)
|
|||||||
if (!SinkIsValid()) {
|
if (!SinkIsValid()) {
|
||||||
return NS_OK; // nothing to do
|
return NS_OK; // nothing to do
|
||||||
}
|
}
|
||||||
nsRefPtr<nsIRunnable> event =
|
nsCOMPtr<nsIRunnable> event =
|
||||||
new nsInputStreamTeeWriteEvent(aBuf, aCount, mSink, this);
|
new nsInputStreamTeeWriteEvent(aBuf, aCount, mSink, this);
|
||||||
LOG(("nsInputStreamTee::TeeSegment [%p] dispatching write %u bytes\n",
|
LOG(("nsInputStreamTee::TeeSegment [%p] dispatching write %u bytes\n",
|
||||||
this, aCount));
|
this, aCount));
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void
|
|||||||
nsEventQueue::PutEvent(nsIRunnable* aRunnable)
|
nsEventQueue::PutEvent(nsIRunnable* aRunnable)
|
||||||
{
|
{
|
||||||
// Avoid calling AddRef+Release while holding our monitor.
|
// Avoid calling AddRef+Release while holding our monitor.
|
||||||
nsRefPtr<nsIRunnable> event(aRunnable);
|
nsCOMPtr<nsIRunnable> event(aRunnable);
|
||||||
|
|
||||||
if (ChaosMode::isActive(ChaosMode::ThreadScheduling)) {
|
if (ChaosMode::isActive(ChaosMode::ThreadScheduling)) {
|
||||||
// With probability 0.5, yield so other threads have a chance to
|
// With probability 0.5, yield so other threads have a chance to
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ nsThread::DispatchInternal(nsIRunnable* aEvent, uint32_t aFlags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_TASK_TRACER
|
#ifdef MOZ_TASK_TRACER
|
||||||
nsRefPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(aEvent);
|
nsCOMPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(aEvent);
|
||||||
aEvent = tracedRunnable;
|
aEvent = tracedRunnable;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ nsThreadPool::PutEvent(nsIRunnable* aEvent)
|
|||||||
// of nsStreamCopier. To prevent this situation, dispatch a shutdown event
|
// of nsStreamCopier. To prevent this situation, dispatch a shutdown event
|
||||||
// to the current thread instead of calling nsIThread::Shutdown() directly.
|
// to the current thread instead of calling nsIThread::Shutdown() directly.
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> r = NS_NewRunnableMethod(thread,
|
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(thread,
|
||||||
&nsIThread::Shutdown);
|
&nsIThread::Shutdown);
|
||||||
NS_DispatchToCurrentThread(r);
|
NS_DispatchToCurrentThread(r);
|
||||||
} else {
|
} else {
|
||||||
@@ -142,7 +142,7 @@ nsThreadPool::ShutdownThread(nsIThread* aThread)
|
|||||||
|
|
||||||
MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
|
MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
|
||||||
|
|
||||||
nsRefPtr<nsIRunnable> r = NS_NewRunnableMethod(aThread, &nsIThread::Shutdown);
|
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(aThread, &nsIThread::Shutdown);
|
||||||
NS_DispatchToMainThread(r);
|
NS_DispatchToMainThread(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user