diff options
author | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 16:49:00 +0000 |
---|---|---|
committer | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 16:49:00 +0000 |
commit | 54bd145ea8d6f197973a0c60d32bc42c86c91e53 (patch) | |
tree | 6f5b485bf599f803fa50100ce05937c19fd47975 /webkit/glue/plugins/webplugin_delegate_impl.h | |
parent | 9c45b718e0b24664945c98d7a6315e4666fe7c22 (diff) | |
download | chromium_src-54bd145ea8d6f197973a0c60d32bc42c86c91e53.zip chromium_src-54bd145ea8d6f197973a0c60d32bc42c86c91e53.tar.gz chromium_src-54bd145ea8d6f197973a0c60d32bc42c86c91e53.tar.bz2 |
Don't call NPP_SetWindow during the painting of windowless plugins.
On Windows, Flash seems to only start executing script actions after it received an NPP_SetWindow with a
non-NULL NPWindow.window (HDC). It is possible that Flash then invokes JS to modify DOM of the page.
If Flash movie's widget is on-screen at page load, this call is made during layout and before even the NPP_Write is called,
which is the desired sequence of events.
However, if it is off-screen, this call occurs during painting, which leads to re-entrancy issues (layout while painting)
and bizarre crashes.
As a solution, we remove calls to NPP_SetWindow during painting and instead opt to never provide a null HDC to the plugin.
If no valid HDC is available, we feed it a disposable monochrome 1x1 context to have at least something to draw on.
R=ananta,darin,jam
BUG=16114
TEST=LayoutTests/plugins/flash-setwindow-paint-crash.html (bug reduction).
Review URL: http://codereview.chromium.org/159717
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/webplugin_delegate_impl.h')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index 9fec1f6..408a710 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -162,6 +162,8 @@ class WebPluginDelegateImpl : public WebPluginDelegate { gfx::Rect windowed_last_pos_; #endif + // TODO(dglazkov): No longer used by Windows, make sure the removal + // causes no regressions and eliminate from other platforms. // this is an optimization to avoid calling SetWindow to the plugin // when it is not necessary. Initially, we need to call SetWindow, // and after that we only need to call it when the geometry changes. |