Closed Bug 534345 Opened 16 years ago Closed 3 years ago

XPCOM should refuse to hand out main-thread only components when not on the main thread

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: peterv, Unassigned)

References

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

Attached patch v1 — — Splinter Review
Some addons try to use main-thread only components from other threads, which leads to crashes (see for example bug 521748). We should return null in that case, some addons will then crash accessing a null-pointer (again, see bug 521748), but at least it'll be a controlled crash instead of the random crashes we're currently seeing.
i've wanted this for ages. I'm not actually certain this is the best way to go. but iirc we never got auto proxy working. Component/Extension authors should be informed that they need to proxy their code to the main thread if they need a mainthread object.
Keywords: dev-doc-needed
Severity: normal → S3
Assignee: peterv → nobody
Status: ASSIGNED → NEW
See Also: → 961019

nsIClassInfo::MAIN_THREAD_ONLY is barely used nowadays so I'm not sure this is worthwhile.

See Also: 961019 →
See Also: → 961019

Nika pointed out that nsIClassInfo is really an XPConnect concept, which is mainthread anyways, and that maybe we'd want a similar mechanism for components, but you'd want to indicate it some other way.

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

Attachment

General

Created:
Updated:
Size: