Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 1853523002: Allowing a Java object field to be null in a new JNI helper method. (Closed)

Created:
4 years, 8 months ago by Taylor Brandstetter
Modified:
4 years, 8 months ago
Reviewers:
AlexG, pthatcher1, skvlad
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Allowing a Java object field to be null in a new JNI helper method. Java objects in the API should be allowed to be null in some cases. Specifically, a null value for maxBitrateBps in RtpParameters.java has a specific meaning and doesn't imply an error has occurred. NOTRY=True Committed: https://crrev.com/60631775fa067042b025b04f4307ea16dd6311b0 Cr-Commit-Position: refs/heads/master@{#12221}

Patch Set 1 #

Patch Set 2 : Making a separate GetNullableObjectField method. #

Patch Set 3 : Adding comment around maxBitrateBps explaining null value. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
M webrtc/api/java/jni/jni_helpers.h View 1 1 chunk +3 lines, -0 lines 4 comments Download
M webrtc/api/java/jni/jni_helpers.cc View 1 1 chunk +7 lines, -1 line 2 comments Download
M webrtc/api/java/jni/peerconnection_jni.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/api/java/src/org/webrtc/RtpParameters.java View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 26 (9 generated)
Taylor Brandstetter
PTAL.
4 years, 8 months ago (2016-03-31 21:44:48 UTC) #2
AlexG
On 2016/03/31 21:44:48, Taylor Brandstetter wrote: > PTAL. Why not change maxBitrateBps type to int ...
4 years, 8 months ago (2016-03-31 23:06:27 UTC) #3
AlexG
4 years, 8 months ago (2016-03-31 23:06:37 UTC) #4
Taylor Brandstetter
On 2016/03/31 23:06:27, AlexG wrote: > On 2016/03/31 21:44:48, Taylor Brandstetter wrote: > > PTAL. ...
4 years, 8 months ago (2016-04-01 00:45:12 UTC) #5
AlexG
On 2016/04/01 00:45:12, Taylor Brandstetter wrote: > On 2016/03/31 23:06:27, AlexG wrote: > > On ...
4 years, 8 months ago (2016-04-01 00:48:24 UTC) #6
Taylor Brandstetter
On 2016/04/01 00:48:24, AlexG wrote: > On 2016/04/01 00:45:12, Taylor Brandstetter wrote: > > On ...
4 years, 8 months ago (2016-04-01 01:01:40 UTC) #9
AlexG
On 2016/04/01 01:01:40, Taylor Brandstetter wrote: > On 2016/04/01 00:48:24, AlexG wrote: > > On ...
4 years, 8 months ago (2016-04-01 01:29:54 UTC) #10
skvlad
On 2016/04/01 01:29:54, AlexG wrote: > On 2016/04/01 01:01:40, Taylor Brandstetter wrote: > > On ...
4 years, 8 months ago (2016-04-01 01:39:00 UTC) #11
Taylor Brandstetter
> > Then may be add a separate function - GetNullableObjectField which assume that > ...
4 years, 8 months ago (2016-04-01 18:19:04 UTC) #12
AlexG
On 2016/04/01 18:19:04, Taylor Brandstetter wrote: > > > Then may be add a separate ...
4 years, 8 months ago (2016-04-01 18:38:27 UTC) #14
Taylor Brandstetter
Ok, I made the modifications based on our discussion.
4 years, 8 months ago (2016-04-01 22:11:43 UTC) #15
AlexG
lgtm
4 years, 8 months ago (2016-04-01 22:57:13 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1853523002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1853523002/40001
4 years, 8 months ago (2016-04-04 17:19:26 UTC) #20
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 8 months ago (2016-04-04 17:21:05 UTC) #22
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/60631775fa067042b025b04f4307ea16dd6311b0 Cr-Commit-Position: refs/heads/master@{#12221}
4 years, 8 months ago (2016-04-04 17:27:37 UTC) #24
pthatcher1
https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_helpers.cc File webrtc/api/java/jni/jni_helpers.cc (right): https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_helpers.cc#newcode178 webrtc/api/java/jni/jni_helpers.cc:178: CHECK_EXCEPTION(jni) << "error during GetObjectField"; Can't you replace this ...
4 years, 8 months ago (2016-04-11 19:39:29 UTC) #25
Taylor Brandstetter
4 years, 8 months ago (2016-04-11 23:13:38 UTC) #26
Message was sent while issue was closed.
https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_h...
File webrtc/api/java/jni/jni_helpers.cc (right):

https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_h...
webrtc/api/java/jni/jni_helpers.cc:178: CHECK_EXCEPTION(jni) << "error during
GetObjectField";
On 2016/04/11 19:39:29, pthatcher1 wrote:
> Can't you replace this with GetNullableObjectField?

True.

https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_h...
File webrtc/api/java/jni/jni_helpers.h (right):

https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_h...
webrtc/api/java/jni/jni_helpers.h:67: // Throws an exception if the object field
is null.
On 2016/04/11 19:39:29, pthatcher1 wrote:
> Doesn't the code actually crash?  

Oh yeah. It calls abort(). I'll make a CL to fix this comment.

https://codereview.webrtc.org/1853523002/diff/40001/webrtc/api/java/jni/jni_h...
webrtc/api/java/jni/jni_helpers.h:68: jobject GetObjectField(JNIEnv* jni,
jobject object, jfieldID id);
On 2016/04/11 19:39:29, pthatcher1 wrote:
> Can we rename this one GetNonNullObjectField to make it clear things may throw
> an exception (or crash)?

Since you, Vlad and I prefer that naming, it seems worth doing. I'll do it in
the new CL.

Powered by Google App Engine
This is Rietveld 408576698