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

Issue 1430023005: Remove ICU usage from jni_helpers.cc. (Closed)

Created:
5 years, 1 month ago by noahric
Modified:
5 years, 1 month ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, phoglund, kjellander_chromium
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Remove ICU usage from jni_helpers.cc. JNI already has jstring<->UTF8 string conversion, so using that should save ~1mb off android binaries (ICU is *large*), probably around 300-400k after compression. BUG= Committed: https://crrev.com/23725e09c6533739afa67ca9694f6fa874c26279 Cr-Commit-Position: refs/heads/master@{#10545}

Patch Set 1 #

Patch Set 2 : Also remove ICU from build references and webrtc/examples #

Patch Set 3 : Fix copy/paste in webrtc/examples #

Patch Set 4 : Once more with feeling. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -43 lines) Patch
M talk/app/webrtc/java/jni/jni_helpers.cc View 4 chunks +9 lines, -16 lines 0 comments Download
M talk/build/common.gypi View 1 1 chunk +0 lines, -1 line 0 comments Download
M talk/libjingle.gyp View 1 1 chunk +0 lines, -5 lines 0 comments Download
M webrtc/build/common.gypi View 1 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/build/webrtc.gni View 1 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/examples/android/media_demo/jni/jni_helpers.cc View 1 2 3 2 chunks +7 lines, -12 lines 0 comments Download
M webrtc/webrtc_examples.gyp View 1 1 chunk +0 lines, -7 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
noahric
Alex: you'll probably want to verify this manually, since I doubt there are tests to ...
5 years, 1 month ago (2015-11-05 22:32:40 UTC) #2
phoglund
Nice work. I wanted to look at removing ICU as well but it looks like ...
5 years, 1 month ago (2015-11-06 08:08:05 UTC) #4
kjellander_webrtc
Wow, this is truly great. I've also wished for someone to remove this dependency. lgtm
5 years, 1 month ago (2015-11-06 11:02:22 UTC) #6
kjellander_webrtc
You could also try removing icu from setup_links.py and .gitignore but I'll be happy to ...
5 years, 1 month ago (2015-11-06 11:05:05 UTC) #7
AlexG
lgtm
5 years, 1 month ago (2015-11-06 17:49:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1430023005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1430023005/60001
5 years, 1 month ago (2015-11-06 21:51:30 UTC) #10
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 1 month ago (2015-11-06 21:56:09 UTC) #11
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/23725e09c6533739afa67ca9694f6fa874c26279 Cr-Commit-Position: refs/heads/master@{#10545}
5 years, 1 month ago (2015-11-06 21:56:18 UTC) #12
jridges
Saw this go by and had to comment. A careful reading of the JNI spec. ...
5 years, 1 month ago (2015-11-06 22:44:17 UTC) #14
noahric
On 2015/11/06 22:44:17, jridges wrote: > Saw this go by and had to comment. A ...
5 years, 1 month ago (2015-11-07 01:48:17 UTC) #15
jridges
5 years, 1 month ago (2015-11-07 03:01:53 UTC) #16
Message was sent while issue was closed.
On 2015/11/07 01:48:17, noahric wrote:
> On 2015/11/06 22:44:17, jridges wrote:
> > Saw this go by and had to comment. A careful reading of the JNI spec. shows
> that
> > the JNI does not produce standard UTF-8, but a modified form. I don't know
if
> > that's important in this case or not, but it should probably be documented.
> 
> Do you have a link? That's really interesting to know. I very much doubt it'll
> make a practical difference for how it's used here (limited, non-user-visible
> string parsing), or that very many projects ship a separate unicode library to
> support it, though :) Thanks!

The wikipedia article on the JNI rather succinctly describes the issue:

https://en.wikipedia.org/wiki/Java_Native_Interface

but I got it from the book: Liang, Sheng (June 20, 1999). Java(TM) Native
Interface: Programmer's Guide and Specification (1st ed.). Prentice Hall. p.
320. ISBN 0-201-32577-2.

When I was faced with this issue, I ended up converting the strings to UTF-8 in
java, and then passing the result through the JNI as a byte array.

Powered by Google App Engine
This is Rietveld 408576698