Closed Bug 731227 Opened 8 years ago Closed 8 years ago

Fix script object ownership in IDBWrapperCache/IDBCursor

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: peterv, Assigned: peterv)

References

Details

Attachments

(1 file)

No description provided.
Attached patch v1Splinter Review
IDBEventTargetSH::AddProperty/PreserveWrapper aren't needed, nsEventTargetSH::AddProperty/PreserveWrapper will deal with IDBWrapperCache objects just fine.
IDBCursor and IDBWrapperCache need to root their mScriptOwner.
Attachment #601282 - Flags: review?(bent.mozilla)
Comment on attachment 601282 [details] [diff] [review]
v1

Review of attachment 601282 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: dom/indexedDB/IDBWrapperCache.cpp
@@ +63,5 @@
> +
> +  nsISupports* thisSupports = NS_CYCLE_COLLECTION_UPCAST(this, IDBWrapperCache);
> +  nsXPCOMCycleCollectionParticipant* participant;
> +  CallQueryInterface(this, &participant);
> +  nsresult rv = nsContentUtils::HoldJSObjects(thisSupports, participant);

This should probably get a comment as to why we're not using the NS_HOLD_JS_OBJECT macro here.

@@ +64,5 @@
> +  nsISupports* thisSupports = NS_CYCLE_COLLECTION_UPCAST(this, IDBWrapperCache);
> +  nsXPCOMCycleCollectionParticipant* participant;
> +  CallQueryInterface(this, &participant);
> +  nsresult rv = nsContentUtils::HoldJSObjects(thisSupports, participant);
> +  if (NS_FAILED(rv)) {

Can you add a warning here?
Attachment #601282 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/a77570b9a808
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Depends on: 765936
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.