Closed Bug 1563692 Opened 8 months ago Closed 8 months 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

(Blocks 1 open bug)

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: 8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.