initSafeBrowsing should always invoke the callback on the UI thread |
||||||||
Issue descriptionAfter careful inspection, it looks like WebView#initSafeBrowsing() will sometimes invoke the callback on threads other than the UI thread. This conflicts with the API documentation [1]. Thread guarantees seem like a reasonable thing to me, so we should just ensure that we always invoke on the UI thread. [1] https://cs.corp.google.com/android/frameworks/base/core/java/android/webkit/WebView.java?q=package:android+f:webkit+initsafebrowsing&l=1661
,
Aug 11 2017
I'm on the fence about whether or not this is merge-worthy. I'm requesting the merge, but amineer@ should take a look at my reasoning below (and feel free to disagree with it). Q: How will this help our users? A: This guarantees that the callback is invoked on a consistent thread. This impacts app stability/bugs. Without this guarantee, applications may incorrectly assume the UI thread is always used, causing bugs for the edge cases when we use a different thread. Q: Is this necessary? A: Not critical, but we shouldn't make thread guarantees without merging this back, and I think the API will be lacking without those guarantees. tobiasjs@ let me know if you agree/disagree. This should be on the safer-side for merges: * Only affects android_webview/ * I anticipate a clean merge * Full automated test coverage
,
Aug 11 2017
This bug requires manual review: M61 has already been promoted to the beta branch, so this requires manual review Please contact the milestone owner if you have questions. Owners: amineer@(Android), cmasso@(iOS), ketakid@(ChromeOS), govind@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 14 2017
We can take this for 61 so long as we merge ahead of next beta. Thus, approved for M61 branch 3163, but please merge by EOD. Thanks!
,
Aug 14 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c7f4188a67c7e0dea2610fada3efa714302d2bf5 commit c7f4188a67c7e0dea2610fada3efa714302d2bf5 Author: Nate Fischer <ntfschr@chromium.org> Date: Mon Aug 14 18:35:34 2017 AW: ensure initSafeBrowsing callback is invoked on UI thread This wraps initSafeBrowsing()'s callback in another callback. The wrapperCallback is responsible for running the actual callback on the UI thread. This is to stay consistent about which thread the callback is actually invoked on. TBR=ntfschr@chromium.org (cherry picked from commit 9364e47b961b5889d2d960553d09311437e5907f) Bug: 754061 Test: run_webview_instrumentation_test_apk -f SafeBrowsingTest#testInitSafeBrowsingCallbackOnUIThread Change-Id: I49a37443ba283884679dac7f521da007e5aec117 Reviewed-on: https://chromium-review.googlesource.com/609412 Commit-Queue: Nate Fischer <ntfschr@chromium.org> Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#493516} Reviewed-on: https://chromium-review.googlesource.com/614129 Reviewed-by: Nate Fischer <ntfschr@chromium.org> Cr-Commit-Position: refs/branch-heads/3163@{#541} Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528} [modify] https://crrev.com/c7f4188a67c7e0dea2610fada3efa714302d2bf5/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java [modify] https://crrev.com/c7f4188a67c7e0dea2610fada3efa714302d2bf5/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java
,
Aug 14 2017
Thanks, Alex!
,
Oct 11 2017
,
Aug 24
Bulk edit: marking stale 'fixed' bugs as 'verified' since they don't need verification at this point. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by bugdroid1@chromium.org
, Aug 10 2017