Bug 1041148 - Move HoldJSObjects call to XMLHttpRequest constructor to simplify the code. r=bz

This commit is contained in:
Jan de Mooij 2014-08-06 15:23:33 -07:00
parent 997b3364e7
commit 1128c60ac3

View File

@ -1577,6 +1577,8 @@ XMLHttpRequest::XMLHttpRequest(WorkerPrivate* aWorkerPrivate)
mWorkerPrivate->AssertIsOnWorkerThread();
SetIsDOMBinding();
mozilla::HoldJSObjects(this);
}
XMLHttpRequest::~XMLHttpRequest()
@ -2365,7 +2367,4 @@ XMLHttpRequest::UpdateState(const StateData& aStateData,
else {
mStateData = aStateData;
}
if (mStateData.mResponse.isGCThing()) {
mozilla::HoldJSObjects(this);
}
}