RESOLVED FIXED 32157
[Android] jni_utility includes two JSC-specific functions
https://bugs.webkit.org/show_bug.cgi?id=32157
Summary [Android] jni_utility includes two JSC-specific functions
Steve Block
Reported 2009-12-04 06:56:51 PST
jni_utility mostly provides a number of script-engine-independent helper functions. In addition it provides two JSC-specific functions - convertValueToJValue and dispatchJNICall. This causes problems on Android, where we can build with JSC or V8. See Bug 32154, which this bug blocks. It seems that jni_utility should provide only the script-engine-independent functions. The two JSC-specific functions it currently provides are only used within bridge/jni, so should be moved to a separate, private header. Perhaps jni_utility_private? The V8-specific equivalents to these functions, which are required by Android, can then be added to this file with the necessary guards, or the file can be split into two. Perhaps [jsc|v8]/jni_utility_private? Note that code in other files in bridge/jni will also require separation into JSC and V8 variants. Given this, splitting the files into two directories seems the cleanest choice.
Attachments
Patch 1 for Bug 32157 (26.52 KB, patch)
2009-12-04 08:02 PST, Steve Block
no flags
Patch 2 for Bug 32157 (26.57 KB, patch)
2009-12-04 08:42 PST, Steve Block
no flags
Patch 3 for Bug 32157 (31.95 KB, patch)
2009-12-04 09:40 PST, Steve Block
abarth: review+
steveblock: commit-queue-
Steve Block
Comment 1 2009-12-04 08:02:09 PST
WebKit Review Bot
Comment 2 2009-12-04 08:05:32 PST
Attachment 44314 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebCore/bridge/jni/jsc/jni_utility_private.cpp:44: Declaration has space between type name and * in JNIEnv *env [whitespace/declaration] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:53: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:55: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:59: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:62: Missing space after , [whitespace/comma] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:71: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:81: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:91: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:104: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:114: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:124: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:134: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:144: Missing space before ( in for( [whitespace/parens] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:162: _JNIType is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:169: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:168: Missing space before { [whitespace/braces] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:174: Missing space before { [whitespace/braces] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:178: Declaration has space between type name and * in JavaInstance *instance [whitespace/declaration] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:182: An else should appear on the same line as the preceding } [whitespace/newline] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:185: Declaration has space between type name and * in JavaArray *array [whitespace/declaration] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:188: An else should appear on the same line as the preceding } [whitespace/newline] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:196: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:199: Declaration has space between type name and * in JNIEnv *env [whitespace/declaration] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:201: Extra space before ( in function call [whitespace/parens] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:204: An else should appear on the same line as the preceding } [whitespace/newline] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:210: Declaration has space between type name and * in JNIEnv *env [whitespace/declaration] [3] WebCore/bridge/jni/jsc/jni_utility_private.cpp:211: Extra space before ( in function call [whitespace/parens] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:214: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] WebCore/bridge/jni/jsc/jni_utility_private.cpp:215: Extra space before ( in function call [whitespace/parens] [4] WebCore/bridge/jni/jsc/jni_utility_private.cpp:264: Extra space before ( in function call [whitespace/parens] [4] WebCore/bridge/jni/jsc/jni_utility_private.h:35: Missing space before { [whitespace/braces] [5] Total errors found: 31
Steve Block
Comment 3 2009-12-04 08:42:21 PST
Created attachment 44317 [details] Patch 2 for Bug 32157 Fixed style
WebKit Review Bot
Comment 4 2009-12-04 08:46:40 PST
style-queue ran check-webkit-style on attachment 44317 [details] without any errors.
Steve Block
Comment 5 2009-12-04 09:40:02 PST
WebKit Review Bot
Comment 6 2009-12-04 09:43:29 PST
style-queue ran check-webkit-style on attachment 44321 [details] without any errors.
Eric Seidel (no email)
Comment 7 2009-12-04 14:45:26 PST
OMG, the style bot is out of control! :p
Adam Barth
Comment 8 2009-12-04 17:50:25 PST
We can truncate the messages sooner, if that would be helpful, but it seems useful to give the full report in this case since Steve addressed all the issues.
Adam Barth
Comment 9 2009-12-04 17:52:34 PST
Comment on attachment 44321 [details] Patch 3 for Bug 32157 I don't know much about JNI, but this patch appears formally correct (and has beautiful style).
Eric Seidel (no email)
Comment 10 2009-12-04 17:54:58 PST
The out of control comment was more about how it motivated steve to change a huge section of the file when a small change (with imperfect style) would have probably been easier to review.
Steve Block
Comment 11 2009-12-07 04:37:44 PST
Note You need to log in before you can comment on or make changes to this bug.