summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/Plugins
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
commitd0424a769059c84ae20beb3c217812792ea6726b (patch)
tree6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/WebKit2/WebProcess/Plugins
parent88a04ac016f57c2d78e714682445dff2e7db4ade (diff)
downloadqtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins')
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp8
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp13
-rw-r--r--Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h2
3 files changed, 11 insertions, 12 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
index 75838ec80..3a428e63a 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
@@ -688,14 +688,20 @@ static void NPN_ReleaseObject(NPObject *npObject)
static bool NPN_Invoke(NPP npp, NPObject *npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
+ RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+ PluginDestructionProtector protector(plugin.get());
+
if (npObject->_class->invoke)
return npObject->_class->invoke(npObject, methodName, arguments, argumentCount, result);
return false;
}
-static bool NPN_InvokeDefault(NPP, NPObject *npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+static bool NPN_InvokeDefault(NPP npp, NPObject *npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
+ RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+ PluginDestructionProtector protector(plugin.get());
+
if (npObject->_class->invokeDefault)
return npObject->_class->invokeDefault(npObject, arguments, argumentCount, result);
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index e37d75269..01238cbc1 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -375,21 +375,15 @@ uint32_t NetscapePlugin::scheduleTimer(unsigned interval, bool repeat, void (*ti
// FIXME: Based on the plug-in visibility, figure out if we should throttle the timer, or if we should start it at all.
timer->start();
- m_timers.set(timerID, timer.leakPtr());
+ m_timers.set(timerID, timer.release());
return timerID;
}
void NetscapePlugin::unscheduleTimer(unsigned timerID)
{
- TimerMap::iterator it = m_timers.find(timerID);
- if (it == m_timers.end())
- return;
-
- OwnPtr<Timer> timer = adoptPtr(it->second);
- m_timers.remove(it);
-
- timer->stop();
+ if (OwnPtr<Timer> timer = m_timers.take(timerID))
+ timer->stop();
}
double NetscapePlugin::contentsScaleFactor()
@@ -687,7 +681,6 @@ void NetscapePlugin::destroy()
platformDestroy();
- deleteAllValues(m_timers);
m_timers.clear();
}
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index f0d948b0e..2c290c76b 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -308,7 +308,7 @@ private:
WebCore::RunLoop::Timer<Timer> m_timer;
};
- typedef HashMap<unsigned, Timer*> TimerMap;
+ typedef HashMap<unsigned, OwnPtr<Timer> > TimerMap;
TimerMap m_timers;
unsigned m_nextTimerID;