Backed out changeset 44ee6030f4b2

This commit is contained in:
Benoit Girard
2010-04-19 02:57:22 -04:00
parent 60a9016f9c
commit c57c402923
15 changed files with 276 additions and 1142 deletions

View File

@@ -715,8 +715,7 @@ PluginModuleParent::NPP_New(NPMIMEType pluginType, NPP instance,
}
PluginInstanceParent* parentInstance =
new PluginInstanceParent(this, instance,
nsDependentCString(pluginType), mNPNIface);
new PluginInstanceParent(this, instance, mNPNIface);
if (!parentInstance->Init()) {
delete parentInstance;
@@ -783,35 +782,3 @@ PluginModuleParent::AnswerProcessSomeEvents()
return true;
}
#endif
#ifdef OS_MACOSX
#define DEFAULT_REFRESH_MS 20 // CoreAnimation: 50 FPS
void
PluginModuleParent::AddToRefreshTimer(PluginInstanceParent *aInstance) {
if (mCATimerTargets.Contains(aInstance)) {
return;
}
mCATimerTargets.AppendElement(aInstance);
if (mCATimerTargets.Length() == 1) {
mCATimer.Start(base::TimeDelta::FromMilliseconds(DEFAULT_REFRESH_MS),
this, &PluginModuleParent::CAUpdate);
}
}
void
PluginModuleParent::RemoveFromRefreshTimer(PluginInstanceParent *aInstance) {
PRBool visibleRemoved = mCATimerTargets.RemoveElement(aInstance);
if (visibleRemoved && mCATimerTargets.IsEmpty()) {
mCATimer.Stop();
}
}
void
PluginModuleParent::CAUpdate() {
nsTObserverArray<PluginInstanceParent*>::ForwardIterator iter(mCATimerTargets);
while (iter.HasMore()) {
iter.GetNext()->Invalidate();
}
}
#endif