Open
Bug 717877
Opened 13 years ago
Updated 1 year ago
nsUpdateService.js should use (async) XMLHttpRequest instead of DOMParser::parseFromStream
Categories
(Toolkit :: Application Update, defect, P3)
Toolkit
Application Update
Tracking
()
NEW
People
(Reporter: hsivonen, Assigned: WeirdAl)
References
(Blocks 2 open bugs)
Details
In order to avoid synchronous IO and in order to allow us to avoid maintaining chrome-only duplicate functionality, please migrate nsUpdateService.js to use XMLHttpRequest in the async mode with responseType set to "document" instead of using nsIDOMParser::parseFromStream.
Comment 1•13 years ago
|
||
Assigning a P2 as it's not clear how much of an impact this main thread IO has. Feel free to deprioritize.
Whiteboard: [Snappy] → [Snappy:P2]
Comment 2•12 years ago
|
||
To do this, it looks like nsUpdateService's ensureUpdates needs to be asynchronous, as well as all calling it, so things like getUpdateAt which is used in several places.
Updated•7 years ago
|
Summary: nsUpdateService.js should use (async) XMLHttpRequest instead of nsIDOMParser::parseFromStream → nsUpdateService.js should use (async) XMLHttpRequest instead of DOMParser::parseFromStream
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
Whiteboard: [Snappy:P2]
Reporter | ||
Comment 3•6 years ago
|
||
This is now the last use of parseFromStream
.
Assignee | ||
Comment 4•4 years ago
|
||
Saving for future reference:
const fileOptions = {
read : true,
write: fileName === FILE_ACTIVE_UPDATE_XML
};
let fileP = await OS.File.open(file.path, fileOptions);
let decoder = new TextDecoder('utf-8');
let contents = decoder.decode(await fileP.read());
var parser = new DOMParser();
var doc = parser.parseFromString(
contents,
"text/xml"
);
Assignee | ||
Updated•4 years ago
|
Assignee: nobody → ajvincent
Comment 5•4 years ago
|
||
Hi Hsin-Yi-
I'm needinfo-ing you because I wasn't sure who to ask about this, and you are on Triage for "DOM: Core & HTML". I wanted to make sure that changing out DOMParser::parseFromStream
for the solution in Comment 4 isn't going to have any unexpected side effects for us. Does this seem reasonable? Are there any cases we will need to handle differently?
Thanks!
Flags: needinfo?(htsai)
Reporter | ||
Comment 6•4 years ago
|
||
AFAICT, comment 4 should work albeit in theory a bit less efficiently than using XHR in the "document"
mode. (I haven't tested if XHR with local files works from chrome.)
Comment 7•4 years ago
|
||
(Comment 6 seemed to answer the NIed question, thank you Henri)
Flags: needinfo?(htsai)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•