Status Update
Comments
la...@google.com <la...@google.com> #2
Branch: main
commit 6dc78fbbbbadac9c2dc2065150a7af2422c6115c
Author: Rupert Ben Wiser <bewise@chromium.org>
Date: Thu Sep 12 16:16:14 2024
webview: Add support configuration for CHIPS
Adding a boundary interface to let Android developers configure
if partitioned cookies should be enabled or not.
go/chips-android-apis-webview
Bug: 364904765
Change-Id: I683ab5ec157a11aa081db5763380e692ab02c5e6
Reviewed-on:
Reviewed-by: Peter Pakkenberg <pbirk@chromium.org>
Auto-Submit: Rupert Wiser <bewise@chromium.org>
Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1354607}
M android_webview/expectations/system_webview_32_64_bundle.AndroidManifest.expected
M android_webview/expectations/system_webview_32_bundle.AndroidManifest.expected
M android_webview/expectations/system_webview_64_bundle.AndroidManifest.expected
M android_webview/expectations/system_webview_bundle.AndroidManifest.expected
M android_webview/expectations/trichrome_webview_32_64_bundle.AndroidManifest.expected
M android_webview/expectations/trichrome_webview_32_bundle.AndroidManifest.expected
M android_webview/expectations/trichrome_webview_64_32_bundle.AndroidManifest.expected
M android_webview/expectations/trichrome_webview_64_bundle.AndroidManifest.expected
M android_webview/expectations/trichrome_webview_bundle.AndroidManifest.expected
M android_webview/glue/java/src/com/android/webview/chromium/AndroidXProcessGlobalConfig.java
M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
M android_webview/nonembedded/java/AndroidManifest.xml
M android_webview/support_library/boundary_interfaces/src/org/chromium/support_lib_boundary/ProcessGlobalConfigConstants.java
M chrome/android/expectations/monochrome_32_64_public_bundle__base.AndroidManifest.expected
M chrome/android/expectations/monochrome_32_public_bundle__base.AndroidManifest.expected
M chrome/android/expectations/monochrome_64_32_public_bundle__base.AndroidManifest.expected
M chrome/android/expectations/monochrome_64_public_bundle__base.AndroidManifest.expected
M chrome/android/expectations/monochrome_public_bundle__base.AndroidManifest.expected
ll...@google.com <ll...@google.com> #3
There is already test coverage of CHIPS behavior inside of Chromium in
Due to limitations of AndroidX test infra, manual test instructions are necessary to exercise the toggling of the enable partitioned cookies API. WebView toggles CHIPS behavior with the disable-partitioned-cookies
command line switch.
To demonstrate the API's correctness in toggling this, log statements were inspected when this flag was toggled during WebView startup.
See the diff below for details:
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
index 63c5f5a5b2795..ee589176bdab2 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -490,6 +490,9 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
if (!androidXConfig.getPartitionedCookiesEnabled()) {
cl.appendSwitch("disable-partitioned-cookies");
+ Log.e(TAG, "Partitioned cookies disabled");
+ } else {
+ Log.e(TAG, "Partitioned cookies enabled");
}
// Now safe to use WebView data directory.
la...@google.com <la...@google.com> #4
Note: Will add testing when more of the API has been implemented.
da...@google.com <da...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Adam Walls <
Link:
[WebView] Add API to configure CHIPS
Expand for full commit details
[WebView] Add API to configure CHIPS
This adds an API to allow Android developers to configure CHIPS globally. This is done with ProcessGlobalConfig. In order to prevent this from being published/used prior to Android B's release, RestrictTo annotation is used.
Design: go/chips-android-apis-webview
Test: Will add testing in a follow-up CL.
Bug: 364904765
Change-Id: If6d630562be7209eb2ab00da2dbad9398ba0553e
Files:
- M
webkit/webkit/src/main/java/androidx/webkit/ProcessGlobalConfig.java
- M
webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java
- M
webkit/webkit/src/main/java/androidx/webkit/internal/StartupFeatures.java
- M
webkit/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
Hash: 4fe72afdcf64cad8b2399ca7a28d1aa57a05f976
Date: Thu Oct 24 17:35:26 2024
ll...@google.com <ll...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
Author: Adam Walls <
Link:
Refactor common Webkit test classes into test.common module.
Expand for full commit details
Refactor common Webkit test classes into test.common module.
This is intended to enable new androidx.webkit test targets so that we
do not need to use the Orchestrator annotation to create new test
processes. This is intended as a refactor to reduce the CL size in
aosp/3371538.
The new androidx.webkit.test.common module was created using
the development/project-creator/create_project.py script.
Test: ./webkit/run_instrumentation_tests.sh
Bug: 364904765
Change-Id: If68173a88bd5267d3aa19986ba3f4486d9e17b64
Files:
- M
settings.gradle
- A
webkit/integration-tests/common/build.gradle
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/PollingCheck.java
- A
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/TestWebMessageListener.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/WebViewOnUiThread.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/WebkitUtils.java
- M
webkit/integration-tests/instrumentation/build.gradle
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/AsyncStartUpTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/CookieManagerCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/MultiProfileTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/PostMessageTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ProxyControllerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ServiceWorkerClientCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/TracingControllerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatDarkModeTestBase.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatUserAgentMetadataTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebStorageTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewDocumentStartJavaScriptTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewRenderProcessClientTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewRenderProcessTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewWebMessageCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewWebMessageListenerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/internal/AssetHelperTest.java
- M
webkit/integration-tests/instrumentation/src/androidTestTargetSdk32/java/androidx/webkit/WebSettingsCompatForceDarkTest.java
- M
webkit/integration-tests/instrumentation/src/androidTestTargetSdkLatest/java/androidx/webkit/WebSettingsCompatDarkThemeTest.java
- M
webkit/integration-tests/instrumentation/src/androidTestTargetSdkLatest/java/androidx/webkit/WebSettingsCompatLightThemeTest.java
Hash: 463387393fce755928325a57d49cec218631a6a3
Date: Fri Dec 13 23:24:49 2024
da...@google.com <da...@google.com>
da...@google.com <da...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
Author: Adam Walls <
Link:
[WebView] Add CHIPS testing via integration tests.
Expand for full commit details
[WebView] Add CHIPS testing via integration tests.
In order to test the enable partitioned cookies API added in
aosp/3318854, integration tests are added.
Note: Since test process restarts are not supported, and the startup
APIs can only be called once per process lifetime, this will avoid
errors by only testing with a single test case that covers a few
use cases.
Test: ./webkit/run_instrumentation_tests.sh
Bug: 364904765
Change-Id: I89354cb04bb92b954a5a51fac06133ebd6a3ae3a
Files:
- M
settings.gradle
- A
webkit/chips-enabled-integration-tests/instrumentation/build.gradle
- A
webkit/chips-enabled-integration-tests/instrumentation/src/androidTest/AndroidManifest.xml
- A
webkit/chips-enabled-integration-tests/instrumentation/src/androidTest/java/androidx/webkit/EnablePartitionedCookiesTest.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/WebViewOnUiThread.java
- M
webkit/run_instrumentation_tests.sh
Hash: 200afa93c09543d6c7320a025fed7f2944689055
Date: Thu Dec 12 03:20:20 2024
ra...@google.com <ra...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Adam Walls <
Link:
[WebView] Expose Enable CHIPS API
Expand for full commit details
[WebView] Expose Enable CHIPS API
aosp/3318854 introduced the enable CHIPS API hidden until it was
deemed ready for release. This exposes the API for use in apps.
Relnote: "Add setPartitionedCookiesEnabled API. This will allow
developers to enable and disable partitioned cookies in WebView. The
feature is available in WebView starting in M130."
Bug: 364904765
Test: ./webkit/run_instrumentation_tests.sh
Change-Id: Ic506a23471946d31b797397e2f71aef0f3ae481a
Files:
- M
webkit/webkit/api/current.txt
- M
webkit/webkit/api/restricted_current.txt
- M
webkit/webkit/src/main/java/androidx/webkit/ProcessGlobalConfig.java
- M
webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java
- M
webkit/webkit/src/main/java/androidx/webkit/internal/StartupFeatures.java
Hash: 512bc1b685e6c5bbb563c33948b1c3b6b0ec9197
Date: Fri Dec 20 18:03:50 2024
en...@google.com <en...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
Author: Adam Walls <
Link:
Reformat affected classes from aosp/3406800.
Expand for full commit details
Reformat affected classes from aosp/3406800.
aosp/3406800 refactored some common classes that were not formatted
properly.
Bug: 364904765
Test: ./webkit/run_instrumentation_tests.sh
Change-Id: I328af103b753e575c25a383dd709e355a973b98f
Files:
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/PollingCheck.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/TestWebMessageListener.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/WebViewOnUiThread.java
- M
webkit/integration-tests/common/src/main/java/androidx/webkit/test/common/WebkitUtils.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/AsyncStartUpTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/MultiProfileTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/PostMessageTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ProxyControllerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ServiceWorkerClientCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/TracingControllerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatDarkModeTestBase.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebSettingsCompatUserAgentMetadataTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebStorageTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewDocumentStartJavaScriptTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewRenderProcessClientTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewRenderProcessTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewWebMessageCompatTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/WebViewWebMessageListenerTest.java
- M
webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/internal/AssetHelperTest.java
Hash: 818530aa0c71b1b6e1cba00a39494794b45ed6c8
Date: Wed Dec 18 00:18:27 2024
ra...@google.com <ra...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.webkit:webkit:1.13.0-alpha03
la...@google.com <la...@google.com> #11
Project: chromium/src
Branch: main
Author: Adam Walls <
Link:
[WV] Fix adding switch to stale command line reference.
Expand for full commit details
[WV] Fix adding switch to stale command line reference.
Currently, the disable-partitioned-cookies, aka
kDisablePartitionedCookiesSwitch, is used to control CHIPS in WebView.
However, it is currently broken because it uses a stale reference to the
command line object. This is because it is called after the point in
WebView's startup where the native library is loaded and passes off its
command line switches in Java to the native equivalent. This causes
changes that make the old reference stale. It results in an incongruence
between Java and native command line switches, causing undefined and
unintended behavior with CHIPS in WebView.
This fixes this by using the getInstance method to get a fresh reference
to a valid instance of the command line. Another change limits the scope
of the object that caused the issue by adding a block around the code
that references it. Note: The default behavior will be set to on for
now, postponing the decision to change it at a later point.
testing for the glue layer later.
Low-Coverage-Reason: HARD_TO_TEST Though we are looking into adding
Bug: 364904765, 389121692
Test: See bug 389121692 for test instructions.
Change-Id: Icd9a04bbdc3a82197bf27bec428e60f05cd62243
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6171228
Auto-Submit: Adam Walls <avvall@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Adam Walls <avvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413072}
Files:
- M
android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
Hash: fda51784ebf6743fdd47c1e6fc441fdb05d13945
Date: Wed Jan 29 11:42:08 2025
pc...@google.com <pc...@google.com> #12
ra...@google.com <ra...@google.com> #13
Although at this point, it is probably preferable to remove this flag instead of fixing all corner cases.
pc...@google.com <pc...@google.com> #14
ra...@google.com <ra...@google.com> #15
ld.gold however, seems to have always been copying the addends to the data (at least for R_AARCH64_RELATIVE relocations).
I have been doing testing for RELR on aarch64 and I've never once passed '--apply-dynamic-relocs' to get it to work.
.relr.dyn section processing in the bionic/glibc loaders has been working fine without needing it!
Also, see
I discovered the same thing there: with binutils-2.25, both bfd and gold linkers stored the addends at the relocation offset for x86_64, but only the gold linker did this for aarch64.
This upstream commit changes the default for ld.bfd, and makes the resulting image less compressible as you suggested:
On the other hand, as evidenced by this bug, ld.gold skips applying dynamic relocations into debug info sections with '--no-apply-dynamic-relocs'.
This does not make sense to me.
Maybe I'm missing something, but it seems like gold implementation of '--no-apply-dynamic-relocs' has never worked as intended (or in the same way as ld.bfd / ld.lld interpret this flag).
da...@google.com <da...@google.com> #16
ra...@google.com <ra...@google.com> #17
Elliott has concerns (
ll...@google.com <ll...@google.com> #18
ll...@google.com <ll...@google.com> #19
sr...@google.com <sr...@google.com>
en...@google.com <en...@google.com> #20
ll...@google.com <ll...@google.com> #21
ap...@google.com <ap...@google.com> #22
Branch: master
commit 49e1641cfc154895c5c5f394bb23c9518df2cb49
Author: Yunlian Jiang <yunlian@google.com>
Date: Thu Jul 12 15:54:35 2018
Fix aarch64 --no-apply-dynamic-relocs option.
This option is intended to make gold not apply link-time values for
absolution relocations which have dynamic relocations emitted for
them, in order to workaround an android dynamic loader bug in old
versions of android.
Unfortunately, it also had the side-effect of breaking debug data,
because the dynamic relocations are not used for non-ALLOC sections,
but the flag was also suppressing the static relocation.
This fix was proposed by jyknight@ and it fixed the problem by filtering
out non-ALLOC sections with the --no-apply-dynamic-relocs option.
BUG: 70838247
TEST: Debug info appears with --no-apply-dynamic-relocs
M binutils-2.27/gold/aarch64.cc
rp...@google.com <rp...@google.com> #23
I confirmed that r19 and r19c ld.gold arm64 has the aosp/716724 fix, which fixes the test case in
Description
int g_a = 123;
$ ~/ll/build/opt/bin/clang -target aarch64-unknown-linux-android a.c -o a.o -c -g # This is ToT clang, but it doesn't matter
$ ~/local/android-ndk-r16-beta2/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/ld -m aarch64linux -shared -o liba.so a.o # link with r16 ld
$ ~/ll/build/opt/bin/llvm-dwarfdump liba.so
...
0x0000001e: DW_TAG_variable
DW_AT_name ("g_a")
DW_AT_type (cu + 0x0033 "int")
DW_AT_external (true)
DW_AT_decl_file ("/tmp/r17-test/a.c")
DW_AT_decl_line (1)
DW_AT_location (DW_OP_addr 0x10360) <=== variable at address 0x10360, points straight into the data section
$ readelf -S liba.so
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
...
[ 7] .data PROGBITS 0000000000010360 00000360
0000000000000004 0000000000000000 WA 0 0 4
$ ~/local/android-ndk-r17-canary/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/ld -m aarch64linux -shared -o liba.so a.o # now link with r17 ld
$ ~/ll/build/opt/bin/llvm-dwarfdump liba.so
....
0x0000001e: DW_TAG_variable
DW_AT_name ("g_a")
DW_AT_type (cu + 0x0033 "int")
DW_AT_external (true)
DW_AT_decl_file ("/tmp/r17-test/a.c")
DW_AT_decl_line (1)
DW_AT_location (DW_OP_addr 0x0) <==== Address is gone
$ readelf -r liba.so
There are no relocations in this file.
^^^ The linker did not just forget to apply the relocation. It ate it completely.
Some interesting notes:
- If I drop the "-shared" (i.e., generate a main executable), the debug info comes out alright
- I tried the same thing with ld.gold, and I've learned that gold was broken at least since r15 (I haven't tried going further back)
- non-aarch64 targets don't seem to be affected