Make nsCxPusher::Push to handle all kinds of nsPIDOMEventTargets

RESOLVED FIXED

Status

()

Core
DOM: Events
P2
normal
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

Trunk
x86
All
Points:
---
Dependency tree / graph
Bug Flags:
wanted1.9.1 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Currently nsCxPusher::Push(nsISupports*) is used with DOM Nodes and |window|,
but it should be able handle all kinds of nsPIDOMEventTarget objects, like
XHR (once bug 372964 is fixed).
Created attachment 322445 [details] [diff] [review]
possible patch
Attachment #322445 - Flags: review?(jst)
Any chance for a review?
wanted1.9.1? because this blocks bug 372964, which blocks wanted1.9.1+ bug 435425.
Flags: wanted1.9.1?

Updated

10 years ago
Flags: wanted1.9.1? → wanted1.9.1+
Priority: -- → P2
Blocks: 445550
Comment on attachment 322445 [details] [diff] [review]
possible patch

- In nsCxPusher::Push():

-  if (mScx) {
-    NS_ERROR("Whaaa! No double pushing with nsCxPusher::Push()!");
-
-    return PR_FALSE;
[...]
+  NS_ASSERTION(!mScx, "Whaaa! No double pushing with nsCxPusher::Push()!");

Unless there's a reason not to, I'd still prefer to leave the early return if we ever get here, just in case.

- In nsContentUtils::GetContextForEventHandlers():

+  if (sgo) {
+    NS_IF_ADDREF(*aContext = sgo->GetContext());
+    // Bad, no context from script global object!
+    NS_ENSURE_STATE(*aContext);
+  }
+
+  return NS_OK;

It's possible for us to return here w/o ever having set *aContext to null.

r+sr=jst with that looked into.
Attachment #322445 - Flags: superreview+
Attachment #322445 - Flags: review?(jst)
Attachment #322445 - Flags: review+
Created attachment 330211 [details] [diff] [review]
patch
Attachment #322445 - Attachment is obsolete: true
Keywords: checkin-needed
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.