thread support in plugins




14 years ago
8 years ago


(Reporter: borodin, Unassigned)



Firefox Tracking Flags

(Not tracked)




14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041112

If I invoke NPN_GetURL(instance,"javascript:someFunction()",NULL) in a separate
thread, then if this function tries to do anything with displayed content (or
even if it tries to alert()), mozilla crashes with asserts (###!!! ASSERTION:
nsPluginHostImpl not thread-safe: '_mOwningThread.GetThread() ==
PR_GetCurrentThread()', file nsPluginHostImpl.cpp, line 2550 )
Yet if the function does only changes to some hidden variables, everything's ok.
The problem is, I'm trying to implement some mechanism like eventing so that
plugin changes some other content on page asynchronously; and this requires
something like functions that allow independant threads doing so.

Reproducible: Always
Steps to Reproduce:

Comment 1

14 years ago
see e.g. bug 230017

Comment 2

14 years ago
reporter: note that DOM is not threadsafe. Making it so is nontrivial.
the NPAPI does not mind if you do things in threads, Java f.e. does so. it just
doesn't like it when you try to poke dom related creatures from other threads.

the plugin host, which is the thing that you caused to assert has some fairly
annoying objects floating around, but it could be marked as threadsafe. however,
given that you want to use a javascript url to interact with dom, that wouldn't
get you very far.
Assignee: nobody → jst

Comment 3

14 years ago
Anyway, I managed to handle it - via redirecting event to main thread using
Thanks for reply.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:

Comment 6

9 years ago
Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100413 Firefox/3.6.4
Please update if you are able to still reproduce with the latest nightly build
Whiteboard: [closeme 05-05-2010]

Comment 7

8 years ago
Assignee: jst → nobody
Depends on: 230017
Whiteboard: [closeme 05-05-2010]

Comment 8

8 years ago
NPAPI is single-threaded by design.
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.