Bug 784190 - Fix Cycle collection casting in DOMRequest, r=mccr8

This commit is contained in:
Andrea Marchesini 2012-08-27 09:44:25 -07:00
parent 991a3567bb
commit 34c7f9dc7b
4 changed files with 6 additions and 17 deletions

View File

@ -179,7 +179,10 @@ void
DOMRequest::RootResultVal() DOMRequest::RootResultVal()
{ {
NS_ASSERTION(!mRooted, "Don't call me if already rooted!"); NS_ASSERTION(!mRooted, "Don't call me if already rooted!");
NS_HOLD_JS_OBJECTS(this, DOMRequest); nsXPCOMCycleCollectionParticipant *participant;
CallQueryInterface(this, &participant);
nsContentUtils::HoldJSObjects(NS_CYCLE_COLLECTION_UPCAST(this, DOMRequest),
participant);
mRooted = true; mRooted = true;
} }

View File

@ -54,8 +54,8 @@ public:
protected: protected:
void FireEvent(const nsAString& aType, bool aBubble, bool aCancelable); void FireEvent(const nsAString& aType, bool aBubble, bool aCancelable);
virtual void RootResultVal(); void RootResultVal();
virtual void UnrootResultVal(); void UnrootResultVal();
void Init(nsIDOMWindow* aWindow); void Init(nsIDOMWindow* aWindow);
}; };

View File

@ -160,14 +160,3 @@ FileRequest::FireProgressEvent(uint64_t aLoaded, uint64_t aTotal)
return; return;
} }
} }
void
FileRequest::RootResultVal()
{
NS_ASSERTION(!mRooted, "Don't call me if already rooted!");
nsXPCOMCycleCollectionParticipant *participant;
CallQueryInterface(this, &participant);
nsContentUtils::HoldJSObjects(NS_CYCLE_COLLECTION_UPCAST(this, DOMRequest),
participant);
mRooted = true;
}

View File

@ -51,9 +51,6 @@ private:
void void
FireProgressEvent(uint64_t aLoaded, uint64_t aTotal); FireProgressEvent(uint64_t aLoaded, uint64_t aTotal);
virtual void
RootResultVal();
nsRefPtr<LockedFile> mLockedFile; nsRefPtr<LockedFile> mLockedFile;
bool mIsFileRequest; bool mIsFileRequest;