Bug 574120 - Add support for IPC on Android to everything else, r=dougt

This commit is contained in:
Michael Wu 2010-06-25 13:29:43 -07:00
Родитель a682582859
Коммит 6ce8eb93c9
9 изменённых файлов: 47 добавлений и 3 удалений

Просмотреть файл

@ -5703,7 +5703,7 @@ dnl ========================================================
dnl = Disable IPC support for tabs and plugins
dnl ========================================================
case "${target}" in
*-wince*|*-android*)
*-wince*)
MOZ_IPC=
;;
esac

Просмотреть файл

@ -817,6 +817,10 @@ nsFrameLoader::ShowRemoteFrame(nsIFrameFrame* frame, nsIView* view)
// Don't create any parent/child XEmbed, because we are painting with shared memory
mChildProcess->SendcreateWidget(0);
}
#elif defined(ANDROID)
// Painting with shared memory
mChildProcess->SendcreateWidget(0);
#elif defined(XP_MACOSX)
# warning IMPLEMENT ME

Просмотреть файл

@ -431,6 +431,11 @@ TabChild::RecvcreateWidget(const MagicWindowHandle& parentWidget)
view->scene()->addItem(win);
#elif defined(XP_WIN)
HWND win = parentWidget;
#elif defined(ANDROID)
// Fake pointer to make baseWindow->InitWindow work
// The android widget code is mostly disabled in the child process
// so it won't choke on this
void *win = (void *)0x1234;
#elif defined(XP_MACOSX)
# warning IMPLEMENT ME
#else

Просмотреть файл

@ -23,6 +23,10 @@ typedef unsigned long MagicWindowHandle;
# warning This is a placeholder
typedef long MagicWindowHandle;
#elif defined(ANDROID)
/* we don't really use this */
typedef unsigned long MagicWindowHandle;
#else
#error Not implemented, stooge
#endif

Просмотреть файл

@ -124,7 +124,7 @@ struct NPRemoteWindow
typedef HWND NativeWindowHandle;
#elif defined(MOZ_X11)
typedef XID NativeWindowHandle;
#elif defined(XP_MACOSX)
#elif defined(XP_MACOSX) || defined(ANDROID)
typedef intptr_t NativeWindowHandle; // never actually used, will always be 0
#else
#error Need NativeWindowHandle for this platform

Просмотреть файл

@ -53,8 +53,10 @@
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/Omnijar.h"
#include <sys/stat.h>
#ifdef XP_WIN
@ -202,6 +204,14 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
path += "/lib";
#endif
newEnvVars["LD_LIBRARY_PATH"] = path.get();
#endif
#ifdef MOZ_OMNIJAR
// Make sure the child process can find the omnijar
// See ScopedXPCOMStartup::Initialize in nsAppRunner.cpp
nsCAutoString omnijarPath;
if (mozilla::OmnijarPath())
mozilla::OmnijarPath()->GetNativePath(omnijarPath);
newEnvVars["OMNIJAR_PATH"] = omnijarPath.get();
#endif
}
else {

Просмотреть файл

@ -107,8 +107,10 @@ STATIC_LIBS += ipdlunittest_s
endif
ifeq (Linux,$(OS_ARCH))
ifneq (Android,$(OS_TARGET))
OS_LIBS += -lrt
endif
endif
ifeq (WINNT,$(OS_ARCH))
OS_LIBS += dbghelp.lib
endif

Просмотреть файл

@ -1135,7 +1135,11 @@ ScopedXPCOMStartup::Initialize()
nsresult rv;
#ifdef MOZ_OMNIJAR
nsCOMPtr<nsILocalFile> lf;
rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
char *omnijarPath = getenv("OMNIJAR_PATH");
if (omnijarPath)
rv = NS_NewNativeLocalFile(nsDependentCString(omnijarPath), PR_TRUE, getter_AddRefs(lf));
else
rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
if (NS_SUCCEEDED(rv))
mozilla::SetOmnijar(lf);
#endif
@ -3756,6 +3760,17 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
#if defined(OS_WIN)
CommandLine::Init(aArgc, aArgv);
#else
#ifdef MOZ_OMNIJAR
nsCOMPtr<nsILocalFile> lf;
char *omnijarPath = getenv("OMNIJAR_PATH");
if (omnijarPath)
rv = NS_NewNativeLocalFile(nsDependentCString(omnijarPath), PR_TRUE, getter_AddRefs(lf));
else
rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
if (NS_SUCCEEDED(rv))
mozilla::SetOmnijar(lf);
#endif
// these leak on error, but that's OK: we'll just exit()
char** canonArgs = new char*[aArgc];

Просмотреть файл

@ -162,6 +162,10 @@ nsWindow::Create(nsIWidget *aParent,
ALOG("nsWindow[%p]::Create %p [%d %d %d %d]", (void*)this, (void*)aParent, aRect.x, aRect.y, aRect.width, aRect.height);
nsWindow *parent = (nsWindow*) aParent;
if (!AndroidBridge::Bridge()) {
aNativeParent = nsnull;
}
if (aNativeParent) {
if (parent) {
ALOG("Ignoring native parent on Android window [%p], since parent was specified (%p %p)", (void*)this, (void*)aNativeParent, (void*)aParent);