bug 715507 - GlobalHistory is accessing Gecko on the wrong thread r=dougt,kats
This commit is contained in:
@@ -132,7 +132,9 @@ public class GeckoAppShell
|
||||
public static native void loadLibs(String apkName, boolean shouldExtract);
|
||||
public static native void onChangeNetworkLinkStatus(String status);
|
||||
public static native void reportJavaCrash(String stack);
|
||||
public static native void notifyUriVisited(String uri);
|
||||
public static void notifyUriVisited(String uri) {
|
||||
sendEventToGecko(new GeckoEvent(GeckoEvent.VISTITED, uri));
|
||||
}
|
||||
|
||||
public static native void processNextNativeEvent();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
@@ -80,6 +80,7 @@ public class GeckoEvent {
|
||||
public static final int BROADCAST = 19;
|
||||
public static final int VIEWPORT = 20;
|
||||
public static final int TILE_SIZE = 21;
|
||||
public static final int VISTITED = 22;
|
||||
|
||||
public static final int IME_COMPOSITION_END = 0;
|
||||
public static final int IME_COMPOSITION_BEGIN = 1;
|
||||
@@ -257,4 +258,8 @@ public class GeckoEvent {
|
||||
mCharacters = uri;
|
||||
}
|
||||
|
||||
public GeckoEvent(int type, String data) {
|
||||
mType = type;
|
||||
mCharacters = data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,6 @@ SHELL_WRAPPER1(onChangeNetworkLinkStatus, jstring)
|
||||
SHELL_WRAPPER1(reportJavaCrash, jstring)
|
||||
SHELL_WRAPPER0(executeNextRunnable)
|
||||
SHELL_WRAPPER1(cameraCallbackBridge, jbyteArray)
|
||||
SHELL_WRAPPER1(notifyUriVisited, jstring)
|
||||
SHELL_WRAPPER3(notifyBatteryChange, jdouble, jboolean, jdouble);
|
||||
SHELL_WRAPPER3(notifySmsReceived, jstring, jstring, jlong);
|
||||
SHELL_WRAPPER0(bindWidgetTexture);
|
||||
@@ -703,7 +702,6 @@ loadLibs(const char *apkName)
|
||||
GETFUNC(reportJavaCrash);
|
||||
GETFUNC(executeNextRunnable);
|
||||
GETFUNC(cameraCallbackBridge);
|
||||
GETFUNC(notifyUriVisited);
|
||||
GETFUNC(notifyBatteryChange);
|
||||
GETFUNC(notifySmsReceived);
|
||||
GETFUNC(bindWidgetTexture);
|
||||
|
||||
@@ -54,10 +54,6 @@
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsINetworkLinkService.h"
|
||||
|
||||
#ifdef MOZ_ANDROID_HISTORY
|
||||
#include "nsAndroidHistory.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
#include "nsICrashReporter.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
@@ -214,14 +210,6 @@ Java_org_mozilla_gecko_GeckoAppShell_executeNextRunnable(JNIEnv *, jclass)
|
||||
__android_log_print(ANDROID_LOG_INFO, "GeckoJNI", "leaving %s", __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_notifyUriVisited(JNIEnv *jenv, jclass, jstring uri)
|
||||
{
|
||||
#ifdef MOZ_ANDROID_HISTORY
|
||||
nsAndroidHistory::NotifyURIVisited(nsJNIString(uri, jenv));
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_notifyBatteryChange(JNIEnv* jenv, jclass,
|
||||
jdouble aLevel,
|
||||
|
||||
@@ -533,6 +533,7 @@ public:
|
||||
BROADCAST = 19,
|
||||
VIEWPORT = 20,
|
||||
TILE_SIZE = 21,
|
||||
VISITED = 22,
|
||||
dummy_java_enum_list_end
|
||||
};
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
#include <pthread.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef MOZ_ANDROID_HISTORY
|
||||
#include "nsAndroidHistory.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
#define FORCE_PR_LOG
|
||||
#include "prlog.h"
|
||||
@@ -445,6 +449,13 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
||||
break;
|
||||
}
|
||||
|
||||
case AndroidGeckoEvent::VISITED: {
|
||||
#ifdef MOZ_ANDROID_HISTORY
|
||||
nsAndroidHistory::NotifyURIVisited(nsString(curEvent->Characters()));
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
nsWindow::OnGlobalAndroidEvent(curEvent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user