Bug 534644 - e10s: implement Qt ipc/chromium backend, part 2. r=benjamin.

This commit is contained in:
Oleg Romashin 2010-01-29 08:50:44 +02:00
parent 02247de2ad
commit 76f524a22a
6 changed files with 37 additions and 17 deletions

View File

@ -112,8 +112,6 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef MOZ_X11
ifdef MOZ_ENABLE_GTK2
CXXFLAGS += $(TK_CFLAGS)
LDFLAGS += $(TK_LIBS)
endif
endif

View File

@ -476,6 +476,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow,
return false;
if (aWindow.type == NPWindowTypeWindow) {
#ifdef MOZ_WIDGET_GTK2
if (GdkWindow* socket_window = gdk_window_lookup(aWindow.window)) {
// A GdkWindow for the socket already exists. Need to
// workaround https://bugzilla.gnome.org/show_bug.cgi?id=607061
@ -484,6 +485,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow,
"moz-existed-before-set-window",
GUINT_TO_POINTER(1));
}
#endif
}
*rv = mPluginIface->setwindow(&mData, &mWindow);

View File

@ -177,7 +177,7 @@ PluginModuleChild::Init(const std::string& aPluginFilename,
return true;
}
#if defined(OS_LINUX)
#if defined(MOZ_WIDGET_GTK2)
typedef void (*GObjectDisposeFn)(GObject*);
typedef void (*GtkPlugEmbeddedFn)(GtkPlug*);
@ -253,6 +253,7 @@ PluginModuleChild::InitGraphics()
GtkPlugEmbeddedFn* embedded = &GTK_PLUG_CLASS(gtk_plug_class)->embedded;
real_gtk_plug_embedded = *embedded;
*embedded = wrap_gtk_plug_embedded;
#elif defined(MOZ_WIDGET_QT)
#else
// may not be necessary on all platforms
#endif

View File

@ -106,9 +106,8 @@ DEFINES += \
# NB: to stop gcc warnings about exporting template instantiation
OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS))
# TODO support !GTK
OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS)
OS_CFLAGS += $(MOZ_GTK2_CFLAGS)
OS_CXXFLAGS += $(TK_CFLAGS)
OS_CFLAGS += $(TK_CFLAGS)
endif # }
endif # }

View File

@ -281,6 +281,9 @@ XRE_InitChildProcess(int aArgc,
sChildProcessType = aProcess;
gArgv = aArgv;
gArgc = aArgc;
SetupErrorHandling(aArgv[0]);
#if defined(MOZ_WIDGET_GTK2)

View File

@ -51,6 +51,13 @@
#include "prlog.h"
#endif
#ifdef MOZ_IPC
#include <QApplication>
static QApplication *sQApp = nsnull;
extern int gArgc;
extern char **gArgv;
#endif
#ifdef PR_LOGGING
PRLogModuleInfo *gWidgetLog = nsnull;
PRLogModuleInfo *gWidgetFocusLog = nsnull;
@ -62,6 +69,11 @@ static int sPokeEvent;
nsAppShell::~nsAppShell()
{
#ifdef MOZ_IPC
if (sQApp)
delete sQApp;
sQApp = nsnull;
#endif
}
nsresult
@ -82,6 +94,13 @@ nsAppShell::Init()
#else
sPokeEvent = QEvent::User+5000;
#endif
#ifdef MOZ_IPC
if (!qApp) {
sQApp = new QApplication(gArgc, (char**)gArgv);
}
#endif
return nsBaseAppShell::Init();
}
@ -96,18 +115,16 @@ nsAppShell::ScheduleNativeEventCallback()
PRBool
nsAppShell::ProcessNextNativeEvent(PRBool mayWait)
{
QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents;
if (mayWait)
flags |= QEventLoop::WaitForMoreEvents;
QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance(qApp->thread());
if (!dispatcher)
return PR_FALSE ;
return dispatcher->processEvents(flags)?PR_TRUE:PR_FALSE;
QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents;
if (mayWait)
flags |= QEventLoop::WaitForMoreEvents;
QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance(qApp->thread());
if (!dispatcher)
return PR_FALSE;
return dispatcher->processEvents(flags) ? PR_TRUE : PR_FALSE;
}
bool