summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-05 20:57:17 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-05 20:57:17 +0000
commit32c0554d87e4db5e73ac96c4c3b23a56dd6b7f33 (patch)
tree00d9aca2ad9ed641b62dfbc9bacd4afec3c7733d /webkit
parentada32fe1849e988ff0000d493695f94aee184bc4 (diff)
downloadchromium_src-32c0554d87e4db5e73ac96c4c3b23a56dd6b7f33.zip
chromium_src-32c0554d87e4db5e73ac96c4c3b23a56dd6b7f33.tar.gz
chromium_src-32c0554d87e4db5e73ac96c4c3b23a56dd6b7f33.tar.bz2
Fix DivX crash on the Mac
Protect all instances of NPP_HandleEvent from being sent before NPP_SetWindow return; this could happen if a plugin made a synchronous call from within NPP_SetWindow, and we thus ended up in a nested call. Unblacklist DivX 2.0 since it no longer crashes. BUG=25690 TEST=Visit DixX test sites (see bug); plugin should not crash (although video may not draw). Review URL: http://codereview.chromium.org/1622002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_list_mac.mm6
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm13
2 files changed, 10 insertions, 9 deletions
diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm
index fe0d4da..7a3842a 100644
--- a/webkit/glue/plugins/plugin_list_mac.mm
+++ b/webkit/glue/plugins/plugin_list_mac.mm
@@ -49,12 +49,6 @@ bool IsBlacklistedPlugin(const WebPluginInfo& info) {
if (plugin_name == "VLC Multimedia Plug-in")
return true;
- // Newer versions crash immediately; unblacklist once we've fixed the crash.
- if (plugin_name == "DivX Web Player" &&
- !StartsWith(info.version, L"1.4", false)) {
- return true;
- }
-
// We blacklist a couple of plugins by included MIME type, since those are
// more stable than their names. Be careful about adding any more plugins to
// this list though, since it's easy to accidentally blacklist plugins that
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index 90acc5f..74631fe 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -492,8 +492,9 @@ void WebPluginDelegateImpl::DrawLayerInSurface() {
void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context,
const gfx::Rect& damage_rect) {
- // If we somehow get a paint before we've set up the plugin buffer, bail.
- if (!buffer_context_)
+ // If we get a paint event before we are completely set up (e.g., a nested
+ // call while the plugin is still in NPP_SetWindow), bail.
+ if (!have_called_set_window_ || !buffer_context_)
return;
DCHECK(buffer_context_ == context);
@@ -601,6 +602,9 @@ std::set<WebPluginDelegateImpl*> WebPluginDelegateImpl::GetActiveDelegates() {
}
void WebPluginDelegateImpl::FocusChanged(bool has_focus) {
+ if (!have_called_set_window_)
+ return;
+
if (has_focus == have_focus_)
return;
have_focus_ = has_focus;
@@ -1030,7 +1034,7 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
const WebInputEvent& event, WebCursorInfo* cursor_info) {
DCHECK(cursor_info != NULL);
- // If we somehow get an event before we've set up the plugin, bail.
+ // If we get an event before we've set up the plugin, bail.
if (!have_called_set_window_)
return false;
#ifndef NP_NO_CARBON
@@ -1179,6 +1183,9 @@ void WebPluginDelegateImpl::FireIdleEvent() {
// Avoid a race condition between IO and UI threads during plugin shutdown
if (!instance())
return;
+ // Don't send idle events until we've called SetWindow.
+ if (!have_called_set_window_)
+ return;
#ifndef NP_NO_QUICKDRAW
// Check whether it's time to turn the QuickDraw fast path back on.