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

Issue 11503013: android: Pass CPU properties from browser to renderer process. (Closed)

Created:
8 years ago by digit1
Modified:
7 years, 11 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam
Visibility:
Public.

Description

android: Pass CPU properties from browser to renderer process. This is necessary to allow the renderer processes to use NEON instructions on ARM devices that support them in libraries like Skia. The main issue is that on JellyBean and higher, the renderer process runs in a sandbox that prevents it from accessing the filesystem, including /proc/ which is the only way to query the kernel for the features detected by the CPU. To overcome this, send the result of the probe to each renderer process, which will use the new android_setCpu() function introduced in https://gerrit.chromium.org/gerrit/#/c/39370/ Note that this requires that third-party libraries use the android_getCpuCount() and android_getCpuFeatures() function to get this data at runtime. BUG=164154 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175820

Patch Set 1 #

Total comments: 14

Patch Set 2 : fix marcus' nits #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : remove unused Java native method + fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -9 lines) Patch
M base/android/base_jni_registrar.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A + base/android/cpu_features.h View 1 chunk +4 lines, -4 lines 0 comments Download
A base/android/cpu_features.cc View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A base/android/java/src/org/chromium/base/CpuFeatures.java View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/app/android/sandboxed_process_service.cc View 1 3 chunks +12 lines, -3 lines 0 comments Download
M content/content_app.gypi View 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/app/SandboxedProcessService.java View 1 2 3 4 chunks +9 lines, -2 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/SandboxedProcessConnection.java View 1 3 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
digit1
first try. I manually tested (by adding logs that are not in this patch) that ...
8 years ago (2012-12-10 13:25:16 UTC) #1
bulach
lgtm lgtm, just nits. feel free to go ahead once the dependencies are in. https://codereview.chromium.org/11503013/diff/1/base/android/cpu_features.cc ...
8 years ago (2012-12-10 14:03:07 UTC) #2
digit1
https://codereview.chromium.org/11503013/diff/1/base/android/cpu_features.cc File base/android/cpu_features.cc (right): https://codereview.chromium.org/11503013/diff/1/base/android/cpu_features.cc#newcode1 base/android/cpu_features.cc:1: #include <cpu-features.h> On 2012/12/10 14:03:07, bulach wrote: > nit: ...
8 years ago (2012-12-10 14:44:56 UTC) #3
Torne
Is this just a layer on top of the cpufeatures code we pull in from ...
8 years ago (2012-12-10 15:32:06 UTC) #4
digit1
Not a layer, it _uses_ it. Actually, it allows any caller of android_getCpuFeatures() to get ...
8 years ago (2012-12-10 16:00:41 UTC) #5
Torne
On 2012/12/10 16:00:41, digit1 wrote: > Not a layer, it _uses_ it. Actually, it allows ...
8 years ago (2012-12-10 16:46:36 UTC) #6
digit1
No, it is not a replacement, it is an enhancement that ensures that android_getCpuFeatures() will ...
8 years ago (2012-12-10 17:08:58 UTC) #7
digit1
Mmmm, this is a terribly funky failure, I can't reproduce it: it refuses to build ...
8 years ago (2012-12-12 16:15:47 UTC) #8
digit1
Ok, the LKGR is only at 172434, and the android_tools DEPS roll happened later in ...
8 years ago (2012-12-12 16:23:56 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/11503013/9001
8 years ago (2012-12-14 10:55:52 UTC) #10
commit-bot: I haz the power
Presubmit check for 11503013-9001 failed and returned exit status 1. Running presubmit commit checks ...
8 years ago (2012-12-14 10:55:57 UTC) #11
digit1
I've added Adam and Darin as reviewers to get their approval. Thanks in advance.
8 years ago (2012-12-19 12:10:47 UTC) #12
agl
higher-level comment to answer before I review the code: Are you sure that /proc/cpuinfo is ...
8 years ago (2012-12-19 16:35:42 UTC) #13
digit1
Yes, unfortunately, only a few CP15 registers are accessible from unprivilege mode on ARM (three ...
8 years ago (2012-12-19 16:52:29 UTC) #14
darin (slow to review)
LGTM for gyp{i} changes in base and content
8 years ago (2012-12-19 17:49:22 UTC) #15
agl
LGTM, although I don't know much about Java and less about JNI! https://chromiumcodereview.appspot.com/11503013/diff/9001/base/android/java/src/org/chromium/base/CpuFeatures.java File base/android/java/src/org/chromium/base/CpuFeatures.java ...
8 years ago (2012-12-19 18:26:36 UTC) #16
joth
drive by nits (but lgtm; I don't need to review again) https://codereview.chromium.org/11503013/diff/9001/base/android/java/src/org/chromium/base/CpuFeatures.java File base/android/java/src/org/chromium/base/CpuFeatures.java (right): ...
8 years ago (2012-12-19 19:09:39 UTC) #17
digit1
https://codereview.chromium.org/11503013/diff/9001/base/android/java/src/org/chromium/base/CpuFeatures.java File base/android/java/src/org/chromium/base/CpuFeatures.java (right): https://codereview.chromium.org/11503013/diff/9001/base/android/java/src/org/chromium/base/CpuFeatures.java#newcode14 base/android/java/src/org/chromium/base/CpuFeatures.java:14: // For more context, see crbug.com/164154 On 2012/12/19 19:09:40, ...
7 years, 11 months ago (2013-01-09 11:26:19 UTC) #18
digit1
Patch set 4 removed the obsolete method and updated the comment. All tests passes. There ...
7 years, 11 months ago (2013-01-09 17:08:50 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/11503013/28001
7 years, 11 months ago (2013-01-09 17:09:09 UTC) #20
commit-bot: I haz the power
7 years, 11 months ago (2013-01-09 17:09:29 UTC) #21
Message was sent while issue was closed.
Change committed as 175820

Powered by Google App Engine
This is Rietveld 408576698