Closed Bug 1563692 Opened 5 years ago Closed 5 years ago

Move all CDP packet reading/writing to Connection

Categories

(Remote Protocol :: Agent, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

For now, we try to construct CDP packets from Session classes, whereas we already process some particular aspects of it from Connection (to get the sessionId).

I believe it would be easier to follow if Connection was fully responsive of intepreting incoming packet completely (all fiels: id, method, params and sessionId), as well as crafting the outgoing packets sent to the client (command response, events and errors).

A side effect of doing that is that sessions are doing much less, which may help coalescing Domain and Session classes.

Assignee: nobody → poirot.alex
Blocks: 1544458

This helps sharing a single implementation of how the JSON objects
are read and written from/to the WebSocket connection.
Also, by delegating the command calls to the Session via Session.execute
and expecting a promise with a resolution or rejection, we make error
handling of command calls clearer and unified.

Making this block the gutenberg work as it will help bug 1562740 and the patch to call content's domain code from the parent one.

Status: NEW → ASSIGNED
Priority: -- → P2
Priority: P2 → P1
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a51231751f3 Move all CDP's JSON packet handling to Connection. r=remote-protocol-reviewers,jdescottes,ato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: