Closed Bug 1132347 Opened 6 years ago Closed 4 years ago
Background Request ignore errors only in the main thread
Because it is annotated as [SetterThrows=Workers] while it can actually fail even in the main thread. Is this intentional? If so, why is it different between the main thread and workers?
This totally looks like a bug. Should just be SetterThrows. Want to fix?
Assignee: nobody → VYV03354
|void SetMozBackgroundRequest(bool, nsresult&)| was not even called, it was not even updated when ErrorResult was introduced. The compiler didn't catch the error because the signature of the XPCOM version (that is, |NS_IMETHODIMP nsXMLHttpRequest::SetMozBackgroundRequest(bool)|) happened to match the signature of the infallible WebIDL setter function (the difference of the return type did not matter). Is it possible to prevent similar mistakes in the future?
Attachment #8564126 - Flags: review?(bzbarsky)
> |void SetMozBackgroundRequest(bool, nsresult&)| was not even called ...from the generated code. It is called from the XPCOM version, of course.
Comment on attachment 8564126 [details] [diff] [review] patch r=me As far as preventing this in the future, I filed bug 1132934.
Attachment #8564126 - Flags: review?(bzbarsky) → review+
Hm, some tests set mozBackgroundRequest after open() that should have no effect... /dom/system/NetworkGeolocationProvider.js /toolkit/components/search/SearchSuggestionController.jsm /toolkit/identity/Identity.jsm
Fixed by bug 1269162.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.