DescriptionFix a race condition in the Java Bridge when adding objects
JavaBridgeDispatcherHost::AddNamedObject() currently has a race condition, as
it posts to the WEBKIT thread before sending the injected object to the
renderer. See bug for details.
To fix this, JavaBridgeDispatcherHost::AddNamedObject() now creates the
NPVariant_Param synchronously, and immediately sends this to the renderer. This
requires use of a route ID generator which is shared with the
JavaBridgeChannelHost. Creation of the JavaBridgeChannelHost and the
corresponding NPObjectStub is done asynchronously on the WEBKIT thread.
This means that the channel handle is not available when the Java Bridge is
first initialized in the renderer. To overcome this, the renderer obtains it
from the browser with a new sync IPC call.
- RenderViewImpl - OnJavaBridgeInit() no longer supplies a channel handle.
- JavaBridgeDispatcher - Lazily gets channel handle from browser.
- JavaBridgeDispatcherHost - Now a RVH obsever to provide channel handle.
Uses shared route ID generator to synchronously create the NPVariant_Param
when a new object is injected. Creates the JavaBridgeChannelHost and the
corresponding NPObjectStub asynchronously on the WEBKIT thread.
- JavaBridgeChannelHost - Shares a route ID generator with the
JavaBridgeDispatcherHost.
BUG=106691
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113802
Patch Set 1 #Patch Set 2 : Fix typo #
Total comments: 9
Patch Set 3 : Make route ID generator a plain static method #Patch Set 4 : Fixed rebase #
Total comments: 6
Patch Set 5 : Fixed nits #
Total comments: 9
Messages
Total messages: 8 (0 generated)
|