Closed Bug 434273 Opened 16 years ago Closed 2 years ago

Proxy manager should support proxies of non-threadsafe objects

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bent.mozilla, Unassigned)

Details

Attachments

(1 file)

Attached patch Patch, v1Splinter Review
Proxy manager should support proxies of non-threadsafe objects.

Currently the proxy manager will QI/AddRef/Release the target object on the thread that creates the proxy rather than on the target thread. This means that we rely on threadsafe AddRef and Release implementations and it makes it a pain to proxy some objects (like nsStandardURL, for example).

The attached patch guarantees that all methods (including nsISupports) will be called on the target thread.

I added a flag to proxy creation so that callers can avoid a bit of a performance hit if they know that their object has a threadsafe refcount, but I may remove it since it leaks a bunch of implementation through to the interface.

Also has tests :)
Attachment #321456 - Flags: review?(benjamin)
Comment on attachment 321456 [details] [diff] [review]
Patch, v1

Clearing review request: I'd prefer not to take this for 1.9.1 unless there's a client that really needs it:

and, if we do something like this, I think I'd prefer to require classinfo and proxy all the interfaces up front, rather than doing synchronous QI calls which can lead to strange deadlocks.
Attachment #321456 - Flags: review?(benjamin)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: bent.mozilla → nobody
Status: ASSIGNED → NEW

XPCOM proxies don't seem to exist any more.

Status: NEW → RESOLVED
Closed: 2 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: