Closed Bug 1785092 Opened 2 years ago Closed 2 years ago

Refactor script evaluation code to make use of a Realm class

Categories

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

task
Points:
2

Tracking

(firefox105 fixed)

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m4])

Attachments

(1 file)

To serialize and deserialize complex Javascript objects the appropriate code in RemoteValue.jsm needs details about the realm (sandbox) it operates on. This includes not only the realm id but also the object cache that is used to store DebuggerObject instances and to generate their appropriate handleId.

With bug 1770480 there will be sandbox support for the script module, but it keeps known sandboxes within this module as simple maps and only sharing a sandbox (realm) id. Tying more data like the above will not evolve over time and will make it more complex to maintain and to share with other modules in the future.

As such each sandbox and the default window global should be wrapped within a Realm class so that each instance contains all the required data and can easily be shared via reference.

We need a base class for common code and most likely specific sub classes for individual realm types (window realm, sandbox realm, worker realm?, ...).

Blocks: 1766240
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Blocks: 1742589
Points: --- → 2
Priority: -- → P1
Whiteboard: [webdriver:m4]
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3329e6a917a1 [remote] Added Realm class for Windows and Sandboxes. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: