Closed Bug 707196 Opened 13 years ago Closed 2 years ago

[meta] Deprecate and remove ways of doing blocking I/O on the main thread in JS

Categories

(Core :: General, defect)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: philikon, Unassigned)

Details

(Keywords: meta)

Bug 699820 is hurting us in terms of snappiness. Mishaps like bug 707090 and numerous add-ons demonstrate that purely the availability of blocking I/O calls will mean that people will inadvertently implement blocking I/O on the main thread. I propose that we deprecate and very quickly also *remove* ways to do blocking I/O on the main thread in JavaScript. I suggest starting with obvious culprits like Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream), and from there we can move on to the storage APIs and so on. Can we, perhaps, remove the [scriptable] flag from the relevant interface?
Well, the problem is not creating nsIFileInputStreams, it's reading from them synchronously ... killing nsIFileInputStream's scriptability would be a really big hammer.
We could check js stacks in debug builds and abort on io on main thread from js - whitelisted legacy files.
(In reply to Taras Glek (:taras) from comment #2) > We could check js stacks in debug builds and abort on io on main thread from > js - whitelisted legacy files. That doesn't help at all in the fight against bad add-ons.
(In reply to Shawn Wilsher :sdwilsh from comment #3) > (In reply to Taras Glek (:taras) from comment #2) > > We could check js stacks in debug builds and abort on io on main thread from > > js - whitelisted legacy files. > That doesn't help at all in the fight against bad add-ons. Indeed. Doesn't meant we shouldn't start somewhere.
Severity: normal → S3

Closing inactive metabugs

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.