Bug 1224596 part 10. Switch DataStoreCursor to using the new WorkerMainThreadRunnable::Dispatch signature. r=khuey

This commit is contained in:
Boris Zbarsky 2015-11-24 00:04:21 -05:00
parent 48e98c27f5
commit fe9eca907c

View File

@ -89,16 +89,15 @@ public:
PromiseWorkerProxy::Create(aWorkerPrivate, aWorkerPromise);
}
bool Dispatch(JSContext* aCx)
void Dispatch(ErrorResult& aRv)
{
if (mPromiseWorkerProxy) {
return DataStoreCursorRunnable::Dispatch(aCx);
DataStoreCursorRunnable::Dispatch(aRv);
}
// If the creation of mProxyWorkerProxy failed, the worker is terminating.
// In this case we don't want to dispatch the runnable and we should stop
// the promise chain here.
return true;
}
protected:
@ -173,7 +172,10 @@ WorkerDataStoreCursor::Next(JSContext* aCx, ErrorResult& aRv)
mBackingCursor,
promise,
aRv);
runnable->Dispatch(aCx);
runnable->Dispatch(aRv);
if (aRv.Failed()) {
return nullptr;
}
return promise.forget();
}
@ -187,7 +189,7 @@ WorkerDataStoreCursor::Close(JSContext* aCx, ErrorResult& aRv)
RefPtr<DataStoreCursorCloseRunnable> runnable =
new DataStoreCursorCloseRunnable(workerPrivate, mBackingCursor, aRv);
runnable->Dispatch(aCx);
runnable->Dispatch(aRv);
}
void