зеркало из https://github.com/mozilla/gecko-dev.git
backout 022be5c50732 for xul bustage
This commit is contained in:
Родитель
76e56f19d9
Коммит
b4d8f837c8
|
@ -67,11 +67,20 @@ anp_event_postEvent(NPP inst, const ANPEvent* event)
|
|||
{
|
||||
LOG("%s", __PRETTY_FUNCTION__);
|
||||
|
||||
JNIEnv* env = GetJNIForThread();
|
||||
if (!env)
|
||||
return;
|
||||
|
||||
if (!mozilla::AndroidBridge::Bridge()) {
|
||||
LOG("no bridge in %s!!!!", __PRETTY_FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(inst->ndata);
|
||||
NPPluginFuncs* pluginFunctions = pinst->GetPlugin()->PluginFuncs();
|
||||
PluginEventRunnable* e = new PluginEventRunnable(inst, const_cast<ANPEvent*>(event), pluginFunctions);
|
||||
|
||||
NS_DispatchToMainThread(e);
|
||||
mozilla::AndroidBridge::Bridge()->PostToJavaThread(env,
|
||||
new PluginEventRunnable(inst, const_cast<ANPEvent*>(event), pluginFunctions),
|
||||
true);
|
||||
LOG("returning from %s", __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,6 @@
|
|||
#include "base/logging.h"
|
||||
#include "base/scoped_nsautorelease_pool.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "AndroidBridge.h"
|
||||
#endif
|
||||
|
||||
using mozilla::ipc::DoWorkRunnable;
|
||||
using mozilla::ipc::MessagePump;
|
||||
using mozilla::ipc::MessagePumpForChildProcess;
|
||||
|
@ -115,10 +111,6 @@ MessagePump::Run(MessagePump::Delegate* aDelegate)
|
|||
if (!keep_running_)
|
||||
break;
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
AndroidBridge::Bridge()->PumpMessageLoop();
|
||||
#endif
|
||||
|
||||
did_work |= aDelegate->DoWork();
|
||||
if (!keep_running_)
|
||||
break;
|
||||
|
|
|
@ -137,8 +137,6 @@ public class GeckoAppShell
|
|||
|
||||
private static boolean mLocationHighAccuracy = false;
|
||||
|
||||
private static Handler sGeckoHandler;
|
||||
|
||||
/* The Android-side API: API methods that Android calls */
|
||||
|
||||
// Initialization methods
|
||||
|
@ -244,10 +242,6 @@ public class GeckoAppShell
|
|||
return GeckoApp.mAppContext.mMainHandler;
|
||||
}
|
||||
|
||||
public static Handler getGeckoHandler() {
|
||||
return sGeckoHandler;
|
||||
}
|
||||
|
||||
public static Handler getHandler() {
|
||||
return GeckoBackgroundThread.getHandler();
|
||||
}
|
||||
|
@ -437,9 +431,6 @@ public class GeckoAppShell
|
|||
}
|
||||
|
||||
public static void runGecko(String apkPath, String args, String url, boolean restoreSession) {
|
||||
Looper.prepare();
|
||||
sGeckoHandler = new Handler();
|
||||
|
||||
// run gecko -- it will spawn its own thread
|
||||
GeckoAppShell.nativeInit();
|
||||
|
||||
|
@ -2060,23 +2051,6 @@ public class GeckoAppShell
|
|||
GeckoScreenOrientationListener.getInstance().unlockScreenOrientation();
|
||||
}
|
||||
|
||||
public static void pumpMessageLoop() {
|
||||
// We're going to run the Looper below, but we need a way to break out, so
|
||||
// we post this Runnable that causes a divide by zero error. The Runnable
|
||||
// is added to the end of the queue, so it will be executed after anything
|
||||
// else that has been added prior.
|
||||
sGeckoHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
int zero = 0;
|
||||
int foo = 0xdeadbeef / zero;
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
Looper.loop();
|
||||
} catch(Exception ex) {}
|
||||
}
|
||||
|
||||
static class AsyncResultHandler extends GeckoApp.FilePickerResultHandler {
|
||||
private long mId;
|
||||
AsyncResultHandler(long id) {
|
||||
|
|
|
@ -191,7 +191,6 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
|||
jDisableScreenOrientationNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableScreenOrientationNotifications", "()V");
|
||||
jLockScreenOrientation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "lockScreenOrientation", "(I)V");
|
||||
jUnlockScreenOrientation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "unlockScreenOrientation", "()V");
|
||||
jPumpMessageLoop = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "pumpMessageLoop", "()V");
|
||||
|
||||
jEGLContextClass = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGLContext"));
|
||||
jEGL10Class = (jclass) jEnv->NewGlobalRef(jEnv->FindClass("javax/microedition/khronos/egl/EGL10"));
|
||||
|
@ -2131,15 +2130,6 @@ AndroidBridge::UnlockScreenOrientation()
|
|||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::PumpMessageLoop()
|
||||
{
|
||||
if (!mJNIEnv)
|
||||
return;
|
||||
|
||||
mJNIEnv->CallStaticVoidMethod(mGeckoAppShellClass, jPumpMessageLoop);
|
||||
}
|
||||
|
||||
/* attribute nsIAndroidBrowserApp browserApp; */
|
||||
NS_IMETHODIMP nsAndroidBridge::GetBrowserApp(nsIAndroidBrowserApp * *aBrowserApp)
|
||||
{
|
||||
|
|
|
@ -437,8 +437,6 @@ public:
|
|||
void LockScreenOrientation(const dom::ScreenOrientationWrapper& aOrientation);
|
||||
void UnlockScreenOrientation();
|
||||
|
||||
void PumpMessageLoop();
|
||||
|
||||
protected:
|
||||
static AndroidBridge *sBridge;
|
||||
|
||||
|
@ -550,7 +548,6 @@ protected:
|
|||
jmethodID jDisableScreenOrientationNotifications;
|
||||
jmethodID jLockScreenOrientation;
|
||||
jmethodID jUnlockScreenOrientation;
|
||||
jmethodID jPumpMessageLoop;
|
||||
|
||||
// stuff we need for CallEglCreateWindowSurface
|
||||
jclass jEGLSurfaceImplClass;
|
||||
|
|
Загрузка…
Ссылка в новой задаче