Closed Bug 752539 Opened 7 years ago Closed 7 years ago

Some of the AutoLocalJNIFrame code usage could be more robust

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 15
Tracking Status
firefox14 --- fixed
firefox15 --- fixed
blocking-fennec1.0 --- +

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
: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*?
Attached patch Patch v2Splinter Review
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+
https://hg.mozilla.org/mozilla-central/rev/3bc06857dcd2
Status: ASSIGNED → RESOLVED
Closed: 7 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?
blocking-fennec1.0: --- → ?
Attachment #621650 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
blocking-fennec1.0: ? → +
You need to log in before you can comment on or make changes to this bug.