Commit cf30df75 authored by andersca@apple.com's avatar andersca@apple.com

2009-04-23 Anders Carlsson <andersca@apple.com>

        Reviewed by Geoffrey Garen.

        Fix <rdar://problem/6821992>

        Add a new m_inDestroy member variable. Set it to true when in destroy, and have all NPRuntime functions return false
        when m_inDestroy is true.
        
        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
        (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
        (WebKit::NetscapePluginInstanceProxy::destroy):
        (WebKit::NetscapePluginInstanceProxy::invoke):
        (WebKit::NetscapePluginInstanceProxy::invokeDefault):
        (WebKit::NetscapePluginInstanceProxy::construct):
        (WebKit::NetscapePluginInstanceProxy::getProperty):
        (WebKit::NetscapePluginInstanceProxy::setProperty):
        (WebKit::NetscapePluginInstanceProxy::removeProperty):
        (WebKit::NetscapePluginInstanceProxy::hasProperty):
        (WebKit::NetscapePluginInstanceProxy::hasMethod):
        (WebKit::NetscapePluginInstanceProxy::enumerate):



git-svn-id: svn://svn.chromium.org/blink/trunk@42789 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bc883879
2009-04-23 Anders Carlsson <andersca@apple.com>
Reviewed by Geoffrey Garen.
Fix <rdar://problem/6821992>
Add a new m_inDestroy member variable. Set it to true when in destroy, and have all NPRuntime functions return false
when m_inDestroy is true.
* Plugins/Hosted/NetscapePluginInstanceProxy.h:
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
(WebKit::NetscapePluginInstanceProxy::destroy):
(WebKit::NetscapePluginInstanceProxy::invoke):
(WebKit::NetscapePluginInstanceProxy::invokeDefault):
(WebKit::NetscapePluginInstanceProxy::construct):
(WebKit::NetscapePluginInstanceProxy::getProperty):
(WebKit::NetscapePluginInstanceProxy::setProperty):
(WebKit::NetscapePluginInstanceProxy::removeProperty):
(WebKit::NetscapePluginInstanceProxy::hasProperty):
(WebKit::NetscapePluginInstanceProxy::hasMethod):
(WebKit::NetscapePluginInstanceProxy::enumerate):
2009-04-23 David Hyatt <hyatt@apple.com> 2009-04-23 David Hyatt <hyatt@apple.com>
Reviewed by Maciej. Reviewed by Maciej.
......
...@@ -297,6 +297,7 @@ private: ...@@ -297,6 +297,7 @@ private:
unsigned m_pluginFunctionCallDepth; unsigned m_pluginFunctionCallDepth;
bool m_shouldStopSoon; bool m_shouldStopSoon;
uint32_t m_currentRequestID; uint32_t m_currentRequestID;
bool m_inDestroy;
RefPtr<HostedNetscapePluginStream> m_manualStream; RefPtr<HostedNetscapePluginStream> m_manualStream;
}; };
......
...@@ -106,6 +106,7 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy ...@@ -106,6 +106,7 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
, m_pluginFunctionCallDepth(0) , m_pluginFunctionCallDepth(0)
, m_shouldStopSoon(false) , m_shouldStopSoon(false)
, m_currentRequestID(0) , m_currentRequestID(0)
, m_inDestroy(false)
{ {
ASSERT(m_pluginView); ASSERT(m_pluginView);
...@@ -192,11 +193,15 @@ void NetscapePluginInstanceProxy::destroy() ...@@ -192,11 +193,15 @@ void NetscapePluginInstanceProxy::destroy()
{ {
uint32_t requestID = nextRequestID(); uint32_t requestID = nextRequestID();
m_inDestroy = true;
_WKPHDestroyPluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID); _WKPHDestroyPluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID);
// We don't care about the reply here - we just want to block until the plug-in instance has been torn down. // We don't care about the reply here - we just want to block until the plug-in instance has been torn down.
waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID); waitForReply<NetscapePluginInstanceProxy::BooleanReply>(requestID);
m_inDestroy = false;
cleanup(); cleanup();
invalidate(); invalidate();
} }
...@@ -704,6 +709,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me ...@@ -704,6 +709,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me
resultData = 0; resultData = 0;
resultLength = 0; resultLength = 0;
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -735,6 +743,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me ...@@ -735,6 +743,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me
bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength) bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -765,6 +776,9 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume ...@@ -765,6 +776,9 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume
bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength) bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -796,6 +810,9 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD ...@@ -796,6 +810,9 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD
bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifier& propertyName, data_t& resultData, mach_msg_type_number_t& resultLength) bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifier& propertyName, data_t& resultData, mach_msg_type_number_t& resultLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -834,6 +851,9 @@ bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned proper ...@@ -834,6 +851,9 @@ bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned proper
bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength) bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -855,6 +875,9 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifie ...@@ -855,6 +875,9 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifie
bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned propertyName, data_t valueData, mach_msg_type_number_t valueLength) bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned propertyName, data_t valueData, mach_msg_type_number_t valueLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -875,6 +898,9 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned proper ...@@ -875,6 +898,9 @@ bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned proper
bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identifier& propertyName) bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identifier& propertyName)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -897,6 +923,9 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identi ...@@ -897,6 +923,9 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identi
bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned propertyName) bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned propertyName)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -919,6 +948,9 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned pro ...@@ -919,6 +948,9 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned pro
bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifier& propertyName) bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifier& propertyName)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -936,6 +968,9 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifie ...@@ -936,6 +968,9 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifie
bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned propertyName) bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned propertyName)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -953,6 +988,9 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned proper ...@@ -953,6 +988,9 @@ bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned proper
bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& methodName) bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& methodName)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
...@@ -970,6 +1008,9 @@ bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& ...@@ -970,6 +1008,9 @@ bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier&
bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength) bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength)
{ {
if (m_inDestroy)
return false;
JSObject* object = m_objects.get(objectID); JSObject* object = m_objects.get(objectID);
if (!object) if (!object)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment