Bug 1014466 - Part 2: Allow setting responseType after abort() or new open(). r=khuey

This commit is contained in:
Shian-Yow Wu 2014-06-06 12:17:54 +08:00
parent 7eb4b53e72
commit 04a13e40b5
2 changed files with 16 additions and 8 deletions

View File

@ -279,7 +279,9 @@ private:
bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
{
mXMLHttpRequestPrivate->Unpin();
if (mXMLHttpRequestPrivate->SendInProgress()) {
mXMLHttpRequestPrivate->Unpin();
}
return true;
}
@ -353,7 +355,9 @@ class LoadStartDetectionRunnable MOZ_FINAL : public nsRunnable,
aWorkerPrivate->StopSyncLoop(mSyncLoopTarget, true);
}
mXMLHttpRequestPrivate->Unpin();
if (mXMLHttpRequestPrivate->SendInProgress()) {
mXMLHttpRequestPrivate->Unpin();
}
return true;
}
@ -1716,6 +1720,10 @@ XMLHttpRequest::MaybeDispatchPrematureAbortEvents(ErrorResult& aRv)
mProxy->mSeenLoadStart = false;
}
if (mRooted) {
Unpin();
}
}
void

View File

@ -264,6 +264,12 @@ public:
return mMozSystem;
}
bool
SendInProgress() const
{
return mRooted;
}
private:
XMLHttpRequest(WorkerPrivate* aWorkerPrivate);
~XMLHttpRequest();
@ -284,12 +290,6 @@ private:
const nsAString& aEventType, bool aUploadTarget,
ErrorResult& aRv);
bool
SendInProgress() const
{
return mRooted;
}
void
SendInternal(const nsAString& aStringBody,
JSAutoStructuredCloneBuffer&& aBody,