diff --git a/embedding/android/GeckoEvent.java b/embedding/android/GeckoEvent.java index 8940ecce7765..c3f4e892b517 100644 --- a/embedding/android/GeckoEvent.java +++ b/embedding/android/GeckoEvent.java @@ -334,9 +334,4 @@ public class GeckoEvent { mBandwidth = bandwidth; mCanBeMetered = canBeMetered; } - - public void doCallback(String json) { - // this stub is never called in XUL Fennec, but we need it so that the JNI code - // shared between XUL and Native Fennec doesn't die. - } } diff --git a/mobile/android/base/GeckoEvent.java b/mobile/android/base/GeckoEvent.java index 65a40340b06c..765c3081f42e 100644 --- a/mobile/android/base/GeckoEvent.java +++ b/mobile/android/base/GeckoEvent.java @@ -63,10 +63,6 @@ import android.util.Log; */ public class GeckoEvent { - public interface Callback { - public void callback(GeckoEvent event, String jsonData); - } - private static final String LOGTAG = "GeckoEvent"; private static final int INVALID = -1; @@ -142,8 +138,6 @@ public class GeckoEvent { public int mNativeWindow; - Callback mCallback; - private GeckoEvent(int evType) { mType = evType; } @@ -422,10 +416,4 @@ public class GeckoEvent { event.mMetaState = tabId; return event; } - - public void doCallback(String jsonData) { - if (mCallback != null) { - mCallback.callback(this, jsonData); - } - } } diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index 90fed9715d92..528b55cee85f 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -76,7 +76,6 @@ jfieldID AndroidGeckoEvent::jLocationField = 0; jfieldID AndroidGeckoEvent::jAddressField = 0; jfieldID AndroidGeckoEvent::jBandwidthField = 0; jfieldID AndroidGeckoEvent::jCanBeMeteredField = 0; -jmethodID AndroidGeckoEvent::jDoCallbackMethod = 0; jclass AndroidPoint::jPointClass = 0; jfieldID AndroidPoint::jXField = 0; @@ -208,8 +207,6 @@ AndroidGeckoEvent::InitGeckoEventClass(JNIEnv *jEnv) jAddressField = getField("mAddress", "Landroid/location/Address;"); jBandwidthField = getField("mBandwidth", "D"); jCanBeMeteredField = getField("mCanBeMetered", "Z"); - - jDoCallbackMethod = getMethod("doCallback", "(Ljava/lang/String;)V"); } void @@ -488,16 +485,6 @@ AndroidGeckoEvent::Init(int aType, nsIntRect const& aRect) mRect = aRect; } -AndroidGeckoEvent::~AndroidGeckoEvent() { - if (!wrapped_obj) - return; - - JNIEnv *jenv = GetJNIForThread(); - if (!jenv) - return; - jenv->DeleteGlobalRef(wrapped_obj); -} - void AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj) { @@ -508,8 +495,6 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj) if (!jobj) return; - jenv->NewGlobalRef(jobj); - mAction = jenv->GetIntField(jobj, jActionField); mType = jenv->GetIntField(jobj, jTypeField); @@ -670,15 +655,6 @@ AndroidPoint::Init(JNIEnv *jenv, jobject jobj) } } -void -AndroidGeckoEvent::DoCallback(const nsAString& data) { - JNIEnv* env = AndroidBridge::GetJNIEnv(); - if (!env) - return; - jstring jData = env->NewString(nsPromiseFlatString(data).get(), data.Length()); - env->CallVoidMethod(wrapped_obj, jDoCallbackMethod, jData); -} - void AndroidGeckoLayerClient::Init(jobject jobj) { diff --git a/widget/android/AndroidJavaWrappers.h b/widget/android/AndroidJavaWrappers.h index d9a9ce96e02b..690217c2b61b 100644 --- a/widget/android/AndroidJavaWrappers.h +++ b/widget/android/AndroidJavaWrappers.h @@ -495,8 +495,6 @@ public: Init(aResizeEvent); } - ~AndroidGeckoEvent(); - void Init(JNIEnv *jenv, jobject jobj); void Init(int aType); void Init(int x1, int y1, int x2, int y2); @@ -536,7 +534,6 @@ public: nsGeoPositionAddress* GeoAddress() { return mGeoAddress; } double Bandwidth() { return mBandwidth; } bool CanBeMetered() { return mCanBeMetered; } - void DoCallback(const nsAString& data); protected: int mAction; @@ -616,8 +613,6 @@ protected: static jfieldID jBandwidthField; static jfieldID jCanBeMeteredField; - - static jmethodID jDoCallbackMethod; public: enum {