Closed Bug 1499547 Opened 6 years ago Closed 2 months ago

Consider removing DOMRequest

Categories

(Core :: DOM: Core & HTML, task, P5)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: mccr8, Assigned: gregp)

References

(Blocks 2 open bugs)

Details

(4 keywords)

Attachments

(1 file)

Maybe this is completely hopeless, but DOMRequest is the cause of one of the failures in WPT tests that we fail and all other browsers pass (dom/historical.html) so I figured we should at least have a bug on file for the removal, even if just to WONTFIX it with some kind of justification for it.

(I looked through the summary of every bug with DOMRequest in the name and didn't see that any had ever been filed about removing it.)
The only places DOMRequest is used are:

1) BrowserElement.webidl.  We could switch this to Promise, I bet.
2) As an interface IDBFileRequest, which is used in IDBFileHandle, inherits from.
   Looks like that's some sort of Gecko-only stuff?
3) IDBMutableFile directly.

I wonder whether the IDBMutableFile/FileRequest/FileHandle stuff is actually used...
Flags: needinfo?(bugmail)
Looks like we have telemetry for createMutableFile and mozCreateFileHandle on IDBDatabase, which are the relevant entry points.  Use counter for createMutableFile at https://telemetry.mozilla.org/new-pipeline/dist.html#!cumulative=0&end_date=2018-08-30&include_spill=0&keys=__none__!__none__!__none__&max_channel_version=beta%252F62&measure=USE_COUNTER2_IDBDATABASE_CREATEMUTABLEFILE_PAGE&min_channel_version=null&processType=content&product=Firefox&sanitize=1&sort_keys=submissions&start_date=2018-06-25&table=0&trim=1&use_submission_date=0> says there are no uses at all: 0 sample sum out  of 8.78e9 samples.

The use counter for mozCreateFileHandle seems to not exist at all, suggesting that we were never hitting that codepath.

This is sounding like stuff we might be able to just remove...
The mutable file handle stuff is all b2g-era stuff exposed by IndexedDB and the dead DeviceStorage API (https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/API/Device_Storage_API) that we probably should indeed  remove.  :janv, do you concur?

In terms of consumers, the Mozilla dweb project at https://github.com/mozilla/libdweb seems to be trying to bring back many of the b2g APIs that were removed/disabled so that they can be exposed to WebExtensions.  In particular, https://github.com/Gozala/random-access-idb-mutable-file/ builds on top of IDBMutableFile.  Note that I don't think that's a reason to keep the API around in IndexedDB.  IndexedDB's clever refcounted blob storage seems like a sufficient abstraction layer for higher level storage stuff to build on.
Flags: needinfo?(bugmail) → needinfo?(jvarga)
Yeah, the counters were added in bug 1271457. There are no uses, so I think it's time to remove it.
I filed bug 1500343 for that.
Flags: needinfo?(jvarga)
Depends on: 1500343
Keywords: dev-doc-needed
Keywords: site-compat
Priority: -- → P5
OK, so the BrowserElement API... Is it used at all?  Could we just remove it?
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #5)
> OK, so the BrowserElement API... Is it used at all?  Could we just remove it?

IIRC it's used by the devtools team for the responsive design view and that's why we've had to keep it around.  (I'd love if someone could convince them to switch to <xul:browser> but perhaps in the last year or two other consumers have crept in.)

Perhaps it would be nice to find a way to prevent new consumers from using the API at least.  :-)
> IIRC it's used by the devtools team for the responsive design view

Well, <iframe mozbrowser> is used.  But is the actual script API used?  Initial searchfoxing on some of the methods was only turning up test uses.

I guess I should try disabling the direct API tests, adding some MOZ_CRASH and doing a trypush...
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #7)
> > IIRC it's used by the devtools team for the responsive design view
> 
> Well, <iframe mozbrowser> is used.  But is the actual script API used? 
> Initial searchfoxing on some of the methods was only turning up test uses.

Removing the ones that aren't used above would be super nice!
Depends on: 1503070
Blocks: 902029
Type: enhancement → task
Severity: normal → S3
Depends on: 1880589
No longer blocks: 902029
Assignee: nobody → gregp
Status: NEW → ASSIGNED
Depends on: 1880615
Pushed by gp3033@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/31cf6b1269c8
Remove DOMRequest r=webidl,smaug,emilio
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch

Is this something we should call out in the Fx125 relnotes?

Flags: needinfo?(gregp)

Probably not. This interface was very obscure and can't be constructed by JS.

Flags: needinfo?(gregp)

I think this should have wait a bit until we could see it's completely good on 124, because the whole point of having a pref is to make it easy to reenable it without backing out any big chunk of patch.

Agreed. Should we back out now or wait and hope that there's no issue?

Backing out would be the safest option, yup.

Sorry for forgetting about this conversation 😬

So far, it seems we've gotten lucky and a backout hasn't been necessary.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: