Here's the patch that I'm using, which works for both new and old flash plugins. For old plugins which don't know how to do the negotiation, it defaults to using the QuickDraw model, and if the plugin negotiates Core Graphics, then it uses a CGContext. (See https://wiki.mozilla.org/Mac:NPAPI_Drawing_Models) .

Attachment: 4.5-tp1.src.3rdparty.webkit.WebCore.plugins.patch
Description: Binary data




I'm sure somebody who knows Netscape plugins and WebKit better than I can do better than this, but maybe this is a start.

On Nov 12, 2008, at 5:52 PM, Peter Johnson wrote:

I have at least partially solved the riddle of flash 9.0 r47 and
earlier crashing with QtWebKit in 4.5 tp1 on the Mac.

It basically boils down to this:

The NSAPI on Mac is based on the old QuickDraw model.  WebKit is
evolving towards the Core Graphics model and has introduced a way for
plugins to query for the drawing models supported by the browser.  The
Mac WebKit code in QtWebKit doesn't seem to do that negotiation yet
and it also assumes the Core Graphics model.  So I think the problem
here is that WebKit is providing a NP_CGContext as its NPWindow.window
and the flash plugin is assuming it an NS_Port instead.

I patched this to make it work, by instead assuming the QuickDraw
model.  A real solution would probably actually support the
negotiation mechanism, and then fail back to NP_Port if no negotiation
takes place.

I can provide an actual patch later (there are a bunch of other
unnecessary changes there right now), if requested, but it looks
something like this:

In src/3rdparty/webkit/WebCore/plugins/PluginView.h, add an NP_Port
variable above the NP_CGContext variable:

NP_Port  m_npQDPort;
NP_CGContext m_npCgContext;

In src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp:

in PluginView::init(), initialize the NP_Port:

m_npQDPort.port = 0;
m_npQDPort.portx = 0;
m_npQDPort.pory = 0;

and change m_npWindow.window to point to the m_npQDPort:

m_npWindow.window = (void *)& m_npQDPort;

and in PluginView::setNPWindowIfNeeded(), after the check to see if
there's new window geometry, a new window, or a new CGContext,
initialize m_npQDPort:

m_npQDPort.port = ::GetWindowPort( newWindowRef );
m_npQDPort.portx = newGeometry.x();
m_npQDPort.y = newGeometry.y();

and change m_npWindow.window to point to the m_npQDPort:

m_npWindow.window = (void *)& m_npQDPort;

That's it.  I still had some interesting drawing problems, but it no
longer crashes.  Still need test with other versions of the plugin as
well, but thought you might be interested.

On Nov 10, 2008, at 2:31 PM, Peter Johnson wrote:

On Oct 23, 2008, at 11:47 AM, Peter Johnson wrote:

With a Qt 4.5 tp1 app (the demo browser included), running on Mac
OS X
10.4.10, it crashes when loading flash content.  The flash plugin is
9.0 r28. This does *not* happen on Mac OS X 10.4.11 or 10.5.x (which
also have slightly newer flash plugins).


Some more information on this crash...

It doesn't have anything to do with the version of OS X, except to the
extent that it includes a particular version of the flash plugin.

I have had success with flash versions 9.0 r115 and 9.0 r124 on Mac OS
X 10.4.11 and 10.5.x.

I have experienced failure with flash versions 9.0 r28 and 9.0 r47 on
Mac OS X 10.4.10, 10.4.11, and 10.5.x.

Upgrading the flash plugin (to 10.0, which is current on Adobe's web
site) seems to work.  However, Safari does not crash with the 9.0 r47
version of the plugin, so it seems like Qt should be able to handle it
as well.  Has there been any progress on this?  I don't see anything
about this in Task Tracker.



_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to