Closed
Bug 717567
Opened 13 years ago
Closed 6 years ago
toolkit/mozapps/extensions/nsBlocklistService.js should use XHR instead of DOMParser::parseFromStream
Categories
(Toolkit :: Add-ons Manager, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: hsivonen, Assigned: Unfocused)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Snappy:P2][blocked by bug 782261])
Attachments
(1 obsolete file)
Please migrate nsBlocklistService to asynchronous XHR both to avoid synchronous IO and to allow us to get rid of nsIDOMParser::parseFromStream.
Updated•13 years ago
|
Whiteboard: [Snappy] → [Snappy:P2]
Updated•12 years ago
|
Assignee: nobody → andres
Comment 1•12 years ago
|
||
Migrated nsIDOMParser to XHR async call.
Attachment #650725 -
Flags: review?(hsivonen)
Assignee | ||
Comment 2•12 years ago
|
||
Comment on attachment 650725 [details] [diff] [review]
Patch v1
Review of attachment 650725 [details] [diff] [review]:
-----------------------------------------------------------------
Unfortunately, making _loadBlocklistFromFile() async involves quite a lot more than this. All its callers assume it fetches the data synchronously - including most of the public methods, which means changing most of the nsIBlocklistService interface and most uses of it.
The blocklist in general just needs a rewrite (bug 782261). There's a lot of architectural issues like this, and a lot of things we want to do that are rather difficult/awkward to do with the current code.
And doing all the extra work of making the current blocklist code async seems like a wasted effort, when it would be thrown away in a more complete and more thought-out rewrite. So in the mean time, I think we need to keep that method synchronous.
However... apparently using sync XHR is worse than using parseFromStream(). AFAIK, its safe to use parseFromString() instead.
Attachment #650725 -
Flags: review?(hsivonen) → review-
Comment 3•12 years ago
|
||
So... sounds like this should be resolved wontfix and kept in mind when fixing bug 782261?
Assignee | ||
Comment 4•12 years ago
|
||
Would like to get Henri to weigh in regarding how quickly he wants/needs to remove parseFromStream(). It looks like this bug isn't the only one that would have difficulty dealing with that.
Bug 782261 is going to take quite some time. Converting to use parseFromString() (which is sync and isn't being removed) seems like a reasonable short-term solution. But I'd also rather not have unnecessary code churn if parseFromStream() can't go away any time soon because a bunch of other things also depend on it.
Reporter | ||
Comment 5•12 years ago
|
||
(In reply to Blair McBride (:Unfocused) from comment #4)
> Would like to get Henri to weigh in regarding how quickly he wants/needs to
> remove parseFromStream(). It looks like this bug isn't the only one that
> would have difficulty dealing with that.
I worry that if I say "not soon", it will get treated as "never", but in honesty, I expect that my work won't get blocked on this not having been fixed in the next 6 months. Can't guess further ahead than that.
> Bug 782261 is going to take quite some time. Converting to use
> parseFromString() (which is sync and isn't being removed) seems like a
> reasonable short-term solution.
Using that one wouldn't help you get rid of sync IO if you had to synchronously ingest a stream and convert in into a string in order to call parseFromString().
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #5)
> I worry that if I say "not soon", it will get treated as "never", but in
> honesty, I expect that my work won't get blocked on this not having been
> fixed in the next 6 months. Can't guess further ahead than that.
Ok, that helps to know, thanks. In that case, I'd lean towards not fixing this for now. Even without the pending removal of parseFromStream(), that code needs rewritten anyway, so this won't be left unfixed forever. If for some reason bug 782261 isn't fixed in time, we can revisit this.
Andres: Does that seem reasonable to you?
Comment 7•12 years ago
|
||
Sure, np.
Assignee | ||
Updated•12 years ago
|
Assignee: andres → bmcbride
Status: NEW → ASSIGNED
Depends on: 782261
Whiteboard: [Snappy:P2] → [Snappy:P2][blocked by bug 782261]
Assignee | ||
Updated•12 years ago
|
Attachment #650725 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Updated•7 years ago
|
Summary: toolkit/mozapps/extensions/nsBlocklistService.js should use XHR instead of nsIDOMParser::parseFromStream → toolkit/mozapps/extensions/nsBlocklistService.js should use XHR instead of DOMParser::parseFromStream
Comment 8•6 years ago
|
||
Gijs, did you fix this (or otherwise make it irrelevant) with your recent blocklist improvements?
Flags: needinfo?(gijskruitbosch+bugs)
Comment 9•6 years ago
|
||
Yes, this is gone now. Though there's still other consumers of `parseFromStream`, unfortunately...
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(gijskruitbosch+bugs)
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•