Closed Bug 1317604 Opened 3 years ago Closed 3 years ago

Add global and per-window EventDispatcher to Messaging.jsm


(GeckoView :: General, defect)

Not set


(firefox53 fixed)

Tracking Status
firefox53 --- fixed


(Reporter: jchen, Assigned: jchen)




(5 files, 1 obsolete file)

Add an EventDispatcher interface to Messaging.jsm that supports either the global EventDispatcher or per-window EventDispatcher.
Add a new EventDispatcher interface to Messaging.jsm, and provide means
to access either the global EventDispatcher through
EventDispatcher.instance or a per-window EventDispatcher through
EventDispatcher.for(window). The old Messaging object is retained until
we can convert all existing uses of it in Fennec to use EventDispatcher,
at which point `Messaging` will be made to point to
Attachment #8811608 - Flags: review?(snorp)
Attachment #8811608 - Flags: review?(s.kaspari)
GeckoView's GeckoEventListener and NativeEventListener are not actually
hooked up to events right now, so it's better to just rip them out until
we figure out a better implementation in the future.
Attachment #8811609 - Flags: review?(snorp)
Convert prompts to use BundleEventListener and GeckoBundle.
Attachment #8811610 - Flags: review?(s.kaspari)
Comment on attachment 8811610 [details] [diff] [review]
3. Convert prompts to BundleEventListener (v1)

On second thought, we should move this patch to a separate bug, because there will be a lot of these conversion patches that are better suited for their own bugs.
Attachment #8811610 - Attachment is obsolete: true
Attachment #8811610 - Flags: review?(s.kaspari)
testEventDispatcher used to use nsIAndroidEventDispatcher directly,
either through nsIAndroidBridge or through a window's nsIAndroidView.
Now that Messaging.jsm provides delegate objects for those interfaces,
testEventDispatcher should use Messaging.jsm, so that we are testing
Messaging.jsm as well.
Attachment #8811636 - Flags: review?(snorp)
Attachment #8811608 - Flags: review?(snorp) → review+
Attachment #8811609 - Flags: review?(snorp) → review+
Attachment #8811636 - Flags: review?(snorp) → review+
Attachment #8811608 - Flags: review?(s.kaspari) → review+
Pushed by
1. Add EventDispatcher to Messaging.jsm; r=snorp r=sebastian
1a. Update testEventDispatcher to use Messaging.jsm; r=snorp
2. Rip out GeckoView event listeners; r=snorp
Pushed by
3. Don't create EventDispatcher when JNI is not available; r=me
Follow-up to not create the global EventDispatcher in AndroidBridge when
JNI is not available.
Attachment #8812924 - Flags: review+
Follow-up to include nsIObserver in the list of interfaces implemented
by QueryInterface for nsAndroidBridge. This fixes a bug where QI to
nsIObserver fails when removing nsAnroidBridge observers.
Attachment #8812925 - Flags: review+
Pushed by
4. Include nsIObserver in nsAndroidBridge interfaces; r=me on CLOSED TREE
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 53 → mozilla53
You need to log in before you can comment on or make changes to this bug.