Closed Bug 1741493 Opened 3 years ago Closed 2 years ago

Split IPCInternalResponse into three different structs

Categories

(Core :: DOM: Networking, task, P2)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: ytausky, Assigned: ytausky)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Right now IPCInternalResponse contains two streams (body and alternativeBody) each of which can be one of ParentToParentStream, ParentToChildStream or ChildToParentStream. This is problematic due to two reasons:

  1. It makes it possible for body and alternativeBody to be different kinds of streams, even though an IPCInternalResponse requires both to be the same kind.
  2. Since IPCInternalResponse travels through well-defined code paths that expect specific kinds of streams, it relegates what could be compile-time checks to runtime. This is error prone and results in complicated code.

A possible solution to these concerns is to replace IPCInternalResponse with three distinct structs that differ in the type of streams that they contain.

Blocks: 1577346
Assignee: nobody → ytausky
Status: NEW → ASSIGNED

This commit replaces IPCInternalResponse with three different structs:
ParentToParentInternalResponse, ParentToChildInternalResponse, and
ChildToParentInternalResponse. Doing this let's us convert runtime
checks into compile-time type checks and simplifies relevant code.

Severity: -- → N/A
Priority: -- → P2
Whiteboard: [necko-triaged]
Attachment #9251002 - Attachment description: Bug 1741493 - Split IPCInternalResponse r=#dom-worker-reviewers → Bug 1741493 - Split IPCInternalResponse r=nika
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: