Closed Bug 1859328 Opened 1 year ago Closed 2 months ago

Add emitEventForBrowsingContext method to a base RootBiDiModule class

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task

Tracking

(firefox131 fixed)

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: Sasha, Assigned: temidayoazeez032, Mentored)

References

Details

(Whiteboard: [lang=js][webdriver:m12][webdriver:external][webdriver:relnote])

Attachments

(1 file)

A lot of browsingContext events are sent from the parent process and in order to do this we always write the same code:

// This event is emitted from the parent process but for a given browsing
// context. Set the event's contextInfo to the message handler corresponding
// to this browsing context.
const contextInfo = {
  contextId: browsingContextId,
  type: lazy.WindowGlobalMessageHandler.type,
};
this.emitEvent(
   eventName,
   eventPayload,
   contextInfo
 );

This code could me moved to a method in the base RootBiDiModule class. The proposed name of this method is emitBrowsingContextEvent.

Depends on: 1850682

Hm, isn't that specific to the browsing context module and a general helper there would be a better place?

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #1)

Hm, isn't that specific to the browsing context module and a general helper there would be a better place?

Re-reading the method name I suggested I thought "it's probably misleading", and looks like I was right :)

A better name would probably be emitEventForBrowsingContext. It's basically for any parent process module which needs to emit an event for a specific context. Eg network module can also use it.

Summary: Add emitBrowsingContextEvent method to a base RootBiDiModule class → Add emitEventForBrowsingContext method to a base RootBiDiModule class

As soon as dependency bug1850682 is fixed, we should set this bug as mentored.

Priority: -- → P3

Hi @jdescottes, I will like to work on this next.

Assignee: nobody → temidayoazeez032
Status: NEW → ASSIGNED

Thanks for picking this up!

Mentor: jdescottes
Whiteboard: [lang=js]
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4295f0e486ca Add emitEventForBrowsingContext method to a base RootBiDiModule class - 'Julian Descottes' r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

Great work, Dan! It's fantastic to see us starting to share methods across the different BiDi root module classes. If you're interested in continuing, please let us know or join us on Matrix in the #webdriver channel. This will help us find a suitable next bug for you, if you haven't already found one, and allow you to learn and contribute more. Thanks!

Whiteboard: [lang=js] → [lang=js][webdriver:m12][webdriver:external]
Whiteboard: [lang=js][webdriver:m12][webdriver:external] → [lang=js][webdriver:m12][webdriver:external][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: