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 81a5bfbdad
commit 2186cf857d

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);
}
}