2010-12-22 Simon Fraser Reviewed by Darin Adler. Cache snapshots of plug-ins before painting, to avoid script running during painting https://bugs.webkit.org/show_bug.cgi?id=51493 When FrameView is asked to do a flattening paint (e.g. when Safari snapshots, or when printing), plug-ins which otherwise use the CA rendering model are sent a paint event. Some plug-ins may run script while handling this event, or out of process plug-ins may process queued requests at this time. Running script while inside layout or painting can have bad consequences, because it can result in arbitrary changes to the render tree. This patch avoids sending plug-ins paint events inside of painting. Instead, we ask the plug-ins to cache a snapshot before we paint, and then the software paint simply draws that snapshot. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView drawRect:]): If we have a cached snapshot, draw it. Also only send the snapshot message to the plugin proxy if we know we're snapshotting, since even if creating the snapshot image failed, we still don't want to call to the plug-in. * Plugins/WebBaseNetscapePluginView.h: Add a retained NSImage member for the snapshot. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView cacheSnapshot]): Create an image and draw the snapshot into it. (-[WebBaseNetscapePluginView clearCachedSnapshot]): Clear the snapshot. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView drawRect:]): If we have a cached snapshot, use it. * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::notifyWidget): Implement notifyWidget() and use it to cache and clear the snapshots. 2010-12-21 Cameron Zwarich Reviewed by Darin Adler. -[WebBasePluginPackage isNativeLibraryData:] integer underflows on zero-sized data https://bugs.webkit.org/show_bug.cgi?id=51431 * Plugins/WebBasePluginPackage.mm: (-[WebBasePluginPackage isNativeLibraryData:]): Change an arithmetic expression so it doesn't underflow. 2010-12-16 Ryosuke Niwa Reviewed by Cameron Zwarich. REGRESSION(r74172): 125 java tests fail on Mac https://bugs.webkit.org/show_bug.cgi?id=51214 The regression was caused by an incorrectly adding sizeof(struct fat_header) to a pointer for uint32_t as supposed to uint8_t. Fixed the bug by explicitly casting it to uint8_t* before the addition. * Plugins/WebBasePluginPackage.mm: (-[WebBasePluginPackage isNativeLibraryData:]): 2010-12-15 Cameron Zwarich Reviewed by Darin Adler. Clang -Wcast-align gives an error in WebBasePluginPackage.mm https://bugs.webkit.org/show_bug.cgi?id=51144 Fix an alignment issue. OSSwapInt32 takes data that is 32-bit aligned on ARM, but we were calling it on a byte array 32 bits at a time. While this is okay in practice, since TCMalloc won't give us a non-32-bit aligned block array of bytes and Vector's inline storage is at the beginning of the Vector, it is still better to fix this and silence the warning. * Plugins/WebBasePluginPackage.mm: (swapIntsInHeader): (-[WebBasePluginPackage isNativeLibraryData:]): 2010-12-14 Mark Rowe Reviewed by Sam Weinig. Reproducible crash inside WebCore::MediaPlayerPrivateQTKit::createQTMovie when loading