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:
Daniel Holbert
2015-03-17 09:29:17 -07:00
parent d95d8b48ab
commit ddb04a0443
48 changed files with 90 additions and 90 deletions

View File

@@ -1406,7 +1406,7 @@ nsSHistory::RemoveEntries(nsTArray<uint64_t>& aIDs, int32_t aStartIndex)
--index;
}
if (didRemove && mRootDocShell) {
nsRefPtr<nsIRunnable> ev =
nsCOMPtr<nsIRunnable> ev =
NS_NewRunnableMethod(static_cast<nsDocShell*>(mRootDocShell),
&nsDocShell::FireDummyOnLocationChange);
NS_DispatchToCurrentThread(ev);

View File

@@ -4412,7 +4412,7 @@ nsDocument::SetStyleSheetApplicableState(nsIStyleSheet* aSheet,
}
if (!mSSApplicableStateNotificationPending) {
nsRefPtr<nsIRunnable> notification = NS_NewRunnableMethod(this,
nsCOMPtr<nsIRunnable> notification = NS_NewRunnableMethod(this,
&nsDocument::NotifyStyleSheetApplicableStateChanged);
mSSApplicableStateNotificationPending =
NS_SUCCEEDED(NS_DispatchToCurrentThread(notification));
@@ -5232,7 +5232,7 @@ nsDocument::UnblockDOMContentLoaded()
MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
if (!mSynchronousDOMContentLoaded) {
nsRefPtr<nsIRunnable> ev =
nsCOMPtr<nsIRunnable> ev =
NS_NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
NS_DispatchToCurrentThread(ev);
} else {

View File

@@ -2360,7 +2360,7 @@ nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
}
if (mChildMessageManager) {
nsRefPtr<nsIRunnable> ev = new nsAsyncMessageToChild(aCx, this, aMessage,
nsCOMPtr<nsIRunnable> ev = new nsAsyncMessageToChild(aCx, this, aMessage,
aData, aCpows,
aPrincipal);
NS_DispatchToCurrentThread(ev);

View File

@@ -1752,7 +1752,7 @@ public:
JS::Handle<JSObject *> aCpows,
nsIPrincipal* aPrincipal) MOZ_OVERRIDE
{
nsRefPtr<nsIRunnable> ev =
nsCOMPtr<nsIRunnable> ev =
new nsAsyncMessageToSameProcessChild(aCx, aMessage, aData, aCpows,
aPrincipal);
NS_DispatchToCurrentThread(ev);

View File

@@ -8897,7 +8897,7 @@ private:
void
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);
if (NS_SUCCEEDED(rv)) {
mNotifiedIDDestroyed = true;

View File

@@ -162,7 +162,7 @@ FetchPut::DispatchToMainThread()
{
MOZ_ASSERT(!mRunnable);
nsRefPtr<nsIRunnable> runnable = new Runnable(this);
nsCOMPtr<nsIRunnable> runnable = new Runnable(this);
nsresult rv = NS_DispatchToMainThread(runnable, nsIThread::DISPATCH_NORMAL);
if (NS_WARN_IF(NS_FAILED(rv))) {

View File

@@ -24,7 +24,7 @@ static const TrackID TRACK_VIDEO = 2;
void
FakeMediaStreamGraph::DispatchToMainThreadAfterStreamStateUpdate(already_AddRefed<nsIRunnable> aRunnable)
{
nsRefPtr<nsIRunnable> task = aRunnable;
nsCOMPtr<nsIRunnable> task = aRunnable;
NS_DispatchToMainThread(task);
}

View File

@@ -368,7 +368,7 @@ public:
MediaStreamGraph* aGraph,
MediaStreamListener::MediaStreamGraphEvent event) MOZ_OVERRIDE {
if (event == EVENT_FINISHED) {
nsRefPtr<nsIRunnable> r = NS_NewRunnableMethod(
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(
this, &OutputStreamListener::DoNotifyFinished);
aGraph->DispatchToMainThreadAfterStreamStateUpdate(r.forget());
}

View File

@@ -266,7 +266,7 @@ class MediaRecorder::Session: public nsIObserver
LOG(PR_LOG_DEBUG, ("Session.ExtractRunnable shutdown = %d", mSession->mEncoder->IsShutdown()));
if (!mSession->mEncoder->IsShutdown()) {
mSession->Extract(false);
nsRefPtr<nsIRunnable> event = new ExtractRunnable(mSession);
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(mSession);
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
NS_WARNING("Failed to dispatch ExtractRunnable to encoder thread");
}
@@ -612,7 +612,7 @@ private:
// shutdown notification and stop Read Thread.
nsContentUtils::RegisterShutdownObserver(this);
nsRefPtr<nsIRunnable> event = new ExtractRunnable(this);
nsCOMPtr<nsIRunnable> event = new ExtractRunnable(this);
if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) {
NS_WARNING("Failed to dispatch ExtractRunnable at beginning");
}

View File

@@ -2234,7 +2234,7 @@ MediaStream::RunAfterPendingUpdates(already_AddRefed<nsIRunnable> aRunnable)
NS_DispatchToCurrentThread(mRunnable);
}
private:
nsRefPtr<nsIRunnable> mRunnable;
nsCOMPtr<nsIRunnable> mRunnable;
};
graph->AppendMessage(new Message(this, runnable.forget()));

View File

@@ -50,7 +50,7 @@ CDMCallbackProxy::SetSessionId(uint32_t aToken,
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task(new SetSessionIdTask(mProxy,
nsCOMPtr<nsIRunnable> task(new SetSessionIdTask(mProxy,
aToken,
aSessionId));
NS_DispatchToMainThread(task);
@@ -82,7 +82,7 @@ CDMCallbackProxy::ResolveLoadSessionPromise(uint32_t aPromiseId, bool aSuccess)
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task(new LoadSessionTask(mProxy,
nsCOMPtr<nsIRunnable> task(new LoadSessionTask(mProxy,
aPromiseId,
aSuccess));
NS_DispatchToMainThread(task);
@@ -129,7 +129,7 @@ CDMCallbackProxy::RejectPromise(uint32_t aPromiseId,
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = new RejectPromiseTask(mProxy,
aPromiseId,
aException,
@@ -169,7 +169,7 @@ CDMCallbackProxy::SessionMessage(const nsCString& aSessionId,
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = new SessionMessageTask(mProxy,
aSessionId,
aMessageType,
@@ -203,7 +203,7 @@ CDMCallbackProxy::ExpirationChange(const nsCString& aSessionId,
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = new ExpirationChangeTask(mProxy,
aSessionId,
aExpiryTime);
@@ -215,7 +215,7 @@ CDMCallbackProxy::SessionClosed(const nsCString& aSessionId)
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
&CDMProxy::OnSessionClosed,
NS_ConvertUTF8toUTF16(aSessionId));
@@ -257,7 +257,7 @@ CDMCallbackProxy::SessionError(const nsCString& aSessionId,
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = new SessionErrorTask(mProxy,
aSessionId,
aException,
@@ -281,7 +281,7 @@ CDMCallbackProxy::KeyStatusChanged(const nsCString& aSessionId,
aStatus);
}
if (keyStatusesChange) {
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethodWithArg<nsString>(mProxy,
&CDMProxy::OnKeyStatusesChange,
NS_ConvertUTF8toUTF16(aSessionId));
@@ -312,7 +312,7 @@ void
CDMCallbackProxy::Terminated()
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
nsRefPtr<nsIRunnable> task = NS_NewRunnableMethod(mProxy, &CDMProxy::Terminated);
nsCOMPtr<nsIRunnable> task = NS_NewRunnableMethod(mProxy, &CDMProxy::Terminated);
NS_DispatchToMainThread(task);
}

View File

@@ -109,7 +109,7 @@ private:
nsTArray<WaitForKeys> mWaitForKeys;
nsTArray<nsRefPtr<nsIRunnable>> mWaitForCaps;
nsTArray<nsCOMPtr<nsIRunnable>> mWaitForCaps;
uint64_t mCaps;
// It is not safe to copy this object.

View File

@@ -67,7 +67,7 @@ CDMProxy::Init(PromiseId aPromiseId,
data->mOrigin = aOrigin;
data->mTopLevelOrigin = aTopLevelOrigin;
data->mInPrivateBrowsing = aInPrivateBrowsing;
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<InitData>>(this,
&CDMProxy::gmp_Init,
data));
@@ -118,7 +118,7 @@ CDMProxy::gmp_Init(nsAutoPtr<InitData> aData)
} else {
mCallback = new CDMCallbackProxy(this);
mCDM->Init(mCallback);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<uint32_t>(this,
&CDMProxy::OnCDMCreated,
aData->mPromiseId));
@@ -154,7 +154,7 @@ CDMProxy::CreateSession(uint32_t aCreateSessionToken,
data->mInitDataType = NS_ConvertUTF16toUTF8(aInitDataType);
data->mInitData = Move(aInitData);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<CreateSessionData>>(this, &CDMProxy::gmp_CreateSession, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -193,7 +193,7 @@ CDMProxy::LoadSession(PromiseId aPromiseId,
nsAutoPtr<SessionOpData> data(new SessionOpData());
data->mPromiseId = aPromiseId;
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_LoadSession, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -220,7 +220,7 @@ CDMProxy::SetServerCertificate(PromiseId aPromiseId,
nsAutoPtr<SetServerCertificateData> data;
data->mPromiseId = aPromiseId;
data->mCert = Move(aCert);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<SetServerCertificateData>>(this, &CDMProxy::gmp_SetServerCertificate, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -249,7 +249,7 @@ CDMProxy::UpdateSession(const nsAString& aSessionId,
data->mPromiseId = aPromiseId;
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
data->mResponse = Move(aResponse);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<UpdateSessionData>>(this, &CDMProxy::gmp_UpdateSession, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -277,7 +277,7 @@ CDMProxy::CloseSession(const nsAString& aSessionId,
nsAutoPtr<SessionOpData> data(new SessionOpData());
data->mPromiseId = aPromiseId;
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_CloseSession, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -303,7 +303,7 @@ CDMProxy::RemoveSession(const nsAString& aSessionId,
nsAutoPtr<SessionOpData> data(new SessionOpData());
data->mPromiseId = aPromiseId;
data->mSessionId = NS_ConvertUTF16toUTF8(aSessionId);
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<SessionOpData>>(this, &CDMProxy::gmp_RemoveSession, data));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -325,7 +325,7 @@ CDMProxy::Shutdown()
MOZ_ASSERT(NS_IsMainThread());
mKeys.Clear();
// 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) {
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}
@@ -357,7 +357,7 @@ CDMProxy::RejectPromise(PromiseId aId, nsresult aCode)
mKeys->RejectPromise(aId, aCode);
}
} else {
nsRefPtr<nsIRunnable> task(new RejectPromiseTask(this, aId, aCode));
nsCOMPtr<nsIRunnable> task(new RejectPromiseTask(this, aId, aCode));
NS_DispatchToMainThread(task);
}
}
@@ -372,7 +372,7 @@ CDMProxy::ResolvePromise(PromiseId aId)
NS_WARNING("CDMProxy unable to resolve promise!");
}
} else {
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethodWithArg<PromiseId>(this,
&CDMProxy::ResolvePromise,
aId);
@@ -525,7 +525,7 @@ CDMProxy::Decrypt(mp4_demuxer::MP4Sample* aSample,
DecryptionClient* aClient)
{
nsAutoPtr<DecryptJob> job(new DecryptJob(aSample, aClient));
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethodWithArg<nsAutoPtr<DecryptJob>>(this, &CDMProxy::gmp_Decrypt, job));
mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
}

View File

@@ -47,7 +47,7 @@ MP4Decoder::SetCDMProxy(CDMProxy* aProxy)
// and the CDMProxy knows the capabilities of the CDM. The MP4Reader
// remains in "waiting for resources" state until then.
CDMCaps::AutoLock caps(aProxy->Capabilites());
nsRefPtr<nsIRunnable> task(
nsCOMPtr<nsIRunnable> task(
NS_NewRunnableMethod(this, &MediaDecoder::NotifyWaitingForResourcesStatusChanged));
caps.CallOnMainThreadWhenCapsAvailable(task);
}

View File

@@ -96,7 +96,7 @@ AppleDecoderModule::CanDecode()
if (NS_IsMainThread()) {
Init();
} else {
nsRefPtr<nsIRunnable> task(new InitTask());
nsCOMPtr<nsIRunnable> task(new InitTask());
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
}
}
@@ -127,7 +127,7 @@ AppleDecoderModule::Startup()
return NS_ERROR_FAILURE;
}
nsRefPtr<nsIRunnable> task(new LinkTask());
nsCOMPtr<nsIRunnable> task(new LinkTask());
NS_DispatchToMainThread(task, NS_DISPATCH_SYNC);
return NS_OK;
@@ -152,7 +152,7 @@ public:
nsresult
AppleDecoderModule::Shutdown()
{
nsRefPtr<nsIRunnable> task(new UnlinkTask());
nsCOMPtr<nsIRunnable> task(new UnlinkTask());
NS_DispatchToMainThread(task);
return NS_OK;
}

View File

@@ -38,7 +38,7 @@ MediaDataDecoderProxy::Input(mp4_demuxer::MP4Sample* aSample)
MOZ_ASSERT(!IsOnProxyThread());
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);
NS_ENSURE_SUCCESS(rv, rv);
@@ -53,7 +53,7 @@ MediaDataDecoderProxy::Flush()
mFlushComplete.Set(false);
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Flush);
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
NS_ENSURE_SUCCESS(rv, rv);
@@ -69,7 +69,7 @@ MediaDataDecoderProxy::Drain()
MOZ_ASSERT(!IsOnProxyThread());
MOZ_ASSERT(!mIsShutdown);
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Drain);
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_NORMAL);
NS_ENSURE_SUCCESS(rv, rv);
@@ -84,7 +84,7 @@ MediaDataDecoderProxy::Shutdown()
#if defined(DEBUG)
mIsShutdown = true;
#endif
nsRefPtr<nsIRunnable> task;
nsCOMPtr<nsIRunnable> task;
task = NS_NewRunnableMethod(mProxyDecoder, &MediaDataDecoder::Shutdown);
nsresult rv = mProxyThread->Dispatch(task, NS_DISPATCH_SYNC);
NS_ENSURE_SUCCESS(rv, rv);

View File

@@ -558,7 +558,7 @@ GeckoMediaPluginService::AsyncShutdownComplete(GMPParent* aParent)
if (mAsyncShutdownPlugins.IsEmpty() && mShuttingDownOnGMPThread) {
// The main thread may be waiting for async shutdown of plugins,
// 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));
NS_DispatchToMainThread(task);
}
@@ -592,7 +592,7 @@ GeckoMediaPluginService::UnloadPlugins()
}
if (mAsyncShutdownPlugins.IsEmpty()) {
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
nsCOMPtr<nsIRunnable> task(NS_NewRunnableMethod(
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
NS_DispatchToMainThread(task);
}

View File

@@ -221,8 +221,8 @@ public:
private:
virtual ~GMPShutdownObserver() {}
nsRefPtr<nsIRunnable> mShutdownTask;
nsRefPtr<nsIRunnable> mContinuation;
nsCOMPtr<nsIRunnable> mShutdownTask;
nsCOMPtr<nsIRunnable> mContinuation;
const nsString mNodeId;
};
@@ -290,7 +290,7 @@ public:
private:
virtual ~ClearGMPStorageTask() {}
nsRefPtr<nsIRunnable> mContinuation;
nsCOMPtr<nsIRunnable> mContinuation;
nsCOMPtr<nsIThread> mTarget;
const PRTime mSince;
};
@@ -1093,7 +1093,7 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
bool matches = mExpected[0].mMessage.Equals(msg);
EXPECT_STREQ(mExpected[0].mMessage.get(), msg.get());
if (mExpected.Length() > 0 && matches) {
nsRefPtr<nsIRunnable> continuation = mExpected[0].mContinuation;
nsCOMPtr<nsIRunnable> continuation = mExpected[0].mContinuation;
mExpected.RemoveElementAt(0);
if (continuation) {
NS_DispatchToCurrentThread(continuation);
@@ -1134,7 +1134,7 @@ private:
, mContinuation(aContinuation)
{}
nsCString mMessage;
nsRefPtr<nsIRunnable> mContinuation;
nsCOMPtr<nsIRunnable> mContinuation;
};
nsTArray<ExpectedMessage> mExpected;

View File

@@ -507,7 +507,7 @@ MediaSource::QueueInitializationEvent()
}
mFirstSourceBufferInitialized = true;
MSE_DEBUG("");
nsRefPtr<nsIRunnable> task =
nsCOMPtr<nsIRunnable> task =
NS_NewRunnableMethod(this, &MediaSource::InitializationEvent);
NS_DispatchToMainThread(task);
}

View File

@@ -261,7 +261,7 @@ MediaSourceDecoder::ScheduleDurationChange(double aOldDuration,
if (NS_IsMainThread()) {
DurationChanged(aOldDuration, aNewDuration);
} else {
nsRefPtr<nsIRunnable> task =
nsCOMPtr<nsIRunnable> task =
new DurationChangedRunnable(this, aOldDuration, aNewDuration);
NS_DispatchToMainThread(task);
}

View File

@@ -268,7 +268,7 @@ SourceBuffer::Remove(double aStart, double aEnd, ErrorResult& aRv)
}
StartUpdating();
nsRefPtr<nsIRunnable> task = new RangeRemovalRunnable(this, aStart, aEnd);
nsCOMPtr<nsIRunnable> task = new RangeRemovalRunnable(this, aStart, aEnd);
NS_DispatchToMainThread(task);
}
@@ -277,7 +277,7 @@ SourceBuffer::RangeRemoval(double aStart, double aEnd)
{
StartUpdating();
DoRangeRemoval(aStart, aEnd);
nsRefPtr<nsIRunnable> task =
nsCOMPtr<nsIRunnable> task =
NS_NewRunnableMethod(this, &SourceBuffer::StopUpdating);
NS_DispatchToMainThread(task);
}
@@ -432,7 +432,7 @@ SourceBuffer::AppendData(const uint8_t* aData, uint32_t aLength, ErrorResult& aR
MOZ_ASSERT(mAppendMode == SourceBufferAppendMode::Segments,
"We don't handle timestampOffset for sequence mode yet");
nsRefPtr<nsIRunnable> task =
nsCOMPtr<nsIRunnable> task =
new AppendDataRunnable(this, data, mTimestampOffset, mUpdateID);
NS_DispatchToMainThread(task);
}

View File

@@ -351,7 +351,7 @@ AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
// Remove one instance of 'dest' from mOutputNodes. There could be
// others, and it's not correct to remove them all since some of them
// could be for different output ports.
nsRefPtr<nsIRunnable> runnable =
nsCOMPtr<nsIRunnable> runnable =
new RunnableRelease(mOutputNodes[i].forget());
mOutputNodes.RemoveElementAt(i);
mStream->RunAfterPendingUpdates(runnable.forget());

View File

@@ -419,7 +419,7 @@ bool
Promise::PerformMicroTaskCheckpoint()
{
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
nsTArray<nsRefPtr<nsIRunnable>>& microtaskQueue =
nsTArray<nsCOMPtr<nsIRunnable>>& microtaskQueue =
runtime->GetPromiseMicroTaskQueue();
if (microtaskQueue.IsEmpty()) {
@@ -427,7 +427,7 @@ Promise::PerformMicroTaskCheckpoint()
}
do {
nsRefPtr<nsIRunnable> runnable = microtaskQueue.ElementAt(0);
nsCOMPtr<nsIRunnable> runnable = microtaskQueue.ElementAt(0);
MOZ_ASSERT(runnable);
// This function can re-enter, so we remove the element before calling.
@@ -1065,7 +1065,7 @@ Promise::DispatchToMicroTask(nsIRunnable* aRunnable)
MOZ_ASSERT(aRunnable);
CycleCollectedJSRuntime* runtime = CycleCollectedJSRuntime::Get();
nsTArray<nsRefPtr<nsIRunnable>>& microtaskQueue =
nsTArray<nsCOMPtr<nsIRunnable>>& microtaskQueue =
runtime->GetPromiseMicroTaskQueue();
microtaskQueue.AppendElement(aRunnable);

View File

@@ -1297,7 +1297,7 @@ ServiceWorkerManager::GetRegistrations(nsIDOMWindow* aWindow,
return result.ErrorCode();
}
nsRefPtr<nsIRunnable> runnable =
nsCOMPtr<nsIRunnable> runnable =
new GetRegistrationsRunnable(window, promise);
promise.forget(aPromise);
return NS_DispatchToCurrentThread(runnable);
@@ -1398,7 +1398,7 @@ ServiceWorkerManager::GetRegistration(nsIDOMWindow* aWindow,
return result.ErrorCode();
}
nsRefPtr<nsIRunnable> runnable =
nsCOMPtr<nsIRunnable> runnable =
new GetRegistrationRunnable(window, promise, aDocumentURL);
promise.forget(aPromise);
return NS_DispatchToCurrentThread(runnable);
@@ -1464,7 +1464,7 @@ ServiceWorkerManager::GetReadyPromise(nsIDOMWindow* aWindow,
return result.ErrorCode();
}
nsRefPtr<nsIRunnable> runnable =
nsCOMPtr<nsIRunnable> runnable =
new GetReadyPromiseRunnable(window, promise);
promise.forget(aPromise);
return NS_DispatchToCurrentThread(runnable);

View File

@@ -109,7 +109,7 @@ private:
RefPtr<AndroidNativeWindow> mNativeWindow;
int mID;
nsRefPtr<nsIRunnable> mFrameAvailableCallback;
nsCOMPtr<nsIRunnable> mFrameAvailableCallback;
};
}

View File

@@ -49,7 +49,7 @@ VsyncParent::NotifyVsync(TimeStamp aTimeStamp)
{
// Called on hardware vsync thread. We should post to current ipc thread.
MOZ_ASSERT(!IsOnBackgroundThread());
nsRefPtr<nsIRunnable> vsyncEvent =
nsCOMPtr<nsIRunnable> vsyncEvent =
NS_NewRunnableMethodWithArg<TimeStamp>(this,
&VsyncParent::DispatchVsyncEvent,
aTimeStamp);

View File

@@ -94,7 +94,7 @@ private:
// ready to go, since blocking on this init is just begging for deadlock.
nsCOMPtr<mozIGeckoMediaPluginService> mGMPService;
bool mGMPReady;
nsTArray<nsRefPtr<nsIRunnable>> mQueuedJSEPOperations;
nsTArray<nsCOMPtr<nsIRunnable>> mQueuedJSEPOperations;
static PeerConnectionCtx *gInstance;
public:

View File

@@ -391,7 +391,7 @@ PeerConnectionMedia::StartIceChecks(const JsepSession& session) {
}
}
nsRefPtr<nsIRunnable> runnable(
nsCOMPtr<nsIRunnable> runnable(
WrapRunnable(
RefPtr<PeerConnectionMedia>(this),
&PeerConnectionMedia::StartIceChecks_s,
@@ -516,7 +516,7 @@ void
PeerConnectionMedia::GatherIfReady() {
ASSERT_ON_THREAD(mMainThread);
nsRefPtr<nsIRunnable> runnable(WrapRunnable(
nsCOMPtr<nsIRunnable> runnable(WrapRunnable(
RefPtr<PeerConnectionMedia>(this),
&PeerConnectionMedia::EnsureIceGathering_s));

View File

@@ -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
// waiting to get a callback with our http proxy config before we start
// gathering or start checking)
std::vector<nsRefPtr<nsIRunnable>> mQueuedIceCtxOperations;
std::vector<nsCOMPtr<nsIRunnable>> mQueuedIceCtxOperations;
// Used to cancel any ongoing proxy request.
nsCOMPtr<nsICancelable> mProxyRequest;

View File

@@ -296,6 +296,6 @@ NetworkActivityMonitor::DataInOut(Direction direction)
void
NetworkActivityMonitor::PostNotification(Direction direction)
{
nsRefPtr<nsIRunnable> ev = new NotifyNetworkActivity(direction);
nsCOMPtr<nsIRunnable> ev = new NotifyNetworkActivity(direction);
NS_DispatchToMainThread(ev);
}

View File

@@ -21,7 +21,7 @@ OfflineObserver::RegisterOfflineObserver()
if (NS_IsMainThread()) {
RegisterOfflineObserverMainThread();
} else {
nsRefPtr<nsIRunnable> event =
nsCOMPtr<nsIRunnable> event =
NS_NewRunnableMethod(this, &OfflineObserver::RegisterOfflineObserverMainThread);
NS_DispatchToMainThread(event);
}
@@ -33,7 +33,7 @@ OfflineObserver::RemoveOfflineObserver()
if (NS_IsMainThread()) {
RemoveOfflineObserverMainThread();
} else {
nsRefPtr<nsIRunnable> event =
nsCOMPtr<nsIRunnable> event =
NS_NewRunnableMethod(this, &OfflineObserver::RemoveOfflineObserverMainThread);
NS_DispatchToMainThread(event);
}

View File

@@ -59,7 +59,7 @@ Tickler::~Tickler()
// 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.
nsRefPtr<nsIRunnable> event = new TicklerThreadDestructor(mThread);
nsCOMPtr<nsIRunnable> event = new TicklerThreadDestructor(mThread);
if (NS_FAILED(NS_DispatchToCurrentThread(event))) {
mThread->Shutdown();
}

View File

@@ -182,7 +182,7 @@ nsAsyncRedirectVerifyHelper::ExplicitCallback(nsresult result)
mWaitingForRedirectCallback = false;
// Now, dispatch the callback on the event-target which called Init()
nsRefPtr<nsIRunnable> event =
nsCOMPtr<nsIRunnable> event =
new nsAsyncVerifyRedirectCallbackEvent(callback, result);
if (!event) {
NS_WARNING("nsAsyncRedirectVerifyHelper::ExplicitCallback() "

View File

@@ -536,7 +536,7 @@ nsCacheEntryDescriptor::AsyncDoom(nsICacheListener *listener)
return NS_OK;
}
nsRefPtr<nsIRunnable> event = new nsAsyncDoomEvent(this, listener);
nsCOMPtr<nsIRunnable> event = new nsAsyncDoomEvent(this, listener);
return nsCacheService::DispatchToCacheIOThread(event);
}

View File

@@ -757,7 +757,7 @@ nsApplicationCache::Discard()
mValid = false;
nsRefPtr<nsIRunnable> ev =
nsCOMPtr<nsIRunnable> ev =
new nsOfflineCacheDiscardCache(mDevice, mGroup, mClientID);
nsresult rv = nsCacheService::DispatchToCacheIOThread(ev);
return rv;

View File

@@ -264,7 +264,7 @@ void CacheIOThread::LoopOneLevel(uint32_t aLevel)
eventtracer::AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone,
sLevelTraceName[aLevel]);
nsTArray<nsRefPtr<nsIRunnable> > events;
nsTArray<nsCOMPtr<nsIRunnable> > events;
events.SwapElements(mEventQueue[aLevel]);
uint32_t length = events.Length();

View File

@@ -89,7 +89,7 @@ private:
nsCOMPtr<nsIThread> mXPCOMThread;
uint32_t mLowestLevelWaiting;
uint32_t mCurrentlyExecutingLevel;
nsTArray<nsRefPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
nsTArray<nsCOMPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
bool mHasXPCOMEvents;
bool mRerunCurrentEvent;

View File

@@ -82,7 +82,7 @@ nsHttpActivityDistributor::ObserveActivity(nsISupports *aHttpChannel,
uint64_t aExtraSizeData,
const nsACString & aExtraStringData)
{
nsRefPtr<nsIRunnable> event;
nsCOMPtr<nsIRunnable> event;
{
MutexAutoLock lock(mLock);

View File

@@ -195,7 +195,7 @@ nsHttpConnectionMgr::PostEvent(nsConnEventHandler handler, int32_t iparam, void
rv = NS_ERROR_NOT_INITIALIZED;
}
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);
}
return rv;
@@ -2376,7 +2376,7 @@ nsHttpConnectionMgr::OnMsgShutdown(int32_t, void *param)
}
// signal shutdown complete
nsRefPtr<nsIRunnable> runnable =
nsCOMPtr<nsIRunnable> runnable =
new nsConnEvent(this, &nsHttpConnectionMgr::OnMsgShutdownConfirm,
0, param);
NS_DispatchToMainThread(runnable);

View File

@@ -60,7 +60,7 @@ extern "C" {
MOZ_ASSERT(NS_SUCCEEDED(rv));
jclass foundClass;
nsRefPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
nsCOMPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
&foundClass));
mainThread->Dispatch(runnable_ref, NS_DISPATCH_SYNC);
if (!foundClass)

View File

@@ -469,7 +469,7 @@ nsMemoryPressureWatcher::Observe(nsISupports* aSubject, const char* aTopic,
MOZ_ASSERT(!strcmp(aTopic, "memory-pressure"), "Unknown topic");
if (sFreeDirtyPages) {
nsRefPtr<nsIRunnable> runnable = new nsJemallocFreeDirtyPagesRunnable();
nsCOMPtr<nsIRunnable> runnable = new nsJemallocFreeDirtyPagesRunnable();
NS_DispatchToMainThread(runnable);
}

View File

@@ -937,7 +937,7 @@ CycleCollectedJSRuntime::SetPendingException(nsIException* aException)
mPendingException = aException;
}
nsTArray<nsRefPtr<nsIRunnable>>&
nsTArray<nsCOMPtr<nsIRunnable>>&
CycleCollectedJSRuntime::GetPromiseMicroTaskQueue()
{
return mPromiseMicroTaskQueue;

View File

@@ -259,7 +259,7 @@ public:
already_AddRefed<nsIException> GetPendingException() const;
void SetPendingException(nsIException* aException);
nsTArray<nsRefPtr<nsIRunnable>>& GetPromiseMicroTaskQueue();
nsTArray<nsCOMPtr<nsIRunnable>>& GetPromiseMicroTaskQueue();
nsCycleCollectionParticipant* GCThingParticipant();
nsCycleCollectionParticipant* ZoneParticipant();
@@ -309,7 +309,7 @@ private:
nsCOMPtr<nsIException> mPendingException;
nsTArray<nsRefPtr<nsIRunnable>> mPromiseMicroTaskQueue;
nsTArray<nsCOMPtr<nsIRunnable>> mPromiseMicroTaskQueue;
OOMState mOutOfMemoryState;
OOMState mLargeAllocationFailureState;

View File

@@ -48,7 +48,7 @@ NS_ProxyRelease(nsIEventTarget* aTarget, nsISupports* aDoomed,
}
}
nsRefPtr<nsIRunnable> ev = new nsProxyReleaseEvent(aDoomed);
nsCOMPtr<nsIRunnable> ev = new nsProxyReleaseEvent(aDoomed);
if (!ev) {
// we do not release aDoomed here since it may cause a delete on the
// wrong thread. better to leak than crash.

View File

@@ -172,7 +172,7 @@ nsInputStreamTee::TeeSegment(const char* aBuf, uint32_t aCount)
if (!SinkIsValid()) {
return NS_OK; // nothing to do
}
nsRefPtr<nsIRunnable> event =
nsCOMPtr<nsIRunnable> event =
new nsInputStreamTeeWriteEvent(aBuf, aCount, mSink, this);
LOG(("nsInputStreamTee::TeeSegment [%p] dispatching write %u bytes\n",
this, aCount));

View File

@@ -88,7 +88,7 @@ void
nsEventQueue::PutEvent(nsIRunnable* aRunnable)
{
// Avoid calling AddRef+Release while holding our monitor.
nsRefPtr<nsIRunnable> event(aRunnable);
nsCOMPtr<nsIRunnable> event(aRunnable);
if (ChaosMode::isActive(ChaosMode::ThreadScheduling)) {
// With probability 0.5, yield so other threads have a chance to

View File

@@ -550,7 +550,7 @@ nsThread::DispatchInternal(nsIRunnable* aEvent, uint32_t aFlags,
}
#ifdef MOZ_TASK_TRACER
nsRefPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(aEvent);
nsCOMPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(aEvent);
aEvent = tracedRunnable;
#endif

View File

@@ -122,7 +122,7 @@ nsThreadPool::PutEvent(nsIRunnable* aEvent)
// of nsStreamCopier. To prevent this situation, dispatch a shutdown event
// to the current thread instead of calling nsIThread::Shutdown() directly.
nsRefPtr<nsIRunnable> r = NS_NewRunnableMethod(thread,
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(thread,
&nsIThread::Shutdown);
NS_DispatchToCurrentThread(r);
} else {
@@ -142,7 +142,7 @@ nsThreadPool::ShutdownThread(nsIThread* aThread)
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);
}