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

Issue 2593653002: Split JNI init so native library preloading dosn't cause native init. (Closed)

Created:
4 years ago by Tobias Sargeant
Modified:
3 years, 11 months ago
CC:
chromium-reviews, agrieve+watch_chromium.org, android-webview-reviews_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Split JNI init so native library preloading dosn't cause native init. The zygote relies on preloading the shared library. However we can't determine the process type at this point (for monochrome it could be a chrome renderer, or a webview renderer), and so current OnJNIOnLoadInit code that relies on knowing the process type has to be delayed until LibraryLoader is called, and the process type is known. To get around this, we split this code in two, and have the first stage (JNI_OnLoad) register a hook that is run in the second stage, to process the OnJNIOnLoadInit work. BUG= Review-Url: https://codereview.chromium.org/2593653002 Cr-Commit-Position: refs/heads/master@{#441678} Committed: https://chromium.googlesource.com/chromium/src/+/48fdf7dc65a82510505c68c7e03fba8f3a88009b

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add library initialization to AwCookieManager constructor #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -37 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwCookieManager.java View 1 2 chunks +11 lines, -0 lines 2 comments Download
M android_webview/lib/main/webview_entry_point.cc View 2 chunks +3 lines, -11 lines 0 comments Download
M base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java View 2 chunks +8 lines, -9 lines 2 comments Download
M base/android/library_loader/library_loader_hooks.h View 2 chunks +6 lines, -0 lines 0 comments Download
M base/android/library_loader/library_loader_hooks.cc View 3 chunks +9 lines, -0 lines 2 comments Download
M chrome/browser/android/chrome_entry_point.cc View 2 chunks +7 lines, -2 lines 1 comment Download
M chrome/browser/android/monochrome_entry_point.cc View 1 chunk +20 lines, -15 lines 0 comments Download

Messages

Total messages: 29 (14 generated)
Tobias Sargeant
4 years ago (2016-12-20 15:00:41 UTC) #2
Bernhard Bauer
LGTM
4 years ago (2016-12-20 15:23:24 UTC) #5
Robert Sesek
I patched this in locally and am getting browser-side crashes: 12-20 12:46:18.944 19662 20611 W ...
4 years ago (2016-12-20 17:48:29 UTC) #8
Tobias Sargeant
On 2016/12/20 17:48:29, Robert Sesek wrote: > I patched this in locally and am getting ...
4 years ago (2016-12-20 17:52:58 UTC) #9
Robert Sesek
On 2016/12/20 17:52:58, Tobias Sargeant OOO 21dec-6jan wrote: > On 2016/12/20 17:48:29, Robert Sesek wrote: ...
4 years ago (2016-12-20 17:57:46 UTC) #10
Tobias Sargeant
On 2016/12/20 17:57:46, Robert Sesek wrote: > On 2016/12/20 17:52:58, Tobias Sargeant OOO 21dec-6jan wrote: ...
3 years, 11 months ago (2017-01-03 11:41:03 UTC) #13
Torne
https://codereview.chromium.org/2593653002/diff/20001/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java File android_webview/java/src/org/chromium/android_webview/AwCookieManager.java (right): https://codereview.chromium.org/2593653002/diff/20001/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java#newcode27 android_webview/java/src/org/chromium/android_webview/AwCookieManager.java:27: LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitialized(); I'm guessing this is because cookie manager relies ...
3 years, 11 months ago (2017-01-03 12:13:50 UTC) #16
Torne
Also, you should check out the discussion on https://codereview.chromium.org/2501193003/ as estevenson is also planning to ...
3 years, 11 months ago (2017-01-03 12:16:18 UTC) #18
Tobias Sargeant
https://codereview.chromium.org/2593653002/diff/20001/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java File android_webview/java/src/org/chromium/android_webview/AwCookieManager.java (right): https://codereview.chromium.org/2593653002/diff/20001/android_webview/java/src/org/chromium/android_webview/AwCookieManager.java#newcode27 android_webview/java/src/org/chromium/android_webview/AwCookieManager.java:27: LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitialized(); On 2017/01/03 12:13:50, Torne wrote: > I'm guessing ...
3 years, 11 months ago (2017-01-04 00:24:53 UTC) #19
Torne
OK, so while I'm not thrilled by how this looks, it all should *work* and ...
3 years, 11 months ago (2017-01-05 12:26:05 UTC) #20
Torne
I'll retest this manually on the latest version of android + chromium and then CQ ...
3 years, 11 months ago (2017-01-05 12:33:33 UTC) #21
Robert Sesek
LGTM. I tested this locally and it works including with GSA.
3 years, 11 months ago (2017-01-05 16:07:34 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2593653002/20001
3 years, 11 months ago (2017-01-05 16:09:22 UTC) #25
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/48fdf7dc65a82510505c68c7e03fba8f3a88009b
3 years, 11 months ago (2017-01-05 16:58:42 UTC) #28
agrieve
3 years, 11 months ago (2017-01-06 02:31:06 UTC) #29
Message was sent while issue was closed.
On 2017/01/05 16:58:42, commit-bot: I haz the power wrote:
> Committed patchset #2 (id:20001) as
>
https://chromium.googlesource.com/chromium/src/+/48fdf7dc65a82510505c68c7e03f...

FYI - this change shrunk monochrome's native library by almost 100kb (but not
Chrome's).
https://chromeperf.appspot.com/report?sid=99caa6c5389f77e13b562afa5703ad8fc1d...

If anyone has insights as to why that might be, I'd be curious to know (I can't
see why this would be from the change)

Powered by Google App Engine
This is Rietveld 408576698