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

Issue 9817013: Explicitly release JNI local references in the Java Bridge (Closed)

Created:
8 years, 9 months ago by Steve Block
Modified:
8 years, 9 months ago
Reviewers:
joth
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Explicitly release JNI local references in the Java Bridge In order to pass arguments to the methods of injected Java objects, the Java Bridge converts JavaScript values to Java values. This involves creating JNI jvalue objects, which may contain new local references to strings, objects and arrays. Currently, these local references are not explicitly released, so the VM may run out of JNI local references. This change addresses this by explicitly releasing these local references as soon as we're done with them. BUG=112819 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=128206

Patch Set 1 #

Total comments: 4

Patch Set 2 : Factor out ReleaseJavaValueIfRequired #

Total comments: 1

Patch Set 3 : Fix style nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -10 lines) Patch
M content/browser/renderer_host/java/java_bound_object.cc View 1 2 6 chunks +41 lines, -10 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Steve Block
8 years, 9 months ago (2012-03-21 19:48:40 UTC) #1
joth
Good find! LGTM. couple minor suggestions. http://codereview.chromium.org/9817013/diff/1/content/browser/renderer_host/java/java_bound_object.cc File content/browser/renderer_host/java/java_bound_object.cc (right): http://codereview.chromium.org/9817013/diff/1/content/browser/renderer_host/java/java_bound_object.cc#newcode529 content/browser/renderer_host/java/java_bound_object.cc:529: AttachCurrentThread()->DeleteLocalRef(element.l); nit: Grab ...
8 years, 9 months ago (2012-03-22 12:42:12 UTC) #2
Steve Block
http://codereview.chromium.org/9817013/diff/1/content/browser/renderer_host/java/java_bound_object.cc File content/browser/renderer_host/java/java_bound_object.cc (right): http://codereview.chromium.org/9817013/diff/1/content/browser/renderer_host/java/java_bound_object.cc#newcode529 content/browser/renderer_host/java/java_bound_object.cc:529: AttachCurrentThread()->DeleteLocalRef(element.l); On 2012/03/22 12:42:12, joth wrote: > nit: Grab ...
8 years, 9 months ago (2012-03-22 13:03:23 UTC) #3
joth
8 years, 9 months ago (2012-03-22 13:20:48 UTC) #4
lgtm

http://codereview.chromium.org/9817013/diff/4001/content/browser/renderer_hos...
File content/browser/renderer_host/java/java_bound_object.cc (right):

http://codereview.chromium.org/9817013/diff/4001/content/browser/renderer_hos...
content/browser/renderer_host/java/java_bound_object.cc:460: void
ReleaseJavaValueIfRequired(JNIEnv* env, jvalue* value,
nit: one param per line.
(if you want, you could group value & type together as they are very closely
coupled)

Powered by Google App Engine
This is Rietveld 408576698