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

Issue 12700011: [Android] Allow JNI initialization on background thread (Closed)

Created:
7 years, 9 months ago by aberent
Modified:
7 years, 9 months ago
Reviewers:
bulach, Yaron, joth
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, bulach
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[Android] Allow JNI initialization on background thread The code used to insist that JNI initialization only happened on the main (UI) thread. This was because it was believed that the static initialization of the Java classes initialized as a result of JNI calls might only work on the UI thread. In practice it seems that none of these Java classes have this requirement, so this seems to have been an unnecessary restriction, and slowed up startup on Chrome for Android. Remove this restriction, but add locks to ensure that only one thread is trying to initialize the JNI at a time. Also change some function names to reflect this change. BUG=214560 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=189093

Patch Set 1 #

Total comments: 10

Patch Set 2 : [Android] Allow JNI initialization on background thread - respond to code review comments #

Patch Set 3 : [Android] Allow JNI initialization on background thread - rebase to fix landing problems #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -71 lines) Patch
M content/app/android/library_loader_hooks.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/app/ChildProcessService.java View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/java/src/org/chromium/content/app/LibraryLoader.java View 1 6 chunks +52 lines, -68 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
aberent
Downstream patch to actually use this to follow.
7 years, 9 months ago (2013-03-18 13:38:00 UTC) #1
Yaron
Replacing myself with Marcus/joth since I'm pretty sure they wrote this. From a quick scan ...
7 years, 9 months ago (2013-03-18 15:56:46 UTC) #2
aberent
The current code does the load on the background thread but sets up the JNI ...
7 years, 9 months ago (2013-03-18 16:03:15 UTC) #3
bulach
lgtm, thanks! some nits below, but also, and more importantly, the commit message (and possibly ...
7 years, 9 months ago (2013-03-18 16:21:11 UTC) #4
joth
https://codereview.chromium.org/12700011/diff/1/content/app/android/library_loader_hooks.cc File content/app/android/library_loader_hooks.cc (right): https://codereview.chromium.org/12700011/diff/1/content/app/android/library_loader_hooks.cc#newcode60 content/app/android/library_loader_hooks.cc:60: logging::InitLogging(NULL, internally this calls LoggingLock::Init which has the following ...
7 years, 9 months ago (2013-03-18 16:32:55 UTC) #5
aberent
Updated patch follows soon. https://codereview.chromium.org/12700011/diff/1/content/app/android/library_loader_hooks.cc File content/app/android/library_loader_hooks.cc (right): https://codereview.chromium.org/12700011/diff/1/content/app/android/library_loader_hooks.cc#newcode60 content/app/android/library_loader_hooks.cc:60: logging::InitLogging(NULL, As I understand the ...
7 years, 9 months ago (2013-03-18 18:44:54 UTC) #6
joth
On 18 March 2013 11:44, <aberent@chromium.org> wrote: > Updated patch follows soon. > > > ...
7 years, 9 months ago (2013-03-18 19:32:26 UTC) #7
joth
On 2013/03/18 19:32:26, joth wrote: > On 18 March 2013 11:44, <mailto:aberent@chromium.org> wrote: > > ...
7 years, 9 months ago (2013-03-18 20:58:23 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aberent@chromium.org/12700011/9001
7 years, 9 months ago (2013-03-19 09:35:27 UTC) #9
commit-bot: I haz the power
Failed to apply patch for content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 9 months ago (2013-03-19 09:35:29 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aberent@chromium.org/12700011/15001
7 years, 9 months ago (2013-03-19 10:38:38 UTC) #11
commit-bot: I haz the power
Presubmit check for 12700011-15001 failed and returned exit status 1. INFO:root:Found 3 file(s). Running presubmit ...
7 years, 9 months ago (2013-03-19 10:38:41 UTC) #12
aberent
Hi Yaron, Can I have your LGTM, neither joth nor Marcus are owners of content/apps/android. ...
7 years, 9 months ago (2013-03-19 10:44:44 UTC) #13
Yaron
lgtm
7 years, 9 months ago (2013-03-19 16:53:01 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aberent@chromium.org/12700011/15001
7 years, 9 months ago (2013-03-19 16:56:14 UTC) #15
commit-bot: I haz the power
7 years, 9 months ago (2013-03-19 20:43:58 UTC) #16
Message was sent while issue was closed.
Change committed as 189093

Powered by Google App Engine
This is Rietveld 408576698