Bug 563737 - [QT] Detect when Qt plugins enter a nested event loop. r=cjones

This commit is contained in:
Tero Koskinen
2010-06-01 23:58:00 -04:00
parent bcb7cf268f
commit 2eb019409b
6 changed files with 218 additions and 1 deletions

View File

@@ -39,6 +39,10 @@
#ifdef MOZ_WIDGET_GTK2
#include <glib.h>
#endif
#ifdef MOZ_WIDGET_QT
#include <QtCore/QCoreApplication>
#include <QtCore/QEventLoop>
#endif
#include "base/process_util.h"
@@ -754,7 +758,20 @@ PluginModuleParent::AnswerNPN_GetValue_WithBoolReturn(const NPNVariable& aVariab
return true;
}
#if !defined(MOZ_WIDGET_GTK2)
#if defined(MOZ_WIDGET_QT)
static const int kMaxtimeToProcessEvents = 30;
bool
PluginModuleParent::AnswerProcessSomeEvents()
{
PLUGIN_LOG_DEBUG(("Spinning mini nested loop ..."));
QCoreApplication::processEvents(QEventLoop::AllEvents, kMaxtimeToProcessEvents);
PLUGIN_LOG_DEBUG(("... quitting mini nested loop"));
return true;
}
#elif !defined(MOZ_WIDGET_GTK2)
bool
PluginModuleParent::AnswerProcessSomeEvents()
{