widget/android/GeneratedJNIWrappers.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 // GENERATED CODE
michael@0 2 // Generated by the Java program at /build/annotationProcessors at compile time from
michael@0 3 // annotations on Java methods. To update, change the annotations on the corresponding Java
michael@0 4 // methods and rerun the build. Manually updating this file will cause your build to fail.
michael@0 5
michael@0 6 #include "GeneratedJNIWrappers.h"
michael@0 7 #include "AndroidBridgeUtilities.h"
michael@0 8 #include "nsXPCOMStrings.h"
michael@0 9 #include "AndroidBridge.h"
michael@0 10
michael@0 11 namespace mozilla {
michael@0 12 namespace widget {
michael@0 13 namespace android {
michael@0 14 jclass GeckoAppShell::mGeckoAppShellClass = 0;
michael@0 15 jmethodID GeckoAppShell::jAcknowledgeEvent = 0;
michael@0 16 jmethodID GeckoAppShell::jAddPluginViewWrapper = 0;
michael@0 17 jmethodID GeckoAppShell::jAlertsProgressListener_OnProgress = 0;
michael@0 18 jmethodID GeckoAppShell::jCancelVibrate = 0;
michael@0 19 jmethodID GeckoAppShell::jCheckURIVisited = 0;
michael@0 20 jmethodID GeckoAppShell::jClearMessageList = 0;
michael@0 21 jmethodID GeckoAppShell::jCloseCamera = 0;
michael@0 22 jmethodID GeckoAppShell::jCloseNotification = 0;
michael@0 23 jmethodID GeckoAppShell::jCreateMessageListWrapper = 0;
michael@0 24 jmethodID GeckoAppShell::jCreateShortcut = 0;
michael@0 25 jmethodID GeckoAppShell::jDeleteMessageWrapper = 0;
michael@0 26 jmethodID GeckoAppShell::jDisableBatteryNotifications = 0;
michael@0 27 jmethodID GeckoAppShell::jDisableNetworkNotifications = 0;
michael@0 28 jmethodID GeckoAppShell::jDisableScreenOrientationNotifications = 0;
michael@0 29 jmethodID GeckoAppShell::jDisableSensor = 0;
michael@0 30 jmethodID GeckoAppShell::jEnableBatteryNotifications = 0;
michael@0 31 jmethodID GeckoAppShell::jEnableLocation = 0;
michael@0 32 jmethodID GeckoAppShell::jEnableLocationHighAccuracy = 0;
michael@0 33 jmethodID GeckoAppShell::jEnableNetworkNotifications = 0;
michael@0 34 jmethodID GeckoAppShell::jEnableScreenOrientationNotifications = 0;
michael@0 35 jmethodID GeckoAppShell::jEnableSensor = 0;
michael@0 36 jmethodID GeckoAppShell::jGetContext = 0;
michael@0 37 jmethodID GeckoAppShell::jGetCurrentBatteryInformationWrapper = 0;
michael@0 38 jmethodID GeckoAppShell::jGetCurrentNetworkInformationWrapper = 0;
michael@0 39 jmethodID GeckoAppShell::jGetDensity = 0;
michael@0 40 jmethodID GeckoAppShell::jGetDpiWrapper = 0;
michael@0 41 jmethodID GeckoAppShell::jGetExtensionFromMimeTypeWrapper = 0;
michael@0 42 jmethodID GeckoAppShell::jGetHandlersForMimeTypeWrapper = 0;
michael@0 43 jmethodID GeckoAppShell::jGetHandlersForURLWrapper = 0;
michael@0 44 jmethodID GeckoAppShell::jGetIconForExtensionWrapper = 0;
michael@0 45 jmethodID GeckoAppShell::jGetMessageWrapper = 0;
michael@0 46 jmethodID GeckoAppShell::jGetMimeTypeFromExtensionsWrapper = 0;
michael@0 47 jmethodID GeckoAppShell::jGetNextMessageInListWrapper = 0;
michael@0 48 jmethodID GeckoAppShell::jGetProxyForURIWrapper = 0;
michael@0 49 jmethodID GeckoAppShell::jGetScreenDepthWrapper = 0;
michael@0 50 jmethodID GeckoAppShell::jGetScreenOrientationWrapper = 0;
michael@0 51 jmethodID GeckoAppShell::jGetShowPasswordSetting = 0;
michael@0 52 jmethodID GeckoAppShell::jGetSystemColoursWrapper = 0;
michael@0 53 jmethodID GeckoAppShell::jHandleGeckoMessageWrapper = 0;
michael@0 54 jmethodID GeckoAppShell::jHandleUncaughtException = 0;
michael@0 55 jmethodID GeckoAppShell::jHideProgressDialog = 0;
michael@0 56 jmethodID GeckoAppShell::jInitCameraWrapper = 0;
michael@0 57 jmethodID GeckoAppShell::jIsNetworkLinkKnown = 0;
michael@0 58 jmethodID GeckoAppShell::jIsNetworkLinkUp = 0;
michael@0 59 jmethodID GeckoAppShell::jIsTablet = 0;
michael@0 60 jmethodID GeckoAppShell::jKillAnyZombies = 0;
michael@0 61 jmethodID GeckoAppShell::jLoadPluginClass = 0;
michael@0 62 jmethodID GeckoAppShell::jLockScreenOrientation = 0;
michael@0 63 jmethodID GeckoAppShell::jMarkURIVisited = 0;
michael@0 64 jmethodID GeckoAppShell::jMoveTaskToBack = 0;
michael@0 65 jmethodID GeckoAppShell::jNetworkLinkType = 0;
michael@0 66 jmethodID GeckoAppShell::jNotifyDefaultPrevented = 0;
michael@0 67 jmethodID GeckoAppShell::jNotifyIME = 0;
michael@0 68 jmethodID GeckoAppShell::jNotifyIMEChange = 0;
michael@0 69 jmethodID GeckoAppShell::jNotifyIMEContext = 0;
michael@0 70 jmethodID GeckoAppShell::jNotifyWakeLockChanged = 0;
michael@0 71 jmethodID GeckoAppShell::jNotifyXreExit = 0;
michael@0 72 jmethodID GeckoAppShell::jOpenUriExternal = 0;
michael@0 73 jmethodID GeckoAppShell::jPerformHapticFeedback = 0;
michael@0 74 jmethodID GeckoAppShell::jPumpMessageLoop = 0;
michael@0 75 jmethodID GeckoAppShell::jRegisterSurfaceTextureFrameListener = 0;
michael@0 76 jmethodID GeckoAppShell::jRemovePluginView = 0;
michael@0 77 jmethodID GeckoAppShell::jScanMedia = 0;
michael@0 78 jmethodID GeckoAppShell::jScheduleRestart = 0;
michael@0 79 jmethodID GeckoAppShell::jSendMessageWrapper = 0;
michael@0 80 jmethodID GeckoAppShell::jSetFullScreen = 0;
michael@0 81 jmethodID GeckoAppShell::jSetKeepScreenOn = 0;
michael@0 82 jmethodID GeckoAppShell::jSetURITitle = 0;
michael@0 83 jmethodID GeckoAppShell::jShowAlertNotificationWrapper = 0;
michael@0 84 jmethodID GeckoAppShell::jShowInputMethodPicker = 0;
michael@0 85 jmethodID GeckoAppShell::jUnlockProfile = 0;
michael@0 86 jmethodID GeckoAppShell::jUnlockScreenOrientation = 0;
michael@0 87 jmethodID GeckoAppShell::jUnregisterSurfaceTextureFrameListener = 0;
michael@0 88 jmethodID GeckoAppShell::jVibrate1 = 0;
michael@0 89 jmethodID GeckoAppShell::jVibrateA = 0;
michael@0 90 void GeckoAppShell::InitStubs(JNIEnv *jEnv) {
michael@0 91 initInit();
michael@0 92
michael@0 93 mGeckoAppShellClass = getClassGlobalRef("org/mozilla/gecko/GeckoAppShell");
michael@0 94 jAcknowledgeEvent = getStaticMethod("acknowledgeEvent", "()V");
michael@0 95 jAddPluginViewWrapper = getStaticMethod("addPluginView", "(Landroid/view/View;FFFFZ)V");
michael@0 96 jAlertsProgressListener_OnProgress = getStaticMethod("alertsProgressListener_OnProgress", "(Ljava/lang/String;JJLjava/lang/String;)V");
michael@0 97 jCancelVibrate = getStaticMethod("cancelVibrate", "()V");
michael@0 98 jCheckURIVisited = getStaticMethod("checkUriVisited", "(Ljava/lang/String;)V");
michael@0 99 jClearMessageList = getStaticMethod("clearMessageList", "(I)V");
michael@0 100 jCloseCamera = getStaticMethod("closeCamera", "()V");
michael@0 101 jCloseNotification = getStaticMethod("closeNotification", "(Ljava/lang/String;)V");
michael@0 102 jCreateMessageListWrapper = getStaticMethod("createMessageList", "(JJ[Ljava/lang/String;IIZI)V");
michael@0 103 jCreateShortcut = getStaticMethod("createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
michael@0 104 jDeleteMessageWrapper = getStaticMethod("deleteMessage", "(II)V");
michael@0 105 jDisableBatteryNotifications = getStaticMethod("disableBatteryNotifications", "()V");
michael@0 106 jDisableNetworkNotifications = getStaticMethod("disableNetworkNotifications", "()V");
michael@0 107 jDisableScreenOrientationNotifications = getStaticMethod("disableScreenOrientationNotifications", "()V");
michael@0 108 jDisableSensor = getStaticMethod("disableSensor", "(I)V");
michael@0 109 jEnableBatteryNotifications = getStaticMethod("enableBatteryNotifications", "()V");
michael@0 110 jEnableLocation = getStaticMethod("enableLocation", "(Z)V");
michael@0 111 jEnableLocationHighAccuracy = getStaticMethod("enableLocationHighAccuracy", "(Z)V");
michael@0 112 jEnableNetworkNotifications = getStaticMethod("enableNetworkNotifications", "()V");
michael@0 113 jEnableScreenOrientationNotifications = getStaticMethod("enableScreenOrientationNotifications", "()V");
michael@0 114 jEnableSensor = getStaticMethod("enableSensor", "(I)V");
michael@0 115 jGetContext = getStaticMethod("getContext", "()Landroid/content/Context;");
michael@0 116 jGetCurrentBatteryInformationWrapper = getStaticMethod("getCurrentBatteryInformation", "()[D");
michael@0 117 jGetCurrentNetworkInformationWrapper = getStaticMethod("getCurrentNetworkInformation", "()[D");
michael@0 118 jGetDensity = getStaticMethod("getDensity", "()F");
michael@0 119 jGetDpiWrapper = getStaticMethod("getDpi", "()I");
michael@0 120 jGetExtensionFromMimeTypeWrapper = getStaticMethod("getExtensionFromMimeType", "(Ljava/lang/String;)Ljava/lang/String;");
michael@0 121 jGetHandlersForMimeTypeWrapper = getStaticMethod("getHandlersForMimeType", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
michael@0 122 jGetHandlersForURLWrapper = getStaticMethod("getHandlersForURL", "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;");
michael@0 123 jGetIconForExtensionWrapper = getStaticMethod("getIconForExtension", "(Ljava/lang/String;I)[B");
michael@0 124 jGetMessageWrapper = getStaticMethod("getMessage", "(II)V");
michael@0 125 jGetMimeTypeFromExtensionsWrapper = getStaticMethod("getMimeTypeFromExtensions", "(Ljava/lang/String;)Ljava/lang/String;");
michael@0 126 jGetNextMessageInListWrapper = getStaticMethod("getNextMessageInList", "(II)V");
michael@0 127 jGetProxyForURIWrapper = getStaticMethod("getProxyForURI", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;");
michael@0 128 jGetScreenDepthWrapper = getStaticMethod("getScreenDepth", "()I");
michael@0 129 jGetScreenOrientationWrapper = getStaticMethod("getScreenOrientation", "()S");
michael@0 130 jGetShowPasswordSetting = getStaticMethod("getShowPasswordSetting", "()Z");
michael@0 131 jGetSystemColoursWrapper = getStaticMethod("getSystemColors", "()[I");
michael@0 132 jHandleGeckoMessageWrapper = getStaticMethod("handleGeckoMessage", "(Lorg/mozilla/gecko/util/NativeJSContainer;)V");
michael@0 133 jHandleUncaughtException = getStaticMethod("handleUncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V");
michael@0 134 jHideProgressDialog = getStaticMethod("hideProgressDialog", "()V");
michael@0 135 jInitCameraWrapper = getStaticMethod("initCamera", "(Ljava/lang/String;III)[I");
michael@0 136 jIsNetworkLinkKnown = getStaticMethod("isNetworkLinkKnown", "()Z");
michael@0 137 jIsNetworkLinkUp = getStaticMethod("isNetworkLinkUp", "()Z");
michael@0 138 jIsTablet = getStaticMethod("isTablet", "()Z");
michael@0 139 jKillAnyZombies = getStaticMethod("killAnyZombies", "()V");
michael@0 140 jLoadPluginClass = getStaticMethod("loadPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;");
michael@0 141 jLockScreenOrientation = getStaticMethod("lockScreenOrientation", "(I)V");
michael@0 142 jMarkURIVisited = getStaticMethod("markUriVisited", "(Ljava/lang/String;)V");
michael@0 143 jMoveTaskToBack = getStaticMethod("moveTaskToBack", "()V");
michael@0 144 jNetworkLinkType = getStaticMethod("networkLinkType", "()I");
michael@0 145 jNotifyDefaultPrevented = getStaticMethod("notifyDefaultPrevented", "(Z)V");
michael@0 146 jNotifyIME = getStaticMethod("notifyIME", "(I)V");
michael@0 147 jNotifyIMEChange = getStaticMethod("notifyIMEChange", "(Ljava/lang/String;III)V");
michael@0 148 jNotifyIMEContext = getStaticMethod("notifyIMEContext", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
michael@0 149 jNotifyWakeLockChanged = getStaticMethod("notifyWakeLockChanged", "(Ljava/lang/String;Ljava/lang/String;)V");
michael@0 150 jNotifyXreExit = getStaticMethod("onXreExit", "()V");
michael@0 151 jOpenUriExternal = getStaticMethod("openUriExternal", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z");
michael@0 152 jPerformHapticFeedback = getStaticMethod("performHapticFeedback", "(Z)V");
michael@0 153 jPumpMessageLoop = getStaticMethod("pumpMessageLoop", "()Z");
michael@0 154 jRegisterSurfaceTextureFrameListener = getStaticMethod("registerSurfaceTextureFrameListener", "(Ljava/lang/Object;I)V");
michael@0 155 jRemovePluginView = getStaticMethod("removePluginView", "(Landroid/view/View;Z)V");
michael@0 156 jScanMedia = getStaticMethod("scanMedia", "(Ljava/lang/String;Ljava/lang/String;)V");
michael@0 157 jScheduleRestart = getStaticMethod("scheduleRestart", "()V");
michael@0 158 jSendMessageWrapper = getStaticMethod("sendMessage", "(Ljava/lang/String;Ljava/lang/String;I)V");
michael@0 159 jSetFullScreen = getStaticMethod("setFullScreen", "(Z)V");
michael@0 160 jSetKeepScreenOn = getStaticMethod("setKeepScreenOn", "(Z)V");
michael@0 161 jSetURITitle = getStaticMethod("setUriTitle", "(Ljava/lang/String;Ljava/lang/String;)V");
michael@0 162 jShowAlertNotificationWrapper = getStaticMethod("showAlertNotification", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
michael@0 163 jShowInputMethodPicker = getStaticMethod("showInputMethodPicker", "()V");
michael@0 164 jUnlockProfile = getStaticMethod("unlockProfile", "()Z");
michael@0 165 jUnlockScreenOrientation = getStaticMethod("unlockScreenOrientation", "()V");
michael@0 166 jUnregisterSurfaceTextureFrameListener = getStaticMethod("unregisterSurfaceTextureFrameListener", "(Ljava/lang/Object;)V");
michael@0 167 jVibrate1 = getStaticMethod("vibrate", "(J)V");
michael@0 168 jVibrateA = getStaticMethod("vibrate", "([JI)V");
michael@0 169 }
michael@0 170
michael@0 171 GeckoAppShell* GeckoAppShell::Wrap(jobject obj) {
michael@0 172 JNIEnv *env = GetJNIForThread();
michael@0 173 GeckoAppShell* ret = new GeckoAppShell(obj, env);
michael@0 174 env->DeleteLocalRef(obj);
michael@0 175 return ret;
michael@0 176 }
michael@0 177
michael@0 178 void GeckoAppShell::AcknowledgeEvent() {
michael@0 179 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 180 if (env->PushLocalFrame(0) != 0) {
michael@0 181 AndroidBridge::HandleUncaughtException(env);
michael@0 182 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 183 }
michael@0 184
michael@0 185 env->CallStaticVoidMethod(mGeckoAppShellClass, jAcknowledgeEvent);
michael@0 186 AndroidBridge::HandleUncaughtException(env);
michael@0 187 env->PopLocalFrame(nullptr);
michael@0 188 }
michael@0 189
michael@0 190 void GeckoAppShell::AddPluginViewWrapper(jobject a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, bool a5) {
michael@0 191 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 192 if (env->PushLocalFrame(1) != 0) {
michael@0 193 AndroidBridge::HandleUncaughtException(env);
michael@0 194 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 195 }
michael@0 196
michael@0 197 jvalue args[6];
michael@0 198 args[0].l = a0;
michael@0 199 args[1].f = a1;
michael@0 200 args[2].f = a2;
michael@0 201 args[3].f = a3;
michael@0 202 args[4].f = a4;
michael@0 203 args[5].z = a5;
michael@0 204
michael@0 205 env->CallStaticVoidMethodA(mGeckoAppShellClass, jAddPluginViewWrapper, args);
michael@0 206 AndroidBridge::HandleUncaughtException(env);
michael@0 207 env->PopLocalFrame(nullptr);
michael@0 208 }
michael@0 209
michael@0 210 void GeckoAppShell::AlertsProgressListener_OnProgress(const nsAString& a0, int64_t a1, int64_t a2, const nsAString& a3) {
michael@0 211 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 212 if (env->PushLocalFrame(2) != 0) {
michael@0 213 AndroidBridge::HandleUncaughtException(env);
michael@0 214 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 215 }
michael@0 216
michael@0 217 jvalue args[4];
michael@0 218 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 219 args[1].j = a1;
michael@0 220 args[2].j = a2;
michael@0 221 args[3].l = AndroidBridge::NewJavaString(env, a3);
michael@0 222
michael@0 223 env->CallStaticVoidMethodA(mGeckoAppShellClass, jAlertsProgressListener_OnProgress, args);
michael@0 224 AndroidBridge::HandleUncaughtException(env);
michael@0 225 env->PopLocalFrame(nullptr);
michael@0 226 }
michael@0 227
michael@0 228 void GeckoAppShell::CancelVibrate() {
michael@0 229 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 230 if (env->PushLocalFrame(0) != 0) {
michael@0 231 AndroidBridge::HandleUncaughtException(env);
michael@0 232 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 233 }
michael@0 234
michael@0 235 env->CallStaticVoidMethod(mGeckoAppShellClass, jCancelVibrate);
michael@0 236 AndroidBridge::HandleUncaughtException(env);
michael@0 237 env->PopLocalFrame(nullptr);
michael@0 238 }
michael@0 239
michael@0 240 void GeckoAppShell::CheckURIVisited(const nsAString& a0) {
michael@0 241 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 242 if (env->PushLocalFrame(1) != 0) {
michael@0 243 AndroidBridge::HandleUncaughtException(env);
michael@0 244 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 245 }
michael@0 246
michael@0 247 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 248
michael@0 249 env->CallStaticVoidMethod(mGeckoAppShellClass, jCheckURIVisited, j0);
michael@0 250 AndroidBridge::HandleUncaughtException(env);
michael@0 251 env->PopLocalFrame(nullptr);
michael@0 252 }
michael@0 253
michael@0 254 void GeckoAppShell::ClearMessageList(int32_t a0) {
michael@0 255 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 256 if (env->PushLocalFrame(0) != 0) {
michael@0 257 AndroidBridge::HandleUncaughtException(env);
michael@0 258 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 259 }
michael@0 260
michael@0 261 env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, a0);
michael@0 262 AndroidBridge::HandleUncaughtException(env);
michael@0 263 env->PopLocalFrame(nullptr);
michael@0 264 }
michael@0 265
michael@0 266 void GeckoAppShell::CloseCamera() {
michael@0 267 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 268 if (env->PushLocalFrame(0) != 0) {
michael@0 269 AndroidBridge::HandleUncaughtException(env);
michael@0 270 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 271 }
michael@0 272
michael@0 273 env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseCamera);
michael@0 274 AndroidBridge::HandleUncaughtException(env);
michael@0 275 env->PopLocalFrame(nullptr);
michael@0 276 }
michael@0 277
michael@0 278 void GeckoAppShell::CloseNotification(const nsAString& a0) {
michael@0 279 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 280 if (env->PushLocalFrame(1) != 0) {
michael@0 281 AndroidBridge::HandleUncaughtException(env);
michael@0 282 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 283 }
michael@0 284
michael@0 285 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 286
michael@0 287 env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseNotification, j0);
michael@0 288 AndroidBridge::HandleUncaughtException(env);
michael@0 289 env->PopLocalFrame(nullptr);
michael@0 290 }
michael@0 291
michael@0 292 void GeckoAppShell::CreateMessageListWrapper(int64_t a0, int64_t a1, jobjectArray a2, int32_t a3, int32_t a4, bool a5, int32_t a6) {
michael@0 293 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 294 if (env->PushLocalFrame(1) != 0) {
michael@0 295 AndroidBridge::HandleUncaughtException(env);
michael@0 296 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 297 }
michael@0 298
michael@0 299 jvalue args[7];
michael@0 300 args[0].j = a0;
michael@0 301 args[1].j = a1;
michael@0 302 args[2].l = a2;
michael@0 303 args[3].i = a3;
michael@0 304 args[4].i = a4;
michael@0 305 args[5].z = a5;
michael@0 306 args[6].i = a6;
michael@0 307
michael@0 308 env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateMessageListWrapper, args);
michael@0 309 AndroidBridge::HandleUncaughtException(env);
michael@0 310 env->PopLocalFrame(nullptr);
michael@0 311 }
michael@0 312
michael@0 313 void GeckoAppShell::CreateShortcut(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) {
michael@0 314 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 315 if (env->PushLocalFrame(4) != 0) {
michael@0 316 AndroidBridge::HandleUncaughtException(env);
michael@0 317 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 318 }
michael@0 319
michael@0 320 jvalue args[4];
michael@0 321 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 322 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 323 args[2].l = AndroidBridge::NewJavaString(env, a2);
michael@0 324 args[3].l = AndroidBridge::NewJavaString(env, a3);
michael@0 325
michael@0 326 env->CallStaticVoidMethodA(mGeckoAppShellClass, jCreateShortcut, args);
michael@0 327 AndroidBridge::HandleUncaughtException(env);
michael@0 328 env->PopLocalFrame(nullptr);
michael@0 329 }
michael@0 330
michael@0 331 void GeckoAppShell::DeleteMessageWrapper(int32_t a0, int32_t a1) {
michael@0 332 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 333 if (env->PushLocalFrame(0) != 0) {
michael@0 334 AndroidBridge::HandleUncaughtException(env);
michael@0 335 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 336 }
michael@0 337
michael@0 338 env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessageWrapper, a0, a1);
michael@0 339 AndroidBridge::HandleUncaughtException(env);
michael@0 340 env->PopLocalFrame(nullptr);
michael@0 341 }
michael@0 342
michael@0 343 void GeckoAppShell::DisableBatteryNotifications() {
michael@0 344 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 345 if (env->PushLocalFrame(0) != 0) {
michael@0 346 AndroidBridge::HandleUncaughtException(env);
michael@0 347 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 348 }
michael@0 349
michael@0 350 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableBatteryNotifications);
michael@0 351 AndroidBridge::HandleUncaughtException(env);
michael@0 352 env->PopLocalFrame(nullptr);
michael@0 353 }
michael@0 354
michael@0 355 void GeckoAppShell::DisableNetworkNotifications() {
michael@0 356 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 357 if (env->PushLocalFrame(0) != 0) {
michael@0 358 AndroidBridge::HandleUncaughtException(env);
michael@0 359 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 360 }
michael@0 361
michael@0 362 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableNetworkNotifications);
michael@0 363 AndroidBridge::HandleUncaughtException(env);
michael@0 364 env->PopLocalFrame(nullptr);
michael@0 365 }
michael@0 366
michael@0 367 void GeckoAppShell::DisableScreenOrientationNotifications() {
michael@0 368 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 369 if (env->PushLocalFrame(0) != 0) {
michael@0 370 AndroidBridge::HandleUncaughtException(env);
michael@0 371 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 372 }
michael@0 373
michael@0 374 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableScreenOrientationNotifications);
michael@0 375 AndroidBridge::HandleUncaughtException(env);
michael@0 376 env->PopLocalFrame(nullptr);
michael@0 377 }
michael@0 378
michael@0 379 void GeckoAppShell::DisableSensor(int32_t a0) {
michael@0 380 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 381 if (env->PushLocalFrame(0) != 0) {
michael@0 382 AndroidBridge::HandleUncaughtException(env);
michael@0 383 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 384 }
michael@0 385
michael@0 386 env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableSensor, a0);
michael@0 387 AndroidBridge::HandleUncaughtException(env);
michael@0 388 env->PopLocalFrame(nullptr);
michael@0 389 }
michael@0 390
michael@0 391 void GeckoAppShell::EnableBatteryNotifications() {
michael@0 392 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 393 if (env->PushLocalFrame(0) != 0) {
michael@0 394 AndroidBridge::HandleUncaughtException(env);
michael@0 395 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 396 }
michael@0 397
michael@0 398 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableBatteryNotifications);
michael@0 399 AndroidBridge::HandleUncaughtException(env);
michael@0 400 env->PopLocalFrame(nullptr);
michael@0 401 }
michael@0 402
michael@0 403 void GeckoAppShell::EnableLocation(bool a0) {
michael@0 404 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 405 if (env->PushLocalFrame(0) != 0) {
michael@0 406 AndroidBridge::HandleUncaughtException(env);
michael@0 407 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 408 }
michael@0 409
michael@0 410 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocation, a0);
michael@0 411 AndroidBridge::HandleUncaughtException(env);
michael@0 412 env->PopLocalFrame(nullptr);
michael@0 413 }
michael@0 414
michael@0 415 void GeckoAppShell::EnableLocationHighAccuracy(bool a0) {
michael@0 416 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 417 if (env->PushLocalFrame(0) != 0) {
michael@0 418 AndroidBridge::HandleUncaughtException(env);
michael@0 419 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 420 }
michael@0 421
michael@0 422 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocationHighAccuracy, a0);
michael@0 423 AndroidBridge::HandleUncaughtException(env);
michael@0 424 env->PopLocalFrame(nullptr);
michael@0 425 }
michael@0 426
michael@0 427 void GeckoAppShell::EnableNetworkNotifications() {
michael@0 428 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 429 if (env->PushLocalFrame(0) != 0) {
michael@0 430 AndroidBridge::HandleUncaughtException(env);
michael@0 431 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 432 }
michael@0 433
michael@0 434 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableNetworkNotifications);
michael@0 435 AndroidBridge::HandleUncaughtException(env);
michael@0 436 env->PopLocalFrame(nullptr);
michael@0 437 }
michael@0 438
michael@0 439 void GeckoAppShell::EnableScreenOrientationNotifications() {
michael@0 440 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 441 if (env->PushLocalFrame(0) != 0) {
michael@0 442 AndroidBridge::HandleUncaughtException(env);
michael@0 443 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 444 }
michael@0 445
michael@0 446 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableScreenOrientationNotifications);
michael@0 447 AndroidBridge::HandleUncaughtException(env);
michael@0 448 env->PopLocalFrame(nullptr);
michael@0 449 }
michael@0 450
michael@0 451 void GeckoAppShell::EnableSensor(int32_t a0) {
michael@0 452 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 453 if (env->PushLocalFrame(0) != 0) {
michael@0 454 AndroidBridge::HandleUncaughtException(env);
michael@0 455 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 456 }
michael@0 457
michael@0 458 env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableSensor, a0);
michael@0 459 AndroidBridge::HandleUncaughtException(env);
michael@0 460 env->PopLocalFrame(nullptr);
michael@0 461 }
michael@0 462
michael@0 463 jobject GeckoAppShell::GetContext() {
michael@0 464 JNIEnv *env = GetJNIForThread();
michael@0 465 if (env->PushLocalFrame(1) != 0) {
michael@0 466 AndroidBridge::HandleUncaughtException(env);
michael@0 467 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 468 }
michael@0 469
michael@0 470 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetContext);
michael@0 471 AndroidBridge::HandleUncaughtException(env);
michael@0 472 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 473 return ret;
michael@0 474 }
michael@0 475
michael@0 476 jdoubleArray GeckoAppShell::GetCurrentBatteryInformationWrapper() {
michael@0 477 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 478 if (env->PushLocalFrame(1) != 0) {
michael@0 479 AndroidBridge::HandleUncaughtException(env);
michael@0 480 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 481 }
michael@0 482
michael@0 483 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentBatteryInformationWrapper);
michael@0 484 AndroidBridge::HandleUncaughtException(env);
michael@0 485 jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
michael@0 486 return ret;
michael@0 487 }
michael@0 488
michael@0 489 jdoubleArray GeckoAppShell::GetCurrentNetworkInformationWrapper() {
michael@0 490 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 491 if (env->PushLocalFrame(1) != 0) {
michael@0 492 AndroidBridge::HandleUncaughtException(env);
michael@0 493 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 494 }
michael@0 495
michael@0 496 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentNetworkInformationWrapper);
michael@0 497 AndroidBridge::HandleUncaughtException(env);
michael@0 498 jdoubleArray ret = static_cast<jdoubleArray>(env->PopLocalFrame(temp));
michael@0 499 return ret;
michael@0 500 }
michael@0 501
michael@0 502 jfloat GeckoAppShell::GetDensity() {
michael@0 503 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 504 if (env->PushLocalFrame(0) != 0) {
michael@0 505 AndroidBridge::HandleUncaughtException(env);
michael@0 506 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 507 }
michael@0 508
michael@0 509 jfloat temp = env->CallStaticFloatMethod(mGeckoAppShellClass, jGetDensity);
michael@0 510 AndroidBridge::HandleUncaughtException(env);
michael@0 511 env->PopLocalFrame(nullptr);
michael@0 512 return temp;
michael@0 513 }
michael@0 514
michael@0 515 int32_t GeckoAppShell::GetDpiWrapper() {
michael@0 516 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 517 if (env->PushLocalFrame(0) != 0) {
michael@0 518 AndroidBridge::HandleUncaughtException(env);
michael@0 519 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 520 }
michael@0 521
michael@0 522 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetDpiWrapper);
michael@0 523 AndroidBridge::HandleUncaughtException(env);
michael@0 524 env->PopLocalFrame(nullptr);
michael@0 525 return temp;
michael@0 526 }
michael@0 527
michael@0 528 jstring GeckoAppShell::GetExtensionFromMimeTypeWrapper(const nsAString& a0) {
michael@0 529 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 530 if (env->PushLocalFrame(2) != 0) {
michael@0 531 AndroidBridge::HandleUncaughtException(env);
michael@0 532 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 533 }
michael@0 534
michael@0 535 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 536
michael@0 537 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetExtensionFromMimeTypeWrapper, j0);
michael@0 538 AndroidBridge::HandleUncaughtException(env);
michael@0 539 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 540 return ret;
michael@0 541 }
michael@0 542
michael@0 543 jobjectArray GeckoAppShell::GetHandlersForMimeTypeWrapper(const nsAString& a0, const nsAString& a1) {
michael@0 544 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 545 if (env->PushLocalFrame(3) != 0) {
michael@0 546 AndroidBridge::HandleUncaughtException(env);
michael@0 547 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 548 }
michael@0 549
michael@0 550 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 551 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 552
michael@0 553 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForMimeTypeWrapper, j0, j1);
michael@0 554 AndroidBridge::HandleUncaughtException(env);
michael@0 555 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
michael@0 556 return ret;
michael@0 557 }
michael@0 558
michael@0 559 jobjectArray GeckoAppShell::GetHandlersForURLWrapper(const nsAString& a0, const nsAString& a1) {
michael@0 560 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 561 if (env->PushLocalFrame(3) != 0) {
michael@0 562 AndroidBridge::HandleUncaughtException(env);
michael@0 563 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 564 }
michael@0 565
michael@0 566 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 567 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 568
michael@0 569 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetHandlersForURLWrapper, j0, j1);
michael@0 570 AndroidBridge::HandleUncaughtException(env);
michael@0 571 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
michael@0 572 return ret;
michael@0 573 }
michael@0 574
michael@0 575 jbyteArray GeckoAppShell::GetIconForExtensionWrapper(const nsAString& a0, int32_t a1) {
michael@0 576 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 577 if (env->PushLocalFrame(2) != 0) {
michael@0 578 AndroidBridge::HandleUncaughtException(env);
michael@0 579 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 580 }
michael@0 581
michael@0 582 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 583
michael@0 584 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetIconForExtensionWrapper, j0, a1);
michael@0 585 AndroidBridge::HandleUncaughtException(env);
michael@0 586 jbyteArray ret = static_cast<jbyteArray>(env->PopLocalFrame(temp));
michael@0 587 return ret;
michael@0 588 }
michael@0 589
michael@0 590 void GeckoAppShell::GetMessageWrapper(int32_t a0, int32_t a1) {
michael@0 591 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 592 if (env->PushLocalFrame(0) != 0) {
michael@0 593 AndroidBridge::HandleUncaughtException(env);
michael@0 594 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 595 }
michael@0 596
michael@0 597 env->CallStaticVoidMethod(mGeckoAppShellClass, jGetMessageWrapper, a0, a1);
michael@0 598 AndroidBridge::HandleUncaughtException(env);
michael@0 599 env->PopLocalFrame(nullptr);
michael@0 600 }
michael@0 601
michael@0 602 jstring GeckoAppShell::GetMimeTypeFromExtensionsWrapper(const nsAString& a0) {
michael@0 603 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 604 if (env->PushLocalFrame(2) != 0) {
michael@0 605 AndroidBridge::HandleUncaughtException(env);
michael@0 606 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 607 }
michael@0 608
michael@0 609 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 610
michael@0 611 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetMimeTypeFromExtensionsWrapper, j0);
michael@0 612 AndroidBridge::HandleUncaughtException(env);
michael@0 613 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 614 return ret;
michael@0 615 }
michael@0 616
michael@0 617 void GeckoAppShell::GetNextMessageInListWrapper(int32_t a0, int32_t a1) {
michael@0 618 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 619 if (env->PushLocalFrame(0) != 0) {
michael@0 620 AndroidBridge::HandleUncaughtException(env);
michael@0 621 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 622 }
michael@0 623
michael@0 624 env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageInListWrapper, a0, a1);
michael@0 625 AndroidBridge::HandleUncaughtException(env);
michael@0 626 env->PopLocalFrame(nullptr);
michael@0 627 }
michael@0 628
michael@0 629 jstring GeckoAppShell::GetProxyForURIWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, int32_t a3) {
michael@0 630 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 631 if (env->PushLocalFrame(4) != 0) {
michael@0 632 AndroidBridge::HandleUncaughtException(env);
michael@0 633 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 634 }
michael@0 635
michael@0 636 jvalue args[4];
michael@0 637 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 638 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 639 args[2].l = AndroidBridge::NewJavaString(env, a2);
michael@0 640 args[3].i = a3;
michael@0 641
michael@0 642 jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jGetProxyForURIWrapper, args);
michael@0 643 AndroidBridge::HandleUncaughtException(env);
michael@0 644 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 645 return ret;
michael@0 646 }
michael@0 647
michael@0 648 int32_t GeckoAppShell::GetScreenDepthWrapper() {
michael@0 649 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 650 if (env->PushLocalFrame(0) != 0) {
michael@0 651 AndroidBridge::HandleUncaughtException(env);
michael@0 652 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 653 }
michael@0 654
michael@0 655 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetScreenDepthWrapper);
michael@0 656 AndroidBridge::HandleUncaughtException(env);
michael@0 657 env->PopLocalFrame(nullptr);
michael@0 658 return temp;
michael@0 659 }
michael@0 660
michael@0 661 int16_t GeckoAppShell::GetScreenOrientationWrapper() {
michael@0 662 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 663 if (env->PushLocalFrame(0) != 0) {
michael@0 664 AndroidBridge::HandleUncaughtException(env);
michael@0 665 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 666 }
michael@0 667
michael@0 668 int16_t temp = env->CallStaticShortMethod(mGeckoAppShellClass, jGetScreenOrientationWrapper);
michael@0 669 AndroidBridge::HandleUncaughtException(env);
michael@0 670 env->PopLocalFrame(nullptr);
michael@0 671 return temp;
michael@0 672 }
michael@0 673
michael@0 674 bool GeckoAppShell::GetShowPasswordSetting() {
michael@0 675 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 676 if (env->PushLocalFrame(0) != 0) {
michael@0 677 AndroidBridge::HandleUncaughtException(env);
michael@0 678 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 679 }
michael@0 680
michael@0 681 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting);
michael@0 682 AndroidBridge::HandleUncaughtException(env);
michael@0 683 env->PopLocalFrame(nullptr);
michael@0 684 return temp;
michael@0 685 }
michael@0 686
michael@0 687 jintArray GeckoAppShell::GetSystemColoursWrapper() {
michael@0 688 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 689 if (env->PushLocalFrame(1) != 0) {
michael@0 690 AndroidBridge::HandleUncaughtException(env);
michael@0 691 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 692 }
michael@0 693
michael@0 694 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetSystemColoursWrapper);
michael@0 695 AndroidBridge::HandleUncaughtException(env);
michael@0 696 jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
michael@0 697 return ret;
michael@0 698 }
michael@0 699
michael@0 700 void GeckoAppShell::HandleGeckoMessageWrapper(jobject a0) {
michael@0 701 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 702 if (env->PushLocalFrame(1) != 0) {
michael@0 703 AndroidBridge::HandleUncaughtException(env);
michael@0 704 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 705 }
michael@0 706
michael@0 707 env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, a0);
michael@0 708 AndroidBridge::HandleUncaughtException(env);
michael@0 709 env->PopLocalFrame(nullptr);
michael@0 710 }
michael@0 711
michael@0 712 void GeckoAppShell::HandleUncaughtException(jobject a0, jthrowable a1) {
michael@0 713 JNIEnv *env = GetJNIForThread();
michael@0 714 if (env->PushLocalFrame(2) != 0) {
michael@0 715 return;
michael@0 716 }
michael@0 717
michael@0 718 env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleUncaughtException, a0, a1);
michael@0 719 env->PopLocalFrame(nullptr);
michael@0 720 }
michael@0 721
michael@0 722 void GeckoAppShell::HideProgressDialog() {
michael@0 723 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 724 if (env->PushLocalFrame(0) != 0) {
michael@0 725 AndroidBridge::HandleUncaughtException(env);
michael@0 726 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 727 }
michael@0 728
michael@0 729 env->CallStaticVoidMethod(mGeckoAppShellClass, jHideProgressDialog);
michael@0 730 AndroidBridge::HandleUncaughtException(env);
michael@0 731 env->PopLocalFrame(nullptr);
michael@0 732 }
michael@0 733
michael@0 734 jintArray GeckoAppShell::InitCameraWrapper(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
michael@0 735 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 736 if (env->PushLocalFrame(2) != 0) {
michael@0 737 AndroidBridge::HandleUncaughtException(env);
michael@0 738 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 739 }
michael@0 740
michael@0 741 jvalue args[4];
michael@0 742 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 743 args[1].i = a1;
michael@0 744 args[2].i = a2;
michael@0 745 args[3].i = a3;
michael@0 746
michael@0 747 jobject temp = env->CallStaticObjectMethodA(mGeckoAppShellClass, jInitCameraWrapper, args);
michael@0 748 AndroidBridge::HandleUncaughtException(env);
michael@0 749 jintArray ret = static_cast<jintArray>(env->PopLocalFrame(temp));
michael@0 750 return ret;
michael@0 751 }
michael@0 752
michael@0 753 bool GeckoAppShell::IsNetworkLinkKnown() {
michael@0 754 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 755 if (env->PushLocalFrame(0) != 0) {
michael@0 756 AndroidBridge::HandleUncaughtException(env);
michael@0 757 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 758 }
michael@0 759
michael@0 760 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkKnown);
michael@0 761 AndroidBridge::HandleUncaughtException(env);
michael@0 762 env->PopLocalFrame(nullptr);
michael@0 763 return temp;
michael@0 764 }
michael@0 765
michael@0 766 bool GeckoAppShell::IsNetworkLinkUp() {
michael@0 767 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 768 if (env->PushLocalFrame(0) != 0) {
michael@0 769 AndroidBridge::HandleUncaughtException(env);
michael@0 770 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 771 }
michael@0 772
michael@0 773 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkUp);
michael@0 774 AndroidBridge::HandleUncaughtException(env);
michael@0 775 env->PopLocalFrame(nullptr);
michael@0 776 return temp;
michael@0 777 }
michael@0 778
michael@0 779 bool GeckoAppShell::IsTablet() {
michael@0 780 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 781 if (env->PushLocalFrame(0) != 0) {
michael@0 782 AndroidBridge::HandleUncaughtException(env);
michael@0 783 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 784 }
michael@0 785
michael@0 786 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet);
michael@0 787 AndroidBridge::HandleUncaughtException(env);
michael@0 788 env->PopLocalFrame(nullptr);
michael@0 789 return temp;
michael@0 790 }
michael@0 791
michael@0 792 void GeckoAppShell::KillAnyZombies() {
michael@0 793 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 794 if (env->PushLocalFrame(0) != 0) {
michael@0 795 AndroidBridge::HandleUncaughtException(env);
michael@0 796 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 797 }
michael@0 798
michael@0 799 env->CallStaticVoidMethod(mGeckoAppShellClass, jKillAnyZombies);
michael@0 800 AndroidBridge::HandleUncaughtException(env);
michael@0 801 env->PopLocalFrame(nullptr);
michael@0 802 }
michael@0 803
michael@0 804 jclass GeckoAppShell::LoadPluginClass(const nsAString& a0, const nsAString& a1) {
michael@0 805 JNIEnv *env = GetJNIForThread();
michael@0 806 if (env->PushLocalFrame(3) != 0) {
michael@0 807 AndroidBridge::HandleUncaughtException(env);
michael@0 808 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 809 }
michael@0 810
michael@0 811 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 812 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 813
michael@0 814 jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jLoadPluginClass, j0, j1);
michael@0 815 AndroidBridge::HandleUncaughtException(env);
michael@0 816 jclass ret = static_cast<jclass>(env->PopLocalFrame(temp));
michael@0 817 return ret;
michael@0 818 }
michael@0 819
michael@0 820 void GeckoAppShell::LockScreenOrientation(int32_t a0) {
michael@0 821 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 822 if (env->PushLocalFrame(0) != 0) {
michael@0 823 AndroidBridge::HandleUncaughtException(env);
michael@0 824 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 825 }
michael@0 826
michael@0 827 env->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, a0);
michael@0 828 AndroidBridge::HandleUncaughtException(env);
michael@0 829 env->PopLocalFrame(nullptr);
michael@0 830 }
michael@0 831
michael@0 832 void GeckoAppShell::MarkURIVisited(const nsAString& a0) {
michael@0 833 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 834 if (env->PushLocalFrame(1) != 0) {
michael@0 835 AndroidBridge::HandleUncaughtException(env);
michael@0 836 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 837 }
michael@0 838
michael@0 839 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 840
michael@0 841 env->CallStaticVoidMethod(mGeckoAppShellClass, jMarkURIVisited, j0);
michael@0 842 AndroidBridge::HandleUncaughtException(env);
michael@0 843 env->PopLocalFrame(nullptr);
michael@0 844 }
michael@0 845
michael@0 846 void GeckoAppShell::MoveTaskToBack() {
michael@0 847 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 848 if (env->PushLocalFrame(0) != 0) {
michael@0 849 AndroidBridge::HandleUncaughtException(env);
michael@0 850 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 851 }
michael@0 852
michael@0 853 env->CallStaticVoidMethod(mGeckoAppShellClass, jMoveTaskToBack);
michael@0 854 AndroidBridge::HandleUncaughtException(env);
michael@0 855 env->PopLocalFrame(nullptr);
michael@0 856 }
michael@0 857
michael@0 858 int32_t GeckoAppShell::NetworkLinkType() {
michael@0 859 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 860 if (env->PushLocalFrame(0) != 0) {
michael@0 861 AndroidBridge::HandleUncaughtException(env);
michael@0 862 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 863 }
michael@0 864
michael@0 865 int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jNetworkLinkType);
michael@0 866 AndroidBridge::HandleUncaughtException(env);
michael@0 867 env->PopLocalFrame(nullptr);
michael@0 868 return temp;
michael@0 869 }
michael@0 870
michael@0 871 void GeckoAppShell::NotifyDefaultPrevented(bool a0) {
michael@0 872 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 873 if (env->PushLocalFrame(0) != 0) {
michael@0 874 AndroidBridge::HandleUncaughtException(env);
michael@0 875 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 876 }
michael@0 877
michael@0 878 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyDefaultPrevented, a0);
michael@0 879 AndroidBridge::HandleUncaughtException(env);
michael@0 880 env->PopLocalFrame(nullptr);
michael@0 881 }
michael@0 882
michael@0 883 void GeckoAppShell::NotifyIME(int32_t a0) {
michael@0 884 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 885 if (env->PushLocalFrame(0) != 0) {
michael@0 886 AndroidBridge::HandleUncaughtException(env);
michael@0 887 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 888 }
michael@0 889
michael@0 890 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyIME, a0);
michael@0 891 AndroidBridge::HandleUncaughtException(env);
michael@0 892 env->PopLocalFrame(nullptr);
michael@0 893 }
michael@0 894
michael@0 895 void GeckoAppShell::NotifyIMEChange(const nsAString& a0, int32_t a1, int32_t a2, int32_t a3) {
michael@0 896 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 897 if (env->PushLocalFrame(1) != 0) {
michael@0 898 AndroidBridge::HandleUncaughtException(env);
michael@0 899 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 900 }
michael@0 901
michael@0 902 jvalue args[4];
michael@0 903 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 904 args[1].i = a1;
michael@0 905 args[2].i = a2;
michael@0 906 args[3].i = a3;
michael@0 907
michael@0 908 env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEChange, args);
michael@0 909 AndroidBridge::HandleUncaughtException(env);
michael@0 910 env->PopLocalFrame(nullptr);
michael@0 911 }
michael@0 912
michael@0 913 void GeckoAppShell::NotifyIMEContext(int32_t a0, const nsAString& a1, const nsAString& a2, const nsAString& a3) {
michael@0 914 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 915 if (env->PushLocalFrame(3) != 0) {
michael@0 916 AndroidBridge::HandleUncaughtException(env);
michael@0 917 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 918 }
michael@0 919
michael@0 920 jvalue args[4];
michael@0 921 args[0].i = a0;
michael@0 922 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 923 args[2].l = AndroidBridge::NewJavaString(env, a2);
michael@0 924 args[3].l = AndroidBridge::NewJavaString(env, a3);
michael@0 925
michael@0 926 env->CallStaticVoidMethodA(mGeckoAppShellClass, jNotifyIMEContext, args);
michael@0 927 AndroidBridge::HandleUncaughtException(env);
michael@0 928 env->PopLocalFrame(nullptr);
michael@0 929 }
michael@0 930
michael@0 931 void GeckoAppShell::NotifyWakeLockChanged(const nsAString& a0, const nsAString& a1) {
michael@0 932 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 933 if (env->PushLocalFrame(2) != 0) {
michael@0 934 AndroidBridge::HandleUncaughtException(env);
michael@0 935 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 936 }
michael@0 937
michael@0 938 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 939 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 940
michael@0 941 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyWakeLockChanged, j0, j1);
michael@0 942 AndroidBridge::HandleUncaughtException(env);
michael@0 943 env->PopLocalFrame(nullptr);
michael@0 944 }
michael@0 945
michael@0 946 void GeckoAppShell::NotifyXreExit() {
michael@0 947 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 948 if (env->PushLocalFrame(0) != 0) {
michael@0 949 AndroidBridge::HandleUncaughtException(env);
michael@0 950 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 951 }
michael@0 952
michael@0 953 env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyXreExit);
michael@0 954 AndroidBridge::HandleUncaughtException(env);
michael@0 955 env->PopLocalFrame(nullptr);
michael@0 956 }
michael@0 957
michael@0 958 bool GeckoAppShell::OpenUriExternal(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4, const nsAString& a5) {
michael@0 959 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 960 if (env->PushLocalFrame(6) != 0) {
michael@0 961 AndroidBridge::HandleUncaughtException(env);
michael@0 962 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 963 }
michael@0 964
michael@0 965 jvalue args[6];
michael@0 966 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 967 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 968 args[2].l = AndroidBridge::NewJavaString(env, a2);
michael@0 969 args[3].l = AndroidBridge::NewJavaString(env, a3);
michael@0 970 args[4].l = AndroidBridge::NewJavaString(env, a4);
michael@0 971 args[5].l = AndroidBridge::NewJavaString(env, a5);
michael@0 972
michael@0 973 bool temp = env->CallStaticBooleanMethodA(mGeckoAppShellClass, jOpenUriExternal, args);
michael@0 974 AndroidBridge::HandleUncaughtException(env);
michael@0 975 env->PopLocalFrame(nullptr);
michael@0 976 return temp;
michael@0 977 }
michael@0 978
michael@0 979 void GeckoAppShell::PerformHapticFeedback(bool a0) {
michael@0 980 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 981 if (env->PushLocalFrame(0) != 0) {
michael@0 982 AndroidBridge::HandleUncaughtException(env);
michael@0 983 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 984 }
michael@0 985
michael@0 986 env->CallStaticVoidMethod(mGeckoAppShellClass, jPerformHapticFeedback, a0);
michael@0 987 AndroidBridge::HandleUncaughtException(env);
michael@0 988 env->PopLocalFrame(nullptr);
michael@0 989 }
michael@0 990
michael@0 991 bool GeckoAppShell::PumpMessageLoop() {
michael@0 992 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 993 if (env->PushLocalFrame(0) != 0) {
michael@0 994 AndroidBridge::HandleUncaughtException(env);
michael@0 995 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 996 }
michael@0 997
michael@0 998 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jPumpMessageLoop);
michael@0 999 AndroidBridge::HandleUncaughtException(env);
michael@0 1000 env->PopLocalFrame(nullptr);
michael@0 1001 return temp;
michael@0 1002 }
michael@0 1003
michael@0 1004 void GeckoAppShell::RegisterSurfaceTextureFrameListener(jobject a0, int32_t a1) {
michael@0 1005 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1006 if (env->PushLocalFrame(1) != 0) {
michael@0 1007 AndroidBridge::HandleUncaughtException(env);
michael@0 1008 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1009 }
michael@0 1010
michael@0 1011 env->CallStaticVoidMethod(mGeckoAppShellClass, jRegisterSurfaceTextureFrameListener, a0, a1);
michael@0 1012 AndroidBridge::HandleUncaughtException(env);
michael@0 1013 env->PopLocalFrame(nullptr);
michael@0 1014 }
michael@0 1015
michael@0 1016 void GeckoAppShell::RemovePluginView(jobject a0, bool a1) {
michael@0 1017 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1018 if (env->PushLocalFrame(1) != 0) {
michael@0 1019 AndroidBridge::HandleUncaughtException(env);
michael@0 1020 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1021 }
michael@0 1022
michael@0 1023 env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, a0, a1);
michael@0 1024 AndroidBridge::HandleUncaughtException(env);
michael@0 1025 env->PopLocalFrame(nullptr);
michael@0 1026 }
michael@0 1027
michael@0 1028 void GeckoAppShell::ScanMedia(const nsAString& a0, const nsAString& a1) {
michael@0 1029 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1030 if (env->PushLocalFrame(2) != 0) {
michael@0 1031 AndroidBridge::HandleUncaughtException(env);
michael@0 1032 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1033 }
michael@0 1034
michael@0 1035 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 1036 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 1037
michael@0 1038 env->CallStaticVoidMethod(mGeckoAppShellClass, jScanMedia, j0, j1);
michael@0 1039 AndroidBridge::HandleUncaughtException(env);
michael@0 1040 env->PopLocalFrame(nullptr);
michael@0 1041 }
michael@0 1042
michael@0 1043 void GeckoAppShell::ScheduleRestart() {
michael@0 1044 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1045 if (env->PushLocalFrame(0) != 0) {
michael@0 1046 AndroidBridge::HandleUncaughtException(env);
michael@0 1047 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1048 }
michael@0 1049
michael@0 1050 env->CallStaticVoidMethod(mGeckoAppShellClass, jScheduleRestart);
michael@0 1051 AndroidBridge::HandleUncaughtException(env);
michael@0 1052 env->PopLocalFrame(nullptr);
michael@0 1053 }
michael@0 1054
michael@0 1055 void GeckoAppShell::SendMessageWrapper(const nsAString& a0, const nsAString& a1, int32_t a2) {
michael@0 1056 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1057 if (env->PushLocalFrame(2) != 0) {
michael@0 1058 AndroidBridge::HandleUncaughtException(env);
michael@0 1059 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1060 }
michael@0 1061
michael@0 1062 jvalue args[3];
michael@0 1063 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 1064 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 1065 args[2].i = a2;
michael@0 1066
michael@0 1067 env->CallStaticVoidMethodA(mGeckoAppShellClass, jSendMessageWrapper, args);
michael@0 1068 AndroidBridge::HandleUncaughtException(env);
michael@0 1069 env->PopLocalFrame(nullptr);
michael@0 1070 }
michael@0 1071
michael@0 1072 void GeckoAppShell::SetFullScreen(bool a0) {
michael@0 1073 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1074 if (env->PushLocalFrame(0) != 0) {
michael@0 1075 AndroidBridge::HandleUncaughtException(env);
michael@0 1076 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1077 }
michael@0 1078
michael@0 1079 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetFullScreen, a0);
michael@0 1080 AndroidBridge::HandleUncaughtException(env);
michael@0 1081 env->PopLocalFrame(nullptr);
michael@0 1082 }
michael@0 1083
michael@0 1084 void GeckoAppShell::SetKeepScreenOn(bool a0) {
michael@0 1085 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1086 if (env->PushLocalFrame(0) != 0) {
michael@0 1087 AndroidBridge::HandleUncaughtException(env);
michael@0 1088 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1089 }
michael@0 1090
michael@0 1091 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetKeepScreenOn, a0);
michael@0 1092 AndroidBridge::HandleUncaughtException(env);
michael@0 1093 env->PopLocalFrame(nullptr);
michael@0 1094 }
michael@0 1095
michael@0 1096 void GeckoAppShell::SetURITitle(const nsAString& a0, const nsAString& a1) {
michael@0 1097 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1098 if (env->PushLocalFrame(2) != 0) {
michael@0 1099 AndroidBridge::HandleUncaughtException(env);
michael@0 1100 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1101 }
michael@0 1102
michael@0 1103 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 1104 jstring j1 = AndroidBridge::NewJavaString(env, a1);
michael@0 1105
michael@0 1106 env->CallStaticVoidMethod(mGeckoAppShellClass, jSetURITitle, j0, j1);
michael@0 1107 AndroidBridge::HandleUncaughtException(env);
michael@0 1108 env->PopLocalFrame(nullptr);
michael@0 1109 }
michael@0 1110
michael@0 1111 void GeckoAppShell::ShowAlertNotificationWrapper(const nsAString& a0, const nsAString& a1, const nsAString& a2, const nsAString& a3, const nsAString& a4) {
michael@0 1112 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1113 if (env->PushLocalFrame(5) != 0) {
michael@0 1114 AndroidBridge::HandleUncaughtException(env);
michael@0 1115 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1116 }
michael@0 1117
michael@0 1118 jvalue args[5];
michael@0 1119 args[0].l = AndroidBridge::NewJavaString(env, a0);
michael@0 1120 args[1].l = AndroidBridge::NewJavaString(env, a1);
michael@0 1121 args[2].l = AndroidBridge::NewJavaString(env, a2);
michael@0 1122 args[3].l = AndroidBridge::NewJavaString(env, a3);
michael@0 1123 args[4].l = AndroidBridge::NewJavaString(env, a4);
michael@0 1124
michael@0 1125 env->CallStaticVoidMethodA(mGeckoAppShellClass, jShowAlertNotificationWrapper, args);
michael@0 1126 AndroidBridge::HandleUncaughtException(env);
michael@0 1127 env->PopLocalFrame(nullptr);
michael@0 1128 }
michael@0 1129
michael@0 1130 void GeckoAppShell::ShowInputMethodPicker() {
michael@0 1131 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1132 if (env->PushLocalFrame(0) != 0) {
michael@0 1133 AndroidBridge::HandleUncaughtException(env);
michael@0 1134 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1135 }
michael@0 1136
michael@0 1137 env->CallStaticVoidMethod(mGeckoAppShellClass, jShowInputMethodPicker);
michael@0 1138 AndroidBridge::HandleUncaughtException(env);
michael@0 1139 env->PopLocalFrame(nullptr);
michael@0 1140 }
michael@0 1141
michael@0 1142 bool GeckoAppShell::UnlockProfile() {
michael@0 1143 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1144 if (env->PushLocalFrame(0) != 0) {
michael@0 1145 AndroidBridge::HandleUncaughtException(env);
michael@0 1146 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1147 }
michael@0 1148
michael@0 1149 bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jUnlockProfile);
michael@0 1150 AndroidBridge::HandleUncaughtException(env);
michael@0 1151 env->PopLocalFrame(nullptr);
michael@0 1152 return temp;
michael@0 1153 }
michael@0 1154
michael@0 1155 void GeckoAppShell::UnlockScreenOrientation() {
michael@0 1156 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1157 if (env->PushLocalFrame(0) != 0) {
michael@0 1158 AndroidBridge::HandleUncaughtException(env);
michael@0 1159 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1160 }
michael@0 1161
michael@0 1162 env->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
michael@0 1163 AndroidBridge::HandleUncaughtException(env);
michael@0 1164 env->PopLocalFrame(nullptr);
michael@0 1165 }
michael@0 1166
michael@0 1167 void GeckoAppShell::UnregisterSurfaceTextureFrameListener(jobject a0) {
michael@0 1168 JNIEnv *env = GetJNIForThread();
michael@0 1169 if (env->PushLocalFrame(1) != 0) {
michael@0 1170 AndroidBridge::HandleUncaughtException(env);
michael@0 1171 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1172 }
michael@0 1173
michael@0 1174 env->CallStaticVoidMethod(mGeckoAppShellClass, jUnregisterSurfaceTextureFrameListener, a0);
michael@0 1175 AndroidBridge::HandleUncaughtException(env);
michael@0 1176 env->PopLocalFrame(nullptr);
michael@0 1177 }
michael@0 1178
michael@0 1179 void GeckoAppShell::Vibrate1(int64_t a0) {
michael@0 1180 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1181 if (env->PushLocalFrame(0) != 0) {
michael@0 1182 AndroidBridge::HandleUncaughtException(env);
michael@0 1183 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1184 }
michael@0 1185
michael@0 1186 env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrate1, a0);
michael@0 1187 AndroidBridge::HandleUncaughtException(env);
michael@0 1188 env->PopLocalFrame(nullptr);
michael@0 1189 }
michael@0 1190
michael@0 1191 void GeckoAppShell::VibrateA(jlongArray a0, int32_t a1) {
michael@0 1192 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1193 if (env->PushLocalFrame(1) != 0) {
michael@0 1194 AndroidBridge::HandleUncaughtException(env);
michael@0 1195 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1196 }
michael@0 1197
michael@0 1198 env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrateA, a0, a1);
michael@0 1199 AndroidBridge::HandleUncaughtException(env);
michael@0 1200 env->PopLocalFrame(nullptr);
michael@0 1201 }
michael@0 1202 jclass JavaDomKeyLocation::mDomKeyLocationClass = 0;
michael@0 1203 jmethodID JavaDomKeyLocation::jvalueOf = 0;
michael@0 1204 jmethodID JavaDomKeyLocation::jvalues = 0;
michael@0 1205 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_JOYSTICK = 0;
michael@0 1206 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_LEFT = 0;
michael@0 1207 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_MOBILE = 0;
michael@0 1208 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_NUMPAD = 0;
michael@0 1209 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_RIGHT = 0;
michael@0 1210 jfieldID JavaDomKeyLocation::jDOM_KEY_LOCATION_STANDARD = 0;
michael@0 1211 jfieldID JavaDomKeyLocation::jvalue = 0;
michael@0 1212 void JavaDomKeyLocation::InitStubs(JNIEnv *jEnv) {
michael@0 1213 initInit();
michael@0 1214
michael@0 1215 mDomKeyLocationClass = getClassGlobalRef("org/mozilla/gecko/GeckoEvent$DomKeyLocation");
michael@0 1216 jvalueOf = getStaticMethod("valueOf", "(Ljava/lang/String;)Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1217 jvalues = getStaticMethod("values", "()[Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1218 jDOM_KEY_LOCATION_JOYSTICK = getStaticField("DOM_KEY_LOCATION_JOYSTICK", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1219 jDOM_KEY_LOCATION_LEFT = getStaticField("DOM_KEY_LOCATION_LEFT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1220 jDOM_KEY_LOCATION_MOBILE = getStaticField("DOM_KEY_LOCATION_MOBILE", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1221 jDOM_KEY_LOCATION_NUMPAD = getStaticField("DOM_KEY_LOCATION_NUMPAD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1222 jDOM_KEY_LOCATION_RIGHT = getStaticField("DOM_KEY_LOCATION_RIGHT", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1223 jDOM_KEY_LOCATION_STANDARD = getStaticField("DOM_KEY_LOCATION_STANDARD", "Lorg/mozilla/gecko/GeckoEvent$DomKeyLocation;");
michael@0 1224 jvalue = getField("value", "I");
michael@0 1225 }
michael@0 1226
michael@0 1227 JavaDomKeyLocation* JavaDomKeyLocation::Wrap(jobject obj) {
michael@0 1228 JNIEnv *env = GetJNIForThread();
michael@0 1229 JavaDomKeyLocation* ret = new JavaDomKeyLocation(obj, env);
michael@0 1230 env->DeleteLocalRef(obj);
michael@0 1231 return ret;
michael@0 1232 }
michael@0 1233
michael@0 1234 jobject JavaDomKeyLocation::valueOf(const nsAString& a0) {
michael@0 1235 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1236 if (env->PushLocalFrame(2) != 0) {
michael@0 1237 AndroidBridge::HandleUncaughtException(env);
michael@0 1238 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1239 }
michael@0 1240
michael@0 1241 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 1242
michael@0 1243 jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalueOf, j0);
michael@0 1244 AndroidBridge::HandleUncaughtException(env);
michael@0 1245 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1246 return ret;
michael@0 1247 }
michael@0 1248
michael@0 1249 jobjectArray JavaDomKeyLocation::values() {
michael@0 1250 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1251 if (env->PushLocalFrame(1) != 0) {
michael@0 1252 AndroidBridge::HandleUncaughtException(env);
michael@0 1253 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1254 }
michael@0 1255
michael@0 1256 jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalues);
michael@0 1257 AndroidBridge::HandleUncaughtException(env);
michael@0 1258 jobjectArray ret = static_cast<jobjectArray>(env->PopLocalFrame(temp));
michael@0 1259 return ret;
michael@0 1260 }
michael@0 1261
michael@0 1262 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_JOYSTICK() {
michael@0 1263 JNIEnv *env = GetJNIForThread();
michael@0 1264 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_JOYSTICK));
michael@0 1265 }
michael@0 1266
michael@0 1267 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_LEFT() {
michael@0 1268 JNIEnv *env = GetJNIForThread();
michael@0 1269 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_LEFT));
michael@0 1270 }
michael@0 1271
michael@0 1272 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_MOBILE() {
michael@0 1273 JNIEnv *env = GetJNIForThread();
michael@0 1274 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_MOBILE));
michael@0 1275 }
michael@0 1276
michael@0 1277 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_NUMPAD() {
michael@0 1278 JNIEnv *env = GetJNIForThread();
michael@0 1279 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_NUMPAD));
michael@0 1280 }
michael@0 1281
michael@0 1282 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_RIGHT() {
michael@0 1283 JNIEnv *env = GetJNIForThread();
michael@0 1284 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_RIGHT));
michael@0 1285 }
michael@0 1286
michael@0 1287 jobject JavaDomKeyLocation::getDOM_KEY_LOCATION_STANDARD() {
michael@0 1288 JNIEnv *env = GetJNIForThread();
michael@0 1289 return static_cast<jobject>(env->GetStaticObjectField(mDomKeyLocationClass, jDOM_KEY_LOCATION_STANDARD));
michael@0 1290 }
michael@0 1291
michael@0 1292 int32_t JavaDomKeyLocation::getvalue() {
michael@0 1293 JNIEnv *env = GetJNIForThread();
michael@0 1294 return env->GetIntField(wrapped_obj, jvalue);
michael@0 1295 }
michael@0 1296 jclass GeckoJavaSampler::mGeckoJavaSamplerClass = 0;
michael@0 1297 jmethodID GeckoJavaSampler::jGetFrameNameJavaProfilingWrapper = 0;
michael@0 1298 jmethodID GeckoJavaSampler::jGetSampleTimeJavaProfiling = 0;
michael@0 1299 jmethodID GeckoJavaSampler::jGetThreadNameJavaProfilingWrapper = 0;
michael@0 1300 jmethodID GeckoJavaSampler::jPauseJavaProfiling = 0;
michael@0 1301 jmethodID GeckoJavaSampler::jStartJavaProfiling = 0;
michael@0 1302 jmethodID GeckoJavaSampler::jStopJavaProfiling = 0;
michael@0 1303 jmethodID GeckoJavaSampler::jUnpauseJavaProfiling = 0;
michael@0 1304 void GeckoJavaSampler::InitStubs(JNIEnv *jEnv) {
michael@0 1305 initInit();
michael@0 1306
michael@0 1307 mGeckoJavaSamplerClass = getClassGlobalRef("org/mozilla/gecko/GeckoJavaSampler");
michael@0 1308 jGetFrameNameJavaProfilingWrapper = getStaticMethod("getFrameName", "(III)Ljava/lang/String;");
michael@0 1309 jGetSampleTimeJavaProfiling = getStaticMethod("getSampleTime", "(II)D");
michael@0 1310 jGetThreadNameJavaProfilingWrapper = getStaticMethod("getThreadName", "(I)Ljava/lang/String;");
michael@0 1311 jPauseJavaProfiling = getStaticMethod("pause", "()V");
michael@0 1312 jStartJavaProfiling = getStaticMethod("start", "(II)V");
michael@0 1313 jStopJavaProfiling = getStaticMethod("stop", "()V");
michael@0 1314 jUnpauseJavaProfiling = getStaticMethod("unpause", "()V");
michael@0 1315 }
michael@0 1316
michael@0 1317 GeckoJavaSampler* GeckoJavaSampler::Wrap(jobject obj) {
michael@0 1318 JNIEnv *env = GetJNIForThread();
michael@0 1319 GeckoJavaSampler* ret = new GeckoJavaSampler(obj, env);
michael@0 1320 env->DeleteLocalRef(obj);
michael@0 1321 return ret;
michael@0 1322 }
michael@0 1323
michael@0 1324 jstring GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a1, int32_t a2) {
michael@0 1325 JNIEnv *env = GetJNIForThread();
michael@0 1326 if (env->PushLocalFrame(1) != 0) {
michael@0 1327 AndroidBridge::HandleUncaughtException(env);
michael@0 1328 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1329 }
michael@0 1330
michael@0 1331 jvalue args[3];
michael@0 1332 args[0].i = a0;
michael@0 1333 args[1].i = a1;
michael@0 1334 args[2].i = a2;
michael@0 1335
michael@0 1336 jobject temp = env->CallStaticObjectMethodA(mGeckoJavaSamplerClass, jGetFrameNameJavaProfilingWrapper, args);
michael@0 1337 AndroidBridge::HandleUncaughtException(env);
michael@0 1338 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 1339 return ret;
michael@0 1340 }
michael@0 1341
michael@0 1342 jdouble GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) {
michael@0 1343 JNIEnv *env = GetJNIForThread();
michael@0 1344 if (env->PushLocalFrame(0) != 0) {
michael@0 1345 AndroidBridge::HandleUncaughtException(env);
michael@0 1346 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1347 }
michael@0 1348
michael@0 1349 jdouble temp = env->CallStaticDoubleMethod(mGeckoJavaSamplerClass, jGetSampleTimeJavaProfiling, a0, a1);
michael@0 1350 AndroidBridge::HandleUncaughtException(env);
michael@0 1351 env->PopLocalFrame(nullptr);
michael@0 1352 return temp;
michael@0 1353 }
michael@0 1354
michael@0 1355 jstring GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(int32_t a0) {
michael@0 1356 JNIEnv *env = GetJNIForThread();
michael@0 1357 if (env->PushLocalFrame(1) != 0) {
michael@0 1358 AndroidBridge::HandleUncaughtException(env);
michael@0 1359 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1360 }
michael@0 1361
michael@0 1362 jobject temp = env->CallStaticObjectMethod(mGeckoJavaSamplerClass, jGetThreadNameJavaProfilingWrapper, a0);
michael@0 1363 AndroidBridge::HandleUncaughtException(env);
michael@0 1364 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 1365 return ret;
michael@0 1366 }
michael@0 1367
michael@0 1368 void GeckoJavaSampler::PauseJavaProfiling() {
michael@0 1369 JNIEnv *env = GetJNIForThread();
michael@0 1370 if (env->PushLocalFrame(0) != 0) {
michael@0 1371 AndroidBridge::HandleUncaughtException(env);
michael@0 1372 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1373 }
michael@0 1374
michael@0 1375 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jPauseJavaProfiling);
michael@0 1376 AndroidBridge::HandleUncaughtException(env);
michael@0 1377 env->PopLocalFrame(nullptr);
michael@0 1378 }
michael@0 1379
michael@0 1380 void GeckoJavaSampler::StartJavaProfiling(int32_t a0, int32_t a1) {
michael@0 1381 JNIEnv *env = GetJNIForThread();
michael@0 1382 if (env->PushLocalFrame(0) != 0) {
michael@0 1383 AndroidBridge::HandleUncaughtException(env);
michael@0 1384 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1385 }
michael@0 1386
michael@0 1387 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStartJavaProfiling, a0, a1);
michael@0 1388 AndroidBridge::HandleUncaughtException(env);
michael@0 1389 env->PopLocalFrame(nullptr);
michael@0 1390 }
michael@0 1391
michael@0 1392 void GeckoJavaSampler::StopJavaProfiling() {
michael@0 1393 JNIEnv *env = GetJNIForThread();
michael@0 1394 if (env->PushLocalFrame(0) != 0) {
michael@0 1395 AndroidBridge::HandleUncaughtException(env);
michael@0 1396 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1397 }
michael@0 1398
michael@0 1399 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStopJavaProfiling);
michael@0 1400 AndroidBridge::HandleUncaughtException(env);
michael@0 1401 env->PopLocalFrame(nullptr);
michael@0 1402 }
michael@0 1403
michael@0 1404 void GeckoJavaSampler::UnpauseJavaProfiling() {
michael@0 1405 JNIEnv *env = GetJNIForThread();
michael@0 1406 if (env->PushLocalFrame(0) != 0) {
michael@0 1407 AndroidBridge::HandleUncaughtException(env);
michael@0 1408 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1409 }
michael@0 1410
michael@0 1411 env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jUnpauseJavaProfiling);
michael@0 1412 AndroidBridge::HandleUncaughtException(env);
michael@0 1413 env->PopLocalFrame(nullptr);
michael@0 1414 }
michael@0 1415 jclass SurfaceBits::mSurfaceBitsClass = 0;
michael@0 1416 jmethodID SurfaceBits::jSurfaceBits = 0;
michael@0 1417 jfieldID SurfaceBits::jbuffer = 0;
michael@0 1418 jfieldID SurfaceBits::jformat = 0;
michael@0 1419 jfieldID SurfaceBits::jheight = 0;
michael@0 1420 jfieldID SurfaceBits::jwidth = 0;
michael@0 1421 void SurfaceBits::InitStubs(JNIEnv *jEnv) {
michael@0 1422 initInit();
michael@0 1423
michael@0 1424 mSurfaceBitsClass = getClassGlobalRef("org/mozilla/gecko/SurfaceBits");
michael@0 1425 jSurfaceBits = getMethod("<init>", "()V");
michael@0 1426 jbuffer = getField("buffer", "Ljava/nio/ByteBuffer;");
michael@0 1427 jformat = getField("format", "I");
michael@0 1428 jheight = getField("height", "I");
michael@0 1429 jwidth = getField("width", "I");
michael@0 1430 }
michael@0 1431
michael@0 1432 SurfaceBits* SurfaceBits::Wrap(jobject obj) {
michael@0 1433 JNIEnv *env = GetJNIForThread();
michael@0 1434 SurfaceBits* ret = new SurfaceBits(obj, env);
michael@0 1435 env->DeleteLocalRef(obj);
michael@0 1436 return ret;
michael@0 1437 }
michael@0 1438
michael@0 1439 SurfaceBits::SurfaceBits() {
michael@0 1440 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1441 if (env->PushLocalFrame(0) != 0) {
michael@0 1442 AndroidBridge::HandleUncaughtException(env);
michael@0 1443 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1444 }
michael@0 1445
michael@0 1446 Init(env->NewObject(mSurfaceBitsClass, jSurfaceBits), env);
michael@0 1447 env->PopLocalFrame(nullptr);
michael@0 1448 }
michael@0 1449
michael@0 1450 jobject SurfaceBits::getbuffer() {
michael@0 1451 JNIEnv *env = GetJNIForThread();
michael@0 1452 return static_cast<jobject>(env->GetObjectField(wrapped_obj, jbuffer));
michael@0 1453 }
michael@0 1454
michael@0 1455 void SurfaceBits::setbuffer(jobject a0) {
michael@0 1456 JNIEnv *env = GetJNIForThread();
michael@0 1457 env->SetObjectField(wrapped_obj, jbuffer, a0);
michael@0 1458 }
michael@0 1459
michael@0 1460 int32_t SurfaceBits::getformat() {
michael@0 1461 JNIEnv *env = GetJNIForThread();
michael@0 1462 return env->GetIntField(wrapped_obj, jformat);
michael@0 1463 }
michael@0 1464
michael@0 1465 void SurfaceBits::setformat(int32_t a0) {
michael@0 1466 JNIEnv *env = GetJNIForThread();
michael@0 1467 env->SetIntField(wrapped_obj, jformat, a0);
michael@0 1468 }
michael@0 1469
michael@0 1470 int32_t SurfaceBits::getheight() {
michael@0 1471 JNIEnv *env = GetJNIForThread();
michael@0 1472 return env->GetIntField(wrapped_obj, jheight);
michael@0 1473 }
michael@0 1474
michael@0 1475 void SurfaceBits::setheight(int32_t a0) {
michael@0 1476 JNIEnv *env = GetJNIForThread();
michael@0 1477 env->SetIntField(wrapped_obj, jheight, a0);
michael@0 1478 }
michael@0 1479
michael@0 1480 int32_t SurfaceBits::getwidth() {
michael@0 1481 JNIEnv *env = GetJNIForThread();
michael@0 1482 return env->GetIntField(wrapped_obj, jwidth);
michael@0 1483 }
michael@0 1484
michael@0 1485 void SurfaceBits::setwidth(int32_t a0) {
michael@0 1486 JNIEnv *env = GetJNIForThread();
michael@0 1487 env->SetIntField(wrapped_obj, jwidth, a0);
michael@0 1488 }
michael@0 1489 jclass ThumbnailHelper::mThumbnailHelperClass = 0;
michael@0 1490 jmethodID ThumbnailHelper::jSendThumbnail = 0;
michael@0 1491 void ThumbnailHelper::InitStubs(JNIEnv *jEnv) {
michael@0 1492 initInit();
michael@0 1493
michael@0 1494 mThumbnailHelperClass = getClassGlobalRef("org/mozilla/gecko/ThumbnailHelper");
michael@0 1495 jSendThumbnail = getStaticMethod("notifyThumbnail", "(Ljava/nio/ByteBuffer;IZ)V");
michael@0 1496 }
michael@0 1497
michael@0 1498 ThumbnailHelper* ThumbnailHelper::Wrap(jobject obj) {
michael@0 1499 JNIEnv *env = GetJNIForThread();
michael@0 1500 ThumbnailHelper* ret = new ThumbnailHelper(obj, env);
michael@0 1501 env->DeleteLocalRef(obj);
michael@0 1502 return ret;
michael@0 1503 }
michael@0 1504
michael@0 1505 void ThumbnailHelper::SendThumbnail(jobject a0, int32_t a1, bool a2) {
michael@0 1506 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1507 if (env->PushLocalFrame(1) != 0) {
michael@0 1508 AndroidBridge::HandleUncaughtException(env);
michael@0 1509 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1510 }
michael@0 1511
michael@0 1512 jvalue args[3];
michael@0 1513 args[0].l = a0;
michael@0 1514 args[1].i = a1;
michael@0 1515 args[2].z = a2;
michael@0 1516
michael@0 1517 env->CallStaticVoidMethodA(mThumbnailHelperClass, jSendThumbnail, args);
michael@0 1518 AndroidBridge::HandleUncaughtException(env);
michael@0 1519 env->PopLocalFrame(nullptr);
michael@0 1520 }
michael@0 1521 jclass DisplayPortMetrics::mDisplayPortMetricsClass = 0;
michael@0 1522 jmethodID DisplayPortMetrics::jDisplayPortMetrics = 0;
michael@0 1523 jfieldID DisplayPortMetrics::jMPosition = 0;
michael@0 1524 jfieldID DisplayPortMetrics::jResolution = 0;
michael@0 1525 void DisplayPortMetrics::InitStubs(JNIEnv *jEnv) {
michael@0 1526 initInit();
michael@0 1527
michael@0 1528 mDisplayPortMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/DisplayPortMetrics");
michael@0 1529 jDisplayPortMetrics = getMethod("<init>", "(FFFFF)V");
michael@0 1530 jMPosition = getField("mPosition", "Landroid/graphics/RectF;");
michael@0 1531 jResolution = getField("resolution", "F");
michael@0 1532 }
michael@0 1533
michael@0 1534 DisplayPortMetrics* DisplayPortMetrics::Wrap(jobject obj) {
michael@0 1535 JNIEnv *env = GetJNIForThread();
michael@0 1536 DisplayPortMetrics* ret = new DisplayPortMetrics(obj, env);
michael@0 1537 env->DeleteLocalRef(obj);
michael@0 1538 return ret;
michael@0 1539 }
michael@0 1540
michael@0 1541 DisplayPortMetrics::DisplayPortMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
michael@0 1542 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1543 if (env->PushLocalFrame(0) != 0) {
michael@0 1544 AndroidBridge::HandleUncaughtException(env);
michael@0 1545 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1546 }
michael@0 1547
michael@0 1548 jvalue args[5];
michael@0 1549 args[0].f = a0;
michael@0 1550 args[1].f = a1;
michael@0 1551 args[2].f = a2;
michael@0 1552 args[3].f = a3;
michael@0 1553 args[4].f = a4;
michael@0 1554
michael@0 1555 Init(env->NewObjectA(mDisplayPortMetricsClass, jDisplayPortMetrics, args), env);
michael@0 1556 env->PopLocalFrame(nullptr);
michael@0 1557 }
michael@0 1558
michael@0 1559 jobject DisplayPortMetrics::getMPosition() {
michael@0 1560 JNIEnv *env = GetJNIForThread();
michael@0 1561 return static_cast<jobject>(env->GetObjectField(wrapped_obj, jMPosition));
michael@0 1562 }
michael@0 1563
michael@0 1564 jfloat DisplayPortMetrics::getResolution() {
michael@0 1565 JNIEnv *env = GetJNIForThread();
michael@0 1566 return env->GetFloatField(wrapped_obj, jResolution);
michael@0 1567 }
michael@0 1568 jclass GLController::mGLControllerClass = 0;
michael@0 1569 jmethodID GLController::jCreateEGLSurfaceForCompositorWrapper = 0;
michael@0 1570 void GLController::InitStubs(JNIEnv *jEnv) {
michael@0 1571 initInit();
michael@0 1572
michael@0 1573 mGLControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/GLController");
michael@0 1574 jCreateEGLSurfaceForCompositorWrapper = getMethod("createEGLSurfaceForCompositor", "()Ljavax/microedition/khronos/egl/EGLSurface;");
michael@0 1575 }
michael@0 1576
michael@0 1577 GLController* GLController::Wrap(jobject obj) {
michael@0 1578 JNIEnv *env = GetJNIForThread();
michael@0 1579 GLController* ret = new GLController(obj, env);
michael@0 1580 env->DeleteLocalRef(obj);
michael@0 1581 return ret;
michael@0 1582 }
michael@0 1583
michael@0 1584 jobject GLController::CreateEGLSurfaceForCompositorWrapper() {
michael@0 1585 JNIEnv *env = GetJNIForThread();
michael@0 1586 if (env->PushLocalFrame(1) != 0) {
michael@0 1587 AndroidBridge::HandleUncaughtException(env);
michael@0 1588 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1589 }
michael@0 1590
michael@0 1591 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateEGLSurfaceForCompositorWrapper);
michael@0 1592 AndroidBridge::HandleUncaughtException(env);
michael@0 1593 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1594 return ret;
michael@0 1595 }
michael@0 1596 jclass GeckoLayerClient::mGeckoLayerClientClass = 0;
michael@0 1597 jmethodID GeckoLayerClient::jActivateProgram = 0;
michael@0 1598 jmethodID GeckoLayerClient::jContentDocumentChanged = 0;
michael@0 1599 jmethodID GeckoLayerClient::jCreateFrame = 0;
michael@0 1600 jmethodID GeckoLayerClient::jDeactivateProgram = 0;
michael@0 1601 jmethodID GeckoLayerClient::jGetDisplayPort = 0;
michael@0 1602 jmethodID GeckoLayerClient::jIsContentDocumentDisplayed = 0;
michael@0 1603 jmethodID GeckoLayerClient::jProgressiveUpdateCallback = 0;
michael@0 1604 jmethodID GeckoLayerClient::jSetFirstPaintViewport = 0;
michael@0 1605 jmethodID GeckoLayerClient::jSetPageRect = 0;
michael@0 1606 jmethodID GeckoLayerClient::jSyncFrameMetrics = 0;
michael@0 1607 jmethodID GeckoLayerClient::jSyncViewportInfo = 0;
michael@0 1608 void GeckoLayerClient::InitStubs(JNIEnv *jEnv) {
michael@0 1609 initInit();
michael@0 1610
michael@0 1611 mGeckoLayerClientClass = getClassGlobalRef("org/mozilla/gecko/gfx/GeckoLayerClient");
michael@0 1612 jActivateProgram = getMethod("activateProgram", "()V");
michael@0 1613 jContentDocumentChanged = getMethod("contentDocumentChanged", "()V");
michael@0 1614 jCreateFrame = getMethod("createFrame", "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;");
michael@0 1615 jDeactivateProgram = getMethod("deactivateProgram", "()V");
michael@0 1616 jGetDisplayPort = getMethod("getDisplayPort", "(ZZILorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)Lorg/mozilla/gecko/gfx/DisplayPortMetrics;");
michael@0 1617 jIsContentDocumentDisplayed = getMethod("isContentDocumentDisplayed", "()Z");
michael@0 1618 jProgressiveUpdateCallback = getMethod("progressiveUpdateCallback", "(ZFFFFFZ)Lorg/mozilla/gecko/gfx/ProgressiveUpdateData;");
michael@0 1619 jSetFirstPaintViewport = getMethod("setFirstPaintViewport", "(FFFFFFF)V");
michael@0 1620 jSetPageRect = getMethod("setPageRect", "(FFFF)V");
michael@0 1621 jSyncFrameMetrics = getMethod("syncFrameMetrics", "(FFFFFFFZIIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
michael@0 1622 jSyncViewportInfo = getMethod("syncViewportInfo", "(IIIIFZ)Lorg/mozilla/gecko/gfx/ViewTransform;");
michael@0 1623 }
michael@0 1624
michael@0 1625 GeckoLayerClient* GeckoLayerClient::Wrap(jobject obj) {
michael@0 1626 JNIEnv *env = GetJNIForThread();
michael@0 1627 GeckoLayerClient* ret = new GeckoLayerClient(obj, env);
michael@0 1628 env->DeleteLocalRef(obj);
michael@0 1629 return ret;
michael@0 1630 }
michael@0 1631
michael@0 1632 void GeckoLayerClient::ActivateProgram() {
michael@0 1633 JNIEnv *env = GetJNIForThread();
michael@0 1634 if (env->PushLocalFrame(0) != 0) {
michael@0 1635 AndroidBridge::HandleUncaughtException(env);
michael@0 1636 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1637 }
michael@0 1638
michael@0 1639 env->CallVoidMethod(wrapped_obj, jActivateProgram);
michael@0 1640 AndroidBridge::HandleUncaughtException(env);
michael@0 1641 env->PopLocalFrame(nullptr);
michael@0 1642 }
michael@0 1643
michael@0 1644 void GeckoLayerClient::ContentDocumentChanged() {
michael@0 1645 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1646 if (env->PushLocalFrame(0) != 0) {
michael@0 1647 AndroidBridge::HandleUncaughtException(env);
michael@0 1648 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1649 }
michael@0 1650
michael@0 1651 env->CallVoidMethod(wrapped_obj, jContentDocumentChanged);
michael@0 1652 AndroidBridge::HandleUncaughtException(env);
michael@0 1653 env->PopLocalFrame(nullptr);
michael@0 1654 }
michael@0 1655
michael@0 1656 jobject GeckoLayerClient::CreateFrame() {
michael@0 1657 JNIEnv *env = GetJNIForThread();
michael@0 1658 if (env->PushLocalFrame(1) != 0) {
michael@0 1659 AndroidBridge::HandleUncaughtException(env);
michael@0 1660 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1661 }
michael@0 1662
michael@0 1663 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateFrame);
michael@0 1664 AndroidBridge::HandleUncaughtException(env);
michael@0 1665 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1666 return ret;
michael@0 1667 }
michael@0 1668
michael@0 1669 void GeckoLayerClient::DeactivateProgram() {
michael@0 1670 JNIEnv *env = GetJNIForThread();
michael@0 1671 if (env->PushLocalFrame(0) != 0) {
michael@0 1672 AndroidBridge::HandleUncaughtException(env);
michael@0 1673 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1674 }
michael@0 1675
michael@0 1676 env->CallVoidMethod(wrapped_obj, jDeactivateProgram);
michael@0 1677 AndroidBridge::HandleUncaughtException(env);
michael@0 1678 env->PopLocalFrame(nullptr);
michael@0 1679 }
michael@0 1680
michael@0 1681 jobject GeckoLayerClient::GetDisplayPort(bool a0, bool a1, int32_t a2, jobject a3) {
michael@0 1682 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1683 if (env->PushLocalFrame(2) != 0) {
michael@0 1684 AndroidBridge::HandleUncaughtException(env);
michael@0 1685 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1686 }
michael@0 1687
michael@0 1688 jvalue args[4];
michael@0 1689 args[0].z = a0;
michael@0 1690 args[1].z = a1;
michael@0 1691 args[2].i = a2;
michael@0 1692 args[3].l = a3;
michael@0 1693
michael@0 1694 jobject temp = env->CallObjectMethodA(wrapped_obj, jGetDisplayPort, args);
michael@0 1695 AndroidBridge::HandleUncaughtException(env);
michael@0 1696 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1697 return ret;
michael@0 1698 }
michael@0 1699
michael@0 1700 bool GeckoLayerClient::IsContentDocumentDisplayed() {
michael@0 1701 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1702 if (env->PushLocalFrame(0) != 0) {
michael@0 1703 AndroidBridge::HandleUncaughtException(env);
michael@0 1704 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1705 }
michael@0 1706
michael@0 1707 bool temp = env->CallBooleanMethod(wrapped_obj, jIsContentDocumentDisplayed);
michael@0 1708 AndroidBridge::HandleUncaughtException(env);
michael@0 1709 env->PopLocalFrame(nullptr);
michael@0 1710 return temp;
michael@0 1711 }
michael@0 1712
michael@0 1713 jobject GeckoLayerClient::ProgressiveUpdateCallback(bool a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, bool a6) {
michael@0 1714 JNIEnv *env = GetJNIForThread();
michael@0 1715 if (env->PushLocalFrame(1) != 0) {
michael@0 1716 AndroidBridge::HandleUncaughtException(env);
michael@0 1717 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1718 }
michael@0 1719
michael@0 1720 jvalue args[7];
michael@0 1721 args[0].z = a0;
michael@0 1722 args[1].f = a1;
michael@0 1723 args[2].f = a2;
michael@0 1724 args[3].f = a3;
michael@0 1725 args[4].f = a4;
michael@0 1726 args[5].f = a5;
michael@0 1727 args[6].z = a6;
michael@0 1728
michael@0 1729 jobject temp = env->CallObjectMethodA(wrapped_obj, jProgressiveUpdateCallback, args);
michael@0 1730 AndroidBridge::HandleUncaughtException(env);
michael@0 1731 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1732 return ret;
michael@0 1733 }
michael@0 1734
michael@0 1735 void GeckoLayerClient::SetFirstPaintViewport(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6) {
michael@0 1736 JNIEnv *env = GetJNIForThread();
michael@0 1737 if (env->PushLocalFrame(0) != 0) {
michael@0 1738 AndroidBridge::HandleUncaughtException(env);
michael@0 1739 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1740 }
michael@0 1741
michael@0 1742 jvalue args[7];
michael@0 1743 args[0].f = a0;
michael@0 1744 args[1].f = a1;
michael@0 1745 args[2].f = a2;
michael@0 1746 args[3].f = a3;
michael@0 1747 args[4].f = a4;
michael@0 1748 args[5].f = a5;
michael@0 1749 args[6].f = a6;
michael@0 1750
michael@0 1751 env->CallVoidMethodA(wrapped_obj, jSetFirstPaintViewport, args);
michael@0 1752 AndroidBridge::HandleUncaughtException(env);
michael@0 1753 env->PopLocalFrame(nullptr);
michael@0 1754 }
michael@0 1755
michael@0 1756 void GeckoLayerClient::SetPageRect(jfloat a0, jfloat a1, jfloat a2, jfloat a3) {
michael@0 1757 JNIEnv *env = GetJNIForThread();
michael@0 1758 if (env->PushLocalFrame(0) != 0) {
michael@0 1759 AndroidBridge::HandleUncaughtException(env);
michael@0 1760 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1761 }
michael@0 1762
michael@0 1763 jvalue args[4];
michael@0 1764 args[0].f = a0;
michael@0 1765 args[1].f = a1;
michael@0 1766 args[2].f = a2;
michael@0 1767 args[3].f = a3;
michael@0 1768
michael@0 1769 env->CallVoidMethodA(wrapped_obj, jSetPageRect, args);
michael@0 1770 AndroidBridge::HandleUncaughtException(env);
michael@0 1771 env->PopLocalFrame(nullptr);
michael@0 1772 }
michael@0 1773
michael@0 1774 jobject GeckoLayerClient::SyncFrameMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, bool a7, int32_t a8, int32_t a9, int32_t a10, int32_t a11, jfloat a12, bool a13) {
michael@0 1775 JNIEnv *env = GetJNIForThread();
michael@0 1776 if (env->PushLocalFrame(1) != 0) {
michael@0 1777 AndroidBridge::HandleUncaughtException(env);
michael@0 1778 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1779 }
michael@0 1780
michael@0 1781 jvalue args[14];
michael@0 1782 args[0].f = a0;
michael@0 1783 args[1].f = a1;
michael@0 1784 args[2].f = a2;
michael@0 1785 args[3].f = a3;
michael@0 1786 args[4].f = a4;
michael@0 1787 args[5].f = a5;
michael@0 1788 args[6].f = a6;
michael@0 1789 args[7].z = a7;
michael@0 1790 args[8].i = a8;
michael@0 1791 args[9].i = a9;
michael@0 1792 args[10].i = a10;
michael@0 1793 args[11].i = a11;
michael@0 1794 args[12].f = a12;
michael@0 1795 args[13].z = a13;
michael@0 1796
michael@0 1797 jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncFrameMetrics, args);
michael@0 1798 AndroidBridge::HandleUncaughtException(env);
michael@0 1799 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1800 return ret;
michael@0 1801 }
michael@0 1802
michael@0 1803 jobject GeckoLayerClient::SyncViewportInfo(int32_t a0, int32_t a1, int32_t a2, int32_t a3, jfloat a4, bool a5) {
michael@0 1804 JNIEnv *env = GetJNIForThread();
michael@0 1805 if (env->PushLocalFrame(1) != 0) {
michael@0 1806 AndroidBridge::HandleUncaughtException(env);
michael@0 1807 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1808 }
michael@0 1809
michael@0 1810 jvalue args[6];
michael@0 1811 args[0].i = a0;
michael@0 1812 args[1].i = a1;
michael@0 1813 args[2].i = a2;
michael@0 1814 args[3].i = a3;
michael@0 1815 args[4].f = a4;
michael@0 1816 args[5].z = a5;
michael@0 1817
michael@0 1818 jobject temp = env->CallObjectMethodA(wrapped_obj, jSyncViewportInfo, args);
michael@0 1819 AndroidBridge::HandleUncaughtException(env);
michael@0 1820 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1821 return ret;
michael@0 1822 }
michael@0 1823 jclass ImmutableViewportMetrics::mImmutableViewportMetricsClass = 0;
michael@0 1824 jmethodID ImmutableViewportMetrics::jImmutableViewportMetrics = 0;
michael@0 1825 void ImmutableViewportMetrics::InitStubs(JNIEnv *jEnv) {
michael@0 1826 initInit();
michael@0 1827
michael@0 1828 mImmutableViewportMetricsClass = getClassGlobalRef("org/mozilla/gecko/gfx/ImmutableViewportMetrics");
michael@0 1829 jImmutableViewportMetrics = getMethod("<init>", "(FFFFFFFFFFFFF)V");
michael@0 1830 }
michael@0 1831
michael@0 1832 ImmutableViewportMetrics* ImmutableViewportMetrics::Wrap(jobject obj) {
michael@0 1833 JNIEnv *env = GetJNIForThread();
michael@0 1834 ImmutableViewportMetrics* ret = new ImmutableViewportMetrics(obj, env);
michael@0 1835 env->DeleteLocalRef(obj);
michael@0 1836 return ret;
michael@0 1837 }
michael@0 1838
michael@0 1839 ImmutableViewportMetrics::ImmutableViewportMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4, jfloat a5, jfloat a6, jfloat a7, jfloat a8, jfloat a9, jfloat a10, jfloat a11, jfloat a12) {
michael@0 1840 JNIEnv *env = GetJNIForThread();
michael@0 1841 if (env->PushLocalFrame(0) != 0) {
michael@0 1842 AndroidBridge::HandleUncaughtException(env);
michael@0 1843 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1844 }
michael@0 1845
michael@0 1846 jvalue args[13];
michael@0 1847 args[0].f = a0;
michael@0 1848 args[1].f = a1;
michael@0 1849 args[2].f = a2;
michael@0 1850 args[3].f = a3;
michael@0 1851 args[4].f = a4;
michael@0 1852 args[5].f = a5;
michael@0 1853 args[6].f = a6;
michael@0 1854 args[7].f = a7;
michael@0 1855 args[8].f = a8;
michael@0 1856 args[9].f = a9;
michael@0 1857 args[10].f = a10;
michael@0 1858 args[11].f = a11;
michael@0 1859 args[12].f = a12;
michael@0 1860
michael@0 1861 Init(env->NewObjectA(mImmutableViewportMetricsClass, jImmutableViewportMetrics, args), env);
michael@0 1862 env->PopLocalFrame(nullptr);
michael@0 1863 }
michael@0 1864 jclass LayerView::mLayerViewClass = 0;
michael@0 1865 jmethodID LayerView::jRegisterCompositorWrapper = 0;
michael@0 1866 void LayerView::InitStubs(JNIEnv *jEnv) {
michael@0 1867 initInit();
michael@0 1868
michael@0 1869 mLayerViewClass = getClassGlobalRef("org/mozilla/gecko/gfx/LayerView");
michael@0 1870 jRegisterCompositorWrapper = getStaticMethod("registerCxxCompositor", "()Lorg/mozilla/gecko/gfx/GLController;");
michael@0 1871 }
michael@0 1872
michael@0 1873 LayerView* LayerView::Wrap(jobject obj) {
michael@0 1874 JNIEnv *env = GetJNIForThread();
michael@0 1875 LayerView* ret = new LayerView(obj, env);
michael@0 1876 env->DeleteLocalRef(obj);
michael@0 1877 return ret;
michael@0 1878 }
michael@0 1879
michael@0 1880 jobject LayerView::RegisterCompositorWrapper() {
michael@0 1881 JNIEnv *env = GetJNIForThread();
michael@0 1882 if (env->PushLocalFrame(1) != 0) {
michael@0 1883 AndroidBridge::HandleUncaughtException(env);
michael@0 1884 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1885 }
michael@0 1886
michael@0 1887 jobject temp = env->CallStaticObjectMethod(mLayerViewClass, jRegisterCompositorWrapper);
michael@0 1888 AndroidBridge::HandleUncaughtException(env);
michael@0 1889 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 1890 return ret;
michael@0 1891 }
michael@0 1892 jclass NativePanZoomController::mNativePanZoomControllerClass = 0;
michael@0 1893 jmethodID NativePanZoomController::jPostDelayedCallbackWrapper = 0;
michael@0 1894 jmethodID NativePanZoomController::jRequestContentRepaintWrapper = 0;
michael@0 1895 void NativePanZoomController::InitStubs(JNIEnv *jEnv) {
michael@0 1896 initInit();
michael@0 1897
michael@0 1898 mNativePanZoomControllerClass = getClassGlobalRef("org/mozilla/gecko/gfx/NativePanZoomController");
michael@0 1899 jPostDelayedCallbackWrapper = getMethod("postDelayedCallback", "(J)V");
michael@0 1900 jRequestContentRepaintWrapper = getMethod("requestContentRepaint", "(FFFFF)V");
michael@0 1901 }
michael@0 1902
michael@0 1903 NativePanZoomController* NativePanZoomController::Wrap(jobject obj) {
michael@0 1904 JNIEnv *env = GetJNIForThread();
michael@0 1905 NativePanZoomController* ret = new NativePanZoomController(obj, env);
michael@0 1906 env->DeleteLocalRef(obj);
michael@0 1907 return ret;
michael@0 1908 }
michael@0 1909
michael@0 1910 void NativePanZoomController::PostDelayedCallbackWrapper(int64_t a0) {
michael@0 1911 JNIEnv *env = GetJNIForThread();
michael@0 1912 if (env->PushLocalFrame(0) != 0) {
michael@0 1913 AndroidBridge::HandleUncaughtException(env);
michael@0 1914 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1915 }
michael@0 1916
michael@0 1917 env->CallVoidMethod(wrapped_obj, jPostDelayedCallbackWrapper, a0);
michael@0 1918 AndroidBridge::HandleUncaughtException(env);
michael@0 1919 env->PopLocalFrame(nullptr);
michael@0 1920 }
michael@0 1921
michael@0 1922 void NativePanZoomController::RequestContentRepaintWrapper(jfloat a0, jfloat a1, jfloat a2, jfloat a3, jfloat a4) {
michael@0 1923 JNIEnv *env = GetJNIForThread();
michael@0 1924 if (env->PushLocalFrame(0) != 0) {
michael@0 1925 AndroidBridge::HandleUncaughtException(env);
michael@0 1926 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1927 }
michael@0 1928
michael@0 1929 jvalue args[5];
michael@0 1930 args[0].f = a0;
michael@0 1931 args[1].f = a1;
michael@0 1932 args[2].f = a2;
michael@0 1933 args[3].f = a3;
michael@0 1934 args[4].f = a4;
michael@0 1935
michael@0 1936 env->CallVoidMethodA(wrapped_obj, jRequestContentRepaintWrapper, args);
michael@0 1937 AndroidBridge::HandleUncaughtException(env);
michael@0 1938 env->PopLocalFrame(nullptr);
michael@0 1939 }
michael@0 1940 jclass ProgressiveUpdateData::mProgressiveUpdateDataClass = 0;
michael@0 1941 jmethodID ProgressiveUpdateData::jProgressiveUpdateData = 0;
michael@0 1942 jmethodID ProgressiveUpdateData::jsetViewport = 0;
michael@0 1943 jfieldID ProgressiveUpdateData::jabort = 0;
michael@0 1944 jfieldID ProgressiveUpdateData::jheight = 0;
michael@0 1945 jfieldID ProgressiveUpdateData::jscale = 0;
michael@0 1946 jfieldID ProgressiveUpdateData::jwidth = 0;
michael@0 1947 jfieldID ProgressiveUpdateData::jx = 0;
michael@0 1948 jfieldID ProgressiveUpdateData::jy = 0;
michael@0 1949 void ProgressiveUpdateData::InitStubs(JNIEnv *jEnv) {
michael@0 1950 initInit();
michael@0 1951
michael@0 1952 mProgressiveUpdateDataClass = getClassGlobalRef("org/mozilla/gecko/gfx/ProgressiveUpdateData");
michael@0 1953 jProgressiveUpdateData = getMethod("<init>", "()V");
michael@0 1954 jsetViewport = getMethod("setViewport", "(Lorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)V");
michael@0 1955 jabort = getField("abort", "Z");
michael@0 1956 jheight = getField("height", "F");
michael@0 1957 jscale = getField("scale", "F");
michael@0 1958 jwidth = getField("width", "F");
michael@0 1959 jx = getField("x", "F");
michael@0 1960 jy = getField("y", "F");
michael@0 1961 }
michael@0 1962
michael@0 1963 ProgressiveUpdateData* ProgressiveUpdateData::Wrap(jobject obj) {
michael@0 1964 JNIEnv *env = GetJNIForThread();
michael@0 1965 ProgressiveUpdateData* ret = new ProgressiveUpdateData(obj, env);
michael@0 1966 env->DeleteLocalRef(obj);
michael@0 1967 return ret;
michael@0 1968 }
michael@0 1969
michael@0 1970 ProgressiveUpdateData::ProgressiveUpdateData() {
michael@0 1971 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1972 if (env->PushLocalFrame(0) != 0) {
michael@0 1973 AndroidBridge::HandleUncaughtException(env);
michael@0 1974 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1975 }
michael@0 1976
michael@0 1977 Init(env->NewObject(mProgressiveUpdateDataClass, jProgressiveUpdateData), env);
michael@0 1978 env->PopLocalFrame(nullptr);
michael@0 1979 }
michael@0 1980
michael@0 1981 void ProgressiveUpdateData::setViewport(jobject a0) {
michael@0 1982 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 1983 if (env->PushLocalFrame(1) != 0) {
michael@0 1984 AndroidBridge::HandleUncaughtException(env);
michael@0 1985 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 1986 }
michael@0 1987
michael@0 1988 env->CallVoidMethod(wrapped_obj, jsetViewport, a0);
michael@0 1989 AndroidBridge::HandleUncaughtException(env);
michael@0 1990 env->PopLocalFrame(nullptr);
michael@0 1991 }
michael@0 1992
michael@0 1993 bool ProgressiveUpdateData::getabort() {
michael@0 1994 JNIEnv *env = GetJNIForThread();
michael@0 1995 return env->GetBooleanField(wrapped_obj, jabort);
michael@0 1996 }
michael@0 1997
michael@0 1998 void ProgressiveUpdateData::setabort(bool a0) {
michael@0 1999 JNIEnv *env = GetJNIForThread();
michael@0 2000 env->SetBooleanField(wrapped_obj, jabort, a0);
michael@0 2001 }
michael@0 2002
michael@0 2003 jfloat ProgressiveUpdateData::getheight() {
michael@0 2004 JNIEnv *env = GetJNIForThread();
michael@0 2005 return env->GetFloatField(wrapped_obj, jheight);
michael@0 2006 }
michael@0 2007
michael@0 2008 void ProgressiveUpdateData::setheight(jfloat a0) {
michael@0 2009 JNIEnv *env = GetJNIForThread();
michael@0 2010 env->SetFloatField(wrapped_obj, jheight, a0);
michael@0 2011 }
michael@0 2012
michael@0 2013 jfloat ProgressiveUpdateData::getscale() {
michael@0 2014 JNIEnv *env = GetJNIForThread();
michael@0 2015 return env->GetFloatField(wrapped_obj, jscale);
michael@0 2016 }
michael@0 2017
michael@0 2018 void ProgressiveUpdateData::setscale(jfloat a0) {
michael@0 2019 JNIEnv *env = GetJNIForThread();
michael@0 2020 env->SetFloatField(wrapped_obj, jscale, a0);
michael@0 2021 }
michael@0 2022
michael@0 2023 jfloat ProgressiveUpdateData::getwidth() {
michael@0 2024 JNIEnv *env = GetJNIForThread();
michael@0 2025 return env->GetFloatField(wrapped_obj, jwidth);
michael@0 2026 }
michael@0 2027
michael@0 2028 void ProgressiveUpdateData::setwidth(jfloat a0) {
michael@0 2029 JNIEnv *env = GetJNIForThread();
michael@0 2030 env->SetFloatField(wrapped_obj, jwidth, a0);
michael@0 2031 }
michael@0 2032
michael@0 2033 jfloat ProgressiveUpdateData::getx() {
michael@0 2034 JNIEnv *env = GetJNIForThread();
michael@0 2035 return env->GetFloatField(wrapped_obj, jx);
michael@0 2036 }
michael@0 2037
michael@0 2038 void ProgressiveUpdateData::setx(jfloat a0) {
michael@0 2039 JNIEnv *env = GetJNIForThread();
michael@0 2040 env->SetFloatField(wrapped_obj, jx, a0);
michael@0 2041 }
michael@0 2042
michael@0 2043 jfloat ProgressiveUpdateData::gety() {
michael@0 2044 JNIEnv *env = GetJNIForThread();
michael@0 2045 return env->GetFloatField(wrapped_obj, jy);
michael@0 2046 }
michael@0 2047
michael@0 2048 void ProgressiveUpdateData::sety(jfloat a0) {
michael@0 2049 JNIEnv *env = GetJNIForThread();
michael@0 2050 env->SetFloatField(wrapped_obj, jy, a0);
michael@0 2051 }
michael@0 2052 jclass ViewTransform::mViewTransformClass = 0;
michael@0 2053 jmethodID ViewTransform::jViewTransform = 0;
michael@0 2054 jfieldID ViewTransform::jfixedLayerMarginBottom = 0;
michael@0 2055 jfieldID ViewTransform::jfixedLayerMarginLeft = 0;
michael@0 2056 jfieldID ViewTransform::jfixedLayerMarginRight = 0;
michael@0 2057 jfieldID ViewTransform::jfixedLayerMarginTop = 0;
michael@0 2058 jfieldID ViewTransform::joffsetX = 0;
michael@0 2059 jfieldID ViewTransform::joffsetY = 0;
michael@0 2060 jfieldID ViewTransform::jscale = 0;
michael@0 2061 jfieldID ViewTransform::jx = 0;
michael@0 2062 jfieldID ViewTransform::jy = 0;
michael@0 2063 void ViewTransform::InitStubs(JNIEnv *jEnv) {
michael@0 2064 initInit();
michael@0 2065
michael@0 2066 mViewTransformClass = getClassGlobalRef("org/mozilla/gecko/gfx/ViewTransform");
michael@0 2067 jViewTransform = getMethod("<init>", "(FFF)V");
michael@0 2068 jfixedLayerMarginBottom = getField("fixedLayerMarginBottom", "F");
michael@0 2069 jfixedLayerMarginLeft = getField("fixedLayerMarginLeft", "F");
michael@0 2070 jfixedLayerMarginRight = getField("fixedLayerMarginRight", "F");
michael@0 2071 jfixedLayerMarginTop = getField("fixedLayerMarginTop", "F");
michael@0 2072 joffsetX = getField("offsetX", "F");
michael@0 2073 joffsetY = getField("offsetY", "F");
michael@0 2074 jscale = getField("scale", "F");
michael@0 2075 jx = getField("x", "F");
michael@0 2076 jy = getField("y", "F");
michael@0 2077 }
michael@0 2078
michael@0 2079 ViewTransform* ViewTransform::Wrap(jobject obj) {
michael@0 2080 JNIEnv *env = GetJNIForThread();
michael@0 2081 ViewTransform* ret = new ViewTransform(obj, env);
michael@0 2082 env->DeleteLocalRef(obj);
michael@0 2083 return ret;
michael@0 2084 }
michael@0 2085
michael@0 2086 ViewTransform::ViewTransform(jfloat a0, jfloat a1, jfloat a2) {
michael@0 2087 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2088 if (env->PushLocalFrame(0) != 0) {
michael@0 2089 AndroidBridge::HandleUncaughtException(env);
michael@0 2090 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2091 }
michael@0 2092
michael@0 2093 jvalue args[3];
michael@0 2094 args[0].f = a0;
michael@0 2095 args[1].f = a1;
michael@0 2096 args[2].f = a2;
michael@0 2097
michael@0 2098 Init(env->NewObjectA(mViewTransformClass, jViewTransform, args), env);
michael@0 2099 env->PopLocalFrame(nullptr);
michael@0 2100 }
michael@0 2101
michael@0 2102 jfloat ViewTransform::getfixedLayerMarginBottom() {
michael@0 2103 JNIEnv *env = GetJNIForThread();
michael@0 2104 return env->GetFloatField(wrapped_obj, jfixedLayerMarginBottom);
michael@0 2105 }
michael@0 2106
michael@0 2107 void ViewTransform::setfixedLayerMarginBottom(jfloat a0) {
michael@0 2108 JNIEnv *env = GetJNIForThread();
michael@0 2109 env->SetFloatField(wrapped_obj, jfixedLayerMarginBottom, a0);
michael@0 2110 }
michael@0 2111
michael@0 2112 jfloat ViewTransform::getfixedLayerMarginLeft() {
michael@0 2113 JNIEnv *env = GetJNIForThread();
michael@0 2114 return env->GetFloatField(wrapped_obj, jfixedLayerMarginLeft);
michael@0 2115 }
michael@0 2116
michael@0 2117 void ViewTransform::setfixedLayerMarginLeft(jfloat a0) {
michael@0 2118 JNIEnv *env = GetJNIForThread();
michael@0 2119 env->SetFloatField(wrapped_obj, jfixedLayerMarginLeft, a0);
michael@0 2120 }
michael@0 2121
michael@0 2122 jfloat ViewTransform::getfixedLayerMarginRight() {
michael@0 2123 JNIEnv *env = GetJNIForThread();
michael@0 2124 return env->GetFloatField(wrapped_obj, jfixedLayerMarginRight);
michael@0 2125 }
michael@0 2126
michael@0 2127 void ViewTransform::setfixedLayerMarginRight(jfloat a0) {
michael@0 2128 JNIEnv *env = GetJNIForThread();
michael@0 2129 env->SetFloatField(wrapped_obj, jfixedLayerMarginRight, a0);
michael@0 2130 }
michael@0 2131
michael@0 2132 jfloat ViewTransform::getfixedLayerMarginTop() {
michael@0 2133 JNIEnv *env = GetJNIForThread();
michael@0 2134 return env->GetFloatField(wrapped_obj, jfixedLayerMarginTop);
michael@0 2135 }
michael@0 2136
michael@0 2137 void ViewTransform::setfixedLayerMarginTop(jfloat a0) {
michael@0 2138 JNIEnv *env = GetJNIForThread();
michael@0 2139 env->SetFloatField(wrapped_obj, jfixedLayerMarginTop, a0);
michael@0 2140 }
michael@0 2141
michael@0 2142 jfloat ViewTransform::getoffsetX() {
michael@0 2143 JNIEnv *env = GetJNIForThread();
michael@0 2144 return env->GetFloatField(wrapped_obj, joffsetX);
michael@0 2145 }
michael@0 2146
michael@0 2147 void ViewTransform::setoffsetX(jfloat a0) {
michael@0 2148 JNIEnv *env = GetJNIForThread();
michael@0 2149 env->SetFloatField(wrapped_obj, joffsetX, a0);
michael@0 2150 }
michael@0 2151
michael@0 2152 jfloat ViewTransform::getoffsetY() {
michael@0 2153 JNIEnv *env = GetJNIForThread();
michael@0 2154 return env->GetFloatField(wrapped_obj, joffsetY);
michael@0 2155 }
michael@0 2156
michael@0 2157 void ViewTransform::setoffsetY(jfloat a0) {
michael@0 2158 JNIEnv *env = GetJNIForThread();
michael@0 2159 env->SetFloatField(wrapped_obj, joffsetY, a0);
michael@0 2160 }
michael@0 2161
michael@0 2162 jfloat ViewTransform::getscale() {
michael@0 2163 JNIEnv *env = GetJNIForThread();
michael@0 2164 return env->GetFloatField(wrapped_obj, jscale);
michael@0 2165 }
michael@0 2166
michael@0 2167 void ViewTransform::setscale(jfloat a0) {
michael@0 2168 JNIEnv *env = GetJNIForThread();
michael@0 2169 env->SetFloatField(wrapped_obj, jscale, a0);
michael@0 2170 }
michael@0 2171
michael@0 2172 jfloat ViewTransform::getx() {
michael@0 2173 JNIEnv *env = GetJNIForThread();
michael@0 2174 return env->GetFloatField(wrapped_obj, jx);
michael@0 2175 }
michael@0 2176
michael@0 2177 void ViewTransform::setx(jfloat a0) {
michael@0 2178 JNIEnv *env = GetJNIForThread();
michael@0 2179 env->SetFloatField(wrapped_obj, jx, a0);
michael@0 2180 }
michael@0 2181
michael@0 2182 jfloat ViewTransform::gety() {
michael@0 2183 JNIEnv *env = GetJNIForThread();
michael@0 2184 return env->GetFloatField(wrapped_obj, jy);
michael@0 2185 }
michael@0 2186
michael@0 2187 void ViewTransform::sety(jfloat a0) {
michael@0 2188 JNIEnv *env = GetJNIForThread();
michael@0 2189 env->SetFloatField(wrapped_obj, jy, a0);
michael@0 2190 }
michael@0 2191 jclass NativeZip::mNativeZipClass = 0;
michael@0 2192 jmethodID NativeZip::jCreateInputStream = 0;
michael@0 2193 void NativeZip::InitStubs(JNIEnv *jEnv) {
michael@0 2194 initInit();
michael@0 2195
michael@0 2196 mNativeZipClass = getClassGlobalRef("org/mozilla/gecko/mozglue/NativeZip");
michael@0 2197 jCreateInputStream = getMethod("createInputStream", "(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;");
michael@0 2198 }
michael@0 2199
michael@0 2200 NativeZip* NativeZip::Wrap(jobject obj) {
michael@0 2201 JNIEnv *env = GetJNIForThread();
michael@0 2202 NativeZip* ret = new NativeZip(obj, env);
michael@0 2203 env->DeleteLocalRef(obj);
michael@0 2204 return ret;
michael@0 2205 }
michael@0 2206
michael@0 2207 jobject NativeZip::CreateInputStream(jobject a0, int32_t a1) {
michael@0 2208 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2209 if (env->PushLocalFrame(2) != 0) {
michael@0 2210 AndroidBridge::HandleUncaughtException(env);
michael@0 2211 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2212 }
michael@0 2213
michael@0 2214 jobject temp = env->CallObjectMethod(wrapped_obj, jCreateInputStream, a0, a1);
michael@0 2215 AndroidBridge::HandleUncaughtException(env);
michael@0 2216 jobject ret = static_cast<jobject>(env->PopLocalFrame(temp));
michael@0 2217 return ret;
michael@0 2218 }
michael@0 2219 jclass MatrixBlobCursor::mMatrixBlobCursorClass = 0;
michael@0 2220 jmethodID MatrixBlobCursor::jMatrixBlobCursor = 0;
michael@0 2221 jmethodID MatrixBlobCursor::jMatrixBlobCursor0 = 0;
michael@0 2222 jmethodID MatrixBlobCursor::jAddRow = 0;
michael@0 2223 jmethodID MatrixBlobCursor::jAddRow1 = 0;
michael@0 2224 jmethodID MatrixBlobCursor::jAddRow2 = 0;
michael@0 2225 void MatrixBlobCursor::InitStubs(JNIEnv *jEnv) {
michael@0 2226 initInit();
michael@0 2227
michael@0 2228 mMatrixBlobCursorClass = getClassGlobalRef("org/mozilla/gecko/sqlite/MatrixBlobCursor");
michael@0 2229 jMatrixBlobCursor = getMethod("<init>", "([Ljava/lang/String;)V");
michael@0 2230 jMatrixBlobCursor0 = getMethod("<init>", "([Ljava/lang/String;I)V");
michael@0 2231 jAddRow = getMethod("addRow", "(Ljava/lang/Iterable;)V");
michael@0 2232 jAddRow1 = getMethod("addRow", "(Ljava/util/ArrayList;I)V");
michael@0 2233 jAddRow2 = getMethod("addRow", "([Ljava/lang/Object;)V");
michael@0 2234 }
michael@0 2235
michael@0 2236 MatrixBlobCursor* MatrixBlobCursor::Wrap(jobject obj) {
michael@0 2237 JNIEnv *env = GetJNIForThread();
michael@0 2238 MatrixBlobCursor* ret = new MatrixBlobCursor(obj, env);
michael@0 2239 env->DeleteLocalRef(obj);
michael@0 2240 return ret;
michael@0 2241 }
michael@0 2242
michael@0 2243 MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0) {
michael@0 2244 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2245 if (env->PushLocalFrame(1) != 0) {
michael@0 2246 AndroidBridge::HandleUncaughtException(env);
michael@0 2247 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2248 }
michael@0 2249
michael@0 2250 Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor, a0), env);
michael@0 2251 env->PopLocalFrame(nullptr);
michael@0 2252 }
michael@0 2253
michael@0 2254 MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0, int32_t a1) {
michael@0 2255 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2256 if (env->PushLocalFrame(1) != 0) {
michael@0 2257 AndroidBridge::HandleUncaughtException(env);
michael@0 2258 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2259 }
michael@0 2260
michael@0 2261 Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor0, a0, a1), env);
michael@0 2262 env->PopLocalFrame(nullptr);
michael@0 2263 }
michael@0 2264
michael@0 2265 void MatrixBlobCursor::AddRow(jobject a0) {
michael@0 2266 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2267 if (env->PushLocalFrame(1) != 0) {
michael@0 2268 AndroidBridge::HandleUncaughtException(env);
michael@0 2269 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2270 }
michael@0 2271
michael@0 2272 env->CallVoidMethod(wrapped_obj, jAddRow, a0);
michael@0 2273 AndroidBridge::HandleUncaughtException(env);
michael@0 2274 env->PopLocalFrame(nullptr);
michael@0 2275 }
michael@0 2276
michael@0 2277 void MatrixBlobCursor::AddRow(jobject a0, int32_t a1) {
michael@0 2278 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2279 if (env->PushLocalFrame(1) != 0) {
michael@0 2280 AndroidBridge::HandleUncaughtException(env);
michael@0 2281 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2282 }
michael@0 2283
michael@0 2284 env->CallVoidMethod(wrapped_obj, jAddRow1, a0, a1);
michael@0 2285 AndroidBridge::HandleUncaughtException(env);
michael@0 2286 env->PopLocalFrame(nullptr);
michael@0 2287 }
michael@0 2288
michael@0 2289 void MatrixBlobCursor::AddRow(jobjectArray a0) {
michael@0 2290 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2291 if (env->PushLocalFrame(1) != 0) {
michael@0 2292 AndroidBridge::HandleUncaughtException(env);
michael@0 2293 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2294 }
michael@0 2295
michael@0 2296 env->CallVoidMethod(wrapped_obj, jAddRow2, a0);
michael@0 2297 AndroidBridge::HandleUncaughtException(env);
michael@0 2298 env->PopLocalFrame(nullptr);
michael@0 2299 }
michael@0 2300 jclass SQLiteBridgeException::mSQLiteBridgeExceptionClass = 0;
michael@0 2301 jmethodID SQLiteBridgeException::jSQLiteBridgeException = 0;
michael@0 2302 jmethodID SQLiteBridgeException::jSQLiteBridgeException0 = 0;
michael@0 2303 jfieldID SQLiteBridgeException::jserialVersionUID = 0;
michael@0 2304 void SQLiteBridgeException::InitStubs(JNIEnv *jEnv) {
michael@0 2305 initInit();
michael@0 2306
michael@0 2307 mSQLiteBridgeExceptionClass = getClassGlobalRef("org/mozilla/gecko/sqlite/SQLiteBridgeException");
michael@0 2308 jSQLiteBridgeException = getMethod("<init>", "()V");
michael@0 2309 jSQLiteBridgeException0 = getMethod("<init>", "(Ljava/lang/String;)V");
michael@0 2310 jserialVersionUID = getStaticField("serialVersionUID", "J");
michael@0 2311 }
michael@0 2312
michael@0 2313 SQLiteBridgeException* SQLiteBridgeException::Wrap(jobject obj) {
michael@0 2314 JNIEnv *env = GetJNIForThread();
michael@0 2315 SQLiteBridgeException* ret = new SQLiteBridgeException(obj, env);
michael@0 2316 env->DeleteLocalRef(obj);
michael@0 2317 return ret;
michael@0 2318 }
michael@0 2319
michael@0 2320 SQLiteBridgeException::SQLiteBridgeException() {
michael@0 2321 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2322 if (env->PushLocalFrame(0) != 0) {
michael@0 2323 AndroidBridge::HandleUncaughtException(env);
michael@0 2324 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2325 }
michael@0 2326
michael@0 2327 Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException), env);
michael@0 2328 env->PopLocalFrame(nullptr);
michael@0 2329 }
michael@0 2330
michael@0 2331 SQLiteBridgeException::SQLiteBridgeException(const nsAString& a0) {
michael@0 2332 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2333 if (env->PushLocalFrame(1) != 0) {
michael@0 2334 AndroidBridge::HandleUncaughtException(env);
michael@0 2335 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2336 }
michael@0 2337
michael@0 2338 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 2339
michael@0 2340 Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException0, j0), env);
michael@0 2341 env->PopLocalFrame(nullptr);
michael@0 2342 }
michael@0 2343
michael@0 2344 int64_t SQLiteBridgeException::getserialVersionUID() {
michael@0 2345 JNIEnv *env = GetJNIForThread();
michael@0 2346 return env->GetStaticLongField(mSQLiteBridgeExceptionClass, jserialVersionUID);
michael@0 2347 }
michael@0 2348 jclass Clipboard::mClipboardClass = 0;
michael@0 2349 jmethodID Clipboard::jClearText = 0;
michael@0 2350 jmethodID Clipboard::jGetClipboardTextWrapper = 0;
michael@0 2351 jmethodID Clipboard::jHasText = 0;
michael@0 2352 jmethodID Clipboard::jSetClipboardText = 0;
michael@0 2353 void Clipboard::InitStubs(JNIEnv *jEnv) {
michael@0 2354 initInit();
michael@0 2355
michael@0 2356 mClipboardClass = getClassGlobalRef("org/mozilla/gecko/util/Clipboard");
michael@0 2357 jClearText = getStaticMethod("clearText", "()V");
michael@0 2358 jGetClipboardTextWrapper = getStaticMethod("getText", "()Ljava/lang/String;");
michael@0 2359 jHasText = getStaticMethod("hasText", "()Z");
michael@0 2360 jSetClipboardText = getStaticMethod("setText", "(Ljava/lang/CharSequence;)V");
michael@0 2361 }
michael@0 2362
michael@0 2363 Clipboard* Clipboard::Wrap(jobject obj) {
michael@0 2364 JNIEnv *env = GetJNIForThread();
michael@0 2365 Clipboard* ret = new Clipboard(obj, env);
michael@0 2366 env->DeleteLocalRef(obj);
michael@0 2367 return ret;
michael@0 2368 }
michael@0 2369
michael@0 2370 void Clipboard::ClearText() {
michael@0 2371 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2372 if (env->PushLocalFrame(0) != 0) {
michael@0 2373 AndroidBridge::HandleUncaughtException(env);
michael@0 2374 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2375 }
michael@0 2376
michael@0 2377 env->CallStaticVoidMethod(mClipboardClass, jClearText);
michael@0 2378 AndroidBridge::HandleUncaughtException(env);
michael@0 2379 env->PopLocalFrame(nullptr);
michael@0 2380 }
michael@0 2381
michael@0 2382 jstring Clipboard::GetClipboardTextWrapper() {
michael@0 2383 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2384 if (env->PushLocalFrame(1) != 0) {
michael@0 2385 AndroidBridge::HandleUncaughtException(env);
michael@0 2386 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2387 }
michael@0 2388
michael@0 2389 jobject temp = env->CallStaticObjectMethod(mClipboardClass, jGetClipboardTextWrapper);
michael@0 2390 AndroidBridge::HandleUncaughtException(env);
michael@0 2391 jstring ret = static_cast<jstring>(env->PopLocalFrame(temp));
michael@0 2392 return ret;
michael@0 2393 }
michael@0 2394
michael@0 2395 bool Clipboard::HasText() {
michael@0 2396 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2397 if (env->PushLocalFrame(0) != 0) {
michael@0 2398 AndroidBridge::HandleUncaughtException(env);
michael@0 2399 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2400 }
michael@0 2401
michael@0 2402 bool temp = env->CallStaticBooleanMethod(mClipboardClass, jHasText);
michael@0 2403 AndroidBridge::HandleUncaughtException(env);
michael@0 2404 env->PopLocalFrame(nullptr);
michael@0 2405 return temp;
michael@0 2406 }
michael@0 2407
michael@0 2408 void Clipboard::SetClipboardText(const nsAString& a0) {
michael@0 2409 JNIEnv *env = AndroidBridge::GetJNIEnv();
michael@0 2410 if (env->PushLocalFrame(1) != 0) {
michael@0 2411 AndroidBridge::HandleUncaughtException(env);
michael@0 2412 MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
michael@0 2413 }
michael@0 2414
michael@0 2415 jstring j0 = AndroidBridge::NewJavaString(env, a0);
michael@0 2416
michael@0 2417 env->CallStaticVoidMethod(mClipboardClass, jSetClipboardText, j0);
michael@0 2418 AndroidBridge::HandleUncaughtException(env);
michael@0 2419 env->PopLocalFrame(nullptr);
michael@0 2420 }
michael@0 2421
michael@0 2422 void InitStubs(JNIEnv *jEnv) {
michael@0 2423 GeckoAppShell::InitStubs(jEnv);
michael@0 2424 JavaDomKeyLocation::InitStubs(jEnv);
michael@0 2425 GeckoJavaSampler::InitStubs(jEnv);
michael@0 2426 SurfaceBits::InitStubs(jEnv);
michael@0 2427 ThumbnailHelper::InitStubs(jEnv);
michael@0 2428 DisplayPortMetrics::InitStubs(jEnv);
michael@0 2429 GLController::InitStubs(jEnv);
michael@0 2430 GeckoLayerClient::InitStubs(jEnv);
michael@0 2431 ImmutableViewportMetrics::InitStubs(jEnv);
michael@0 2432 LayerView::InitStubs(jEnv);
michael@0 2433 NativePanZoomController::InitStubs(jEnv);
michael@0 2434 ProgressiveUpdateData::InitStubs(jEnv);
michael@0 2435 ViewTransform::InitStubs(jEnv);
michael@0 2436 NativeZip::InitStubs(jEnv);
michael@0 2437 MatrixBlobCursor::InitStubs(jEnv);
michael@0 2438 SQLiteBridgeException::InitStubs(jEnv);
michael@0 2439 Clipboard::InitStubs(jEnv);
michael@0 2440 }
michael@0 2441 } /* android */
michael@0 2442 } /* widget */
michael@0 2443 } /* mozilla */

mercurial