Closed Bug 1847358 Opened 1 year ago Closed 9 months ago

Refactor and improve the code for handling blob URL range requests

Categories

(Core :: DOM: File, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: twisniewski, Assigned: twisniewski)

References

Details

Attachments

(3 files)

In bug 1784880 we added support for honoring range requests on blob URLs being fetched or XMLHttpRequested. The code could use some improvements:

  1. give nsBaseChannel a simple XPCOM interface that we can query, so we don't have to rely on static_casting to nsBaseChannel (which is of very error prone and results in having to remember to add extranneous code to confirm that we actually are dealing with a blob URL, otherwise we can easily cast the wrong channel class and mess up its requests).

  2. move the ContentRange class and support code into its own file, and have the new XPCOM class give access to the content-range support. This will allow us to eventually re-use this functionality for other types of nsBaseChannel URLs, such as files (which may help with bug 1378228).

  3. this should also let us start to move the code we added in bug 1845006 for handling standards-compliant content-type headers for Data URLs into the same new interface, for similar benefits.

Assignee: nobody → twisniewski
Status: NEW → ASSIGNED
Pushed by twisniewski@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/553b59b0c2a5 part 1: move nsBaseChannel::ContentRange content out into its own class as mozilla::net::ContentRange; r=dlrobertson,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/e2dd51dd3691 part 2: create and use nsIBaseChannel to reduce code debt and better-encapsulate logic for range-requests on nsBaseChannel classes; r=dlrobertson,necko-reviewers,jesup https://hg.mozilla.org/integration/autoland/rev/6f4963be624f part 3: add a fullMimeType attribute to nsIBaseChannel and use it to make our Data URI content-type header parsing standards-compliant for XHR and Fetch; r=dlrobertson,necko-reviewers,jesup
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: