Some of the AutoLocalJNIFrame code usage could be more robust

RESOLVED FIXED in Firefox 14

Status

()

Firefox for Android
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: kats, Assigned: kats)

Tracking

unspecified
Firefox 15
All
Android
Points:
---

Firefox Tracking Flags

(firefox14 fixed, firefox15 fixed, blocking-fennec1.0 +)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 621634 [details] [diff] [review]
Patch

:gcp pointed out that functions like AndroidGeckoLayerClient::ActivateProgram(JNIEnv *env) don't obviously check for exceptions after the JNI invocation; the caller is expected to do this. In order to make the code more robust it is better to pass in the AutoLocalJNIFrame to these functions and do the exception check there rather than relying on the caller to do it.

The new behaviour is also consistent with some of the other functions like AndroidGeckoSurfaceView::GetSoftwareDrawBitmap.

This change is a follow-up to bug 748531 and contains no actual functional changes, just code robustification.
Attachment #621634 - Flags: review?(blassey.bugs)
Comment on attachment 621634 [details] [diff] [review]
Patch

how about adding a GetEnv() function to AutoLocalJNIFrame and replacing the JNIEnv* arguments to these functions with a  AutoLocalJNIFrame*?
Created attachment 621650 [details] [diff] [review]
Patch v2

Sounds reasonable to me. We still need to do null checks on it before using it though.
Attachment #621634 - Attachment is obsolete: true
Attachment #621634 - Flags: review?(blassey.bugs)
Attachment #621650 - Flags: review?(blassey.bugs)
Attachment #621650 - Flags: review?(blassey.bugs) → review+
Try was green: https://tbpl.mozilla.org/?tree=Try&rev=cc9d881fee80

Landed on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/3bc06857dcd2
status-firefox15: --- → fixed
Target Milestone: --- → Firefox 15

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/3bc06857dcd2
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Comment on attachment 621650 [details] [diff] [review]
Patch v2

[Approval Request Comment]
Regression caused by (bug #): 
User impact if declined: none; future patches may not apply cleanly
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): android-only, low risk
String changes made by this patch: none
Attachment #621650 - Flags: approval-mozilla-aurora?

Updated

5 years ago
blocking-fennec1.0: --- → ?
Attachment #621650 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
blocking-fennec1.0: ? → +
https://hg.mozilla.org/releases/mozilla-aurora/rev/0d31d9b53189
status-firefox14: --- → fixed
You need to log in before you can comment on or make changes to this bug.