diff options
Diffstat (limited to 'WebKit/mac/Plugins')
6 files changed, 18 insertions, 15 deletions
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm index 067b8bb..4506f03 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm @@ -74,7 +74,8 @@ public: ~PluginDestroyDeferrer() { - m_proxy->didCallPluginFunction(); + bool stopped; + m_proxy->didCallPluginFunction(stopped); } private: diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 3081120..f784ade 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -153,7 +153,7 @@ public: void invalidate(); void willCallPluginFunction(); - void didCallPluginFunction(); + void didCallPluginFunction(bool& stopped); bool shouldStop(); uint32_t nextRequestID(); @@ -262,8 +262,14 @@ public: ASSERT(reply->m_type == T::ReplyType); m_waitingForReply = false; - - didCallPluginFunction(); + + bool stopped = false; + didCallPluginFunction(stopped); + if (stopped) { + // The instance proxy may have been deleted from didCallPluginFunction(), so a null reply needs to be returned. + delete static_cast<T*>(reply); + return std::auto_ptr<T>(); + } return std::auto_ptr<T>(static_cast<T*>(reply)); } diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index a2d4a96..ecaa0d6 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -1455,7 +1455,7 @@ void NetscapePluginInstanceProxy::willCallPluginFunction() m_pluginFunctionCallDepth++; } -void NetscapePluginInstanceProxy::didCallPluginFunction() +void NetscapePluginInstanceProxy::didCallPluginFunction(bool& stopped) { ASSERT(m_pluginFunctionCallDepth > 0); m_pluginFunctionCallDepth--; @@ -1465,6 +1465,7 @@ void NetscapePluginInstanceProxy::didCallPluginFunction() if (!m_pluginFunctionCallDepth && m_shouldStopSoon) { m_shouldStopSoon = false; [m_pluginView stop]; + stopped = true; } } diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index 63a7b6a..362dd97 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -380,9 +380,11 @@ extern "C" { - (void)pluginHostDied { - RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer()); - if (renderer) + if (_element->renderer() && _element->renderer()->isEmbeddedObject()) { + // FIXME: The renderer could also be a RenderApplet, we should handle that. + RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer()); renderer->setShowsCrashedPluginIndicator(); + } _pluginLayer = nil; _proxy = 0; diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 708b017..b6b8b64 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -326,8 +326,6 @@ String WebHaltablePlugin::pluginName() const - (void)restartTimers { - ASSERT([self window]); - [self stopTimers]; if (!_isStarted || [[self window] isMiniaturized]) diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm index 3d2b68e..a3aca1f 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm @@ -49,8 +49,6 @@ static void getCarbonEvent(EventRecord* carbonEvent) carbonEvent->when = TickCount(); GetGlobalMouse(&carbonEvent->where); - carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor()); - carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor()); carbonEvent->modifiers = GetCurrentKeyModifiers(); if (!Button()) carbonEvent->modifiers |= btnState; @@ -87,11 +85,8 @@ static EventModifiers modifiersForEvent(NSEvent *event) static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent) { - if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) { - carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor()); - carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor()); + if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) return; - } NSPoint where = [[cocoaEvent window] convertBaseToScreen:[cocoaEvent locationInWindow]]; |