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

Issue 2243753002: Prevent thread assertion for HTC mail apk (Closed)

Created:
4 years, 4 months ago by Changwan Ryu
Modified:
4 years, 3 months ago
CC:
android-webview-reviews_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Prevent thread assertion for HTC mail apk HTC's mail apk calls evaluateJavaScript() inside InputConnection#setComposingText(). This is problematic with ImeThread feature since InputConnection methods are now running on its own thread (IME thread). This causes a thread check assertion in Android's framework (android.webkit.WebView). As a workaround, we set sEnforceThreadChecking to false immediately after it was set in WebView's constructor. HTC is actively fixing their apk to avoid this crash, but as a last resort, this workaround will help avoid such a crash. BUG=636717, 622151 Committed: https://crrev.com/f99c4ade4b10c24a59b7bf34de4d7509e7ca8708 Cr-Commit-Position: refs/heads/master@{#414717}

Patch Set 1 #

Patch Set 2 : cache and check version code #

Patch Set 3 : use correct version code #

Total comments: 12

Patch Set 4 : changed atomicboolean usage and enhanced logging #

Total comments: 18

Patch Set 5 : addressed torne@'s comments, simplified some code #

Total comments: 6

Patch Set 6 : moved some logic to factory and replace atomicboolean by final #

Patch Set 7 : adds a comment #

Patch Set 8 : addressed more comments #

Total comments: 2

Patch Set 9 : check in factory provider initialization #

Total comments: 8

Patch Set 10 : more fixes #

Patch Set 11 : move disabling code from init to initForReal #

Patch Set 12 : patch that does not work. #

Total comments: 1

Patch Set 13 : back to patch 10 #

Total comments: 2

Patch Set 14 : move disableThreadChecking before addTask #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -6 lines) Patch
M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +38 lines, -4 lines 0 comments Download
M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java View 1 2 3 4 5 6 7 8 9 12 5 chunks +34 lines, -2 lines 0 comments Download

Messages

Total messages: 79 (41 generated)
Changwan Ryu
This is a preliminary version that does not check for version code. Could you take ...
4 years, 4 months ago (2016-08-12 06:24:44 UTC) #4
Changwan Ryu
On 2016/08/12 06:24:44, Changwan Ryu wrote: > This is a preliminary version that does not ...
4 years, 4 months ago (2016-08-12 06:53:24 UTC) #7
aelias_OOO_until_Jul13
https://codereview.chromium.org/2243753002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: private static volatile AtomicBoolean sShouldAvoidThreadCheckingForHtcMail; Reading https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html, it seems ...
4 years, 4 months ago (2016-08-12 07:49:57 UTC) #10
Changwan Ryu
Thanks for the careful review. Please take another look. https://codereview.chromium.org/2243753002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: ...
4 years, 4 months ago (2016-08-12 08:40:30 UTC) #13
Torne
https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: private static volatile AtomicBoolean sIsHtcMail = new AtomicBoolean(false); For ...
4 years, 4 months ago (2016-08-12 09:24:23 UTC) #16
Changwan Ryu
https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: private static volatile AtomicBoolean sIsHtcMail = new AtomicBoolean(false); On ...
4 years, 4 months ago (2016-08-12 11:14:06 UTC) #17
Torne
https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: private static volatile AtomicBoolean sIsHtcMail = new AtomicBoolean(false); On ...
4 years, 4 months ago (2016-08-12 13:25:41 UTC) #18
Torne
Also can you drop the "(upstream)" from the commit message?
4 years, 4 months ago (2016-08-12 13:26:07 UTC) #19
Changwan Ryu
https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode108 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:108: private static volatile AtomicBoolean sIsHtcMail = new AtomicBoolean(false); On ...
4 years, 4 months ago (2016-08-16 10:30:24 UTC) #20
Torne
On 2016/08/16 10:30:24, Changwan Ryu wrote: > https://codereview.chromium.org/2243753002/diff/60001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode143 > android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:143: > sIsHtcMail.set(isHtcMail(mWebView)); > On 2016/08/12 ...
4 years, 4 months ago (2016-08-16 11:43:07 UTC) #23
Torne
Also, can you remove the (upstream) from the commit message? https://codereview.chromium.org/2243753002/diff/140001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/140001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode116 ...
4 years, 4 months ago (2016-08-16 11:45:07 UTC) #24
aelias_OOO_until_Jul13
lgtm as far as I'm concerned. On 2016/08/16 at 11:43:07, torne wrote: > However, something ...
4 years, 4 months ago (2016-08-16 22:25:50 UTC) #27
Changwan Ryu
Thanks for the explanation. I've removed upstream from commit message, moved the checking logic to ...
4 years, 4 months ago (2016-08-17 08:00:13 UTC) #31
Torne
https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode203 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:203: // This is called here because otherwise compiler optimization ...
4 years, 4 months ago (2016-08-17 10:43:07 UTC) #34
Changwan Ryu
https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode203 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:203: // This is called here because otherwise compiler optimization ...
4 years, 4 months ago (2016-08-17 14:07:42 UTC) #37
Torne
https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode203 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:203: // This is called here because otherwise compiler optimization ...
4 years, 4 months ago (2016-08-17 14:14:34 UTC) #38
Changwan Ryu
https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/160001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode203 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:203: // This is called here because otherwise compiler optimization ...
4 years, 4 months ago (2016-08-18 09:31:02 UTC) #41
Torne
On 2016/08/18 09:31:02, Changwan Ryu wrote: > Hmm.. I had to look up a bit. ...
4 years, 4 months ago (2016-08-18 10:14:27 UTC) #42
Changwan Ryu
On 2016/08/18 10:14:27, Torne wrote: > On 2016/08/18 09:31:02, Changwan Ryu wrote: > > Hmm.. ...
4 years, 4 months ago (2016-08-19 00:11:39 UTC) #45
Torne
On 2016/08/19 00:11:39, Changwan Ryu wrote: > On 2016/08/18 10:14:27, Torne wrote: > > On ...
4 years, 4 months ago (2016-08-19 11:45:33 UTC) #48
Changwan Ryu
On 2016/08/19 11:45:33, Torne wrote: > On 2016/08/19 00:11:39, Changwan Ryu wrote: > > On ...
4 years, 4 months ago (2016-08-23 06:32:41 UTC) #49
Changwan Ryu
One thing to note: because of the nature of how ThreadedInputConnectionFactory works (https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java?q=threadedinputconnectionfactory&sq=package:chromium&l=141) delaying this ...
4 years, 4 months ago (2016-08-24 07:38:05 UTC) #50
Torne
OK, so this is my reasoning for why I don't think this is permissible to ...
4 years, 4 months ago (2016-08-24 11:02:59 UTC) #51
aelias_OOO_until_Jul13
I'm not following all the arcane details, but I'd like to take a step back ...
4 years, 4 months ago (2016-08-24 18:32:36 UTC) #52
Torne
No. There is unfortunately no reason to believe that any of these patchsets work reliably ...
4 years, 4 months ago (2016-08-24 18:44:25 UTC) #53
Torne
Sorry, that was a bit abrupt :/ I'm just worried that this workaround won't work ...
4 years, 3 months ago (2016-08-25 12:48:47 UTC) #54
aelias_OOO_until_Jul13
No problem, I agree landing something we don't understand is generally a bad practice. I ...
4 years, 3 months ago (2016-08-25 21:42:03 UTC) #55
sgurun-gerrit only
https://codereview.chromium.org/2243753002/diff/220001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java (right): https://codereview.chromium.org/2243753002/diff/220001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java#newcode502 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java:502: final String htcMailPackageId = "com.htc.android.mail"; Sorry but I don't ...
4 years, 3 months ago (2016-08-25 23:41:02 UTC) #57
aelias_OOO_until_Jul13
On 2016/08/25 at 23:41:02, sgurun wrote: > https://codereview.chromium.org/2243753002/diff/220001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java > File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java (right): > > https://codereview.chromium.org/2243753002/diff/220001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java#newcode502 ...
4 years, 3 months ago (2016-08-26 00:16:40 UTC) #58
aelias_OOO_until_Jul13
It's temporary in the sense that it's unnecessary the more HTC rolls out updates. It's ...
4 years, 3 months ago (2016-08-26 00:18:37 UTC) #59
Changwan Ryu
Ok, as torne@ questioned, alternative approach of patch set #12 did not work for a ...
4 years, 3 months ago (2016-08-26 02:35:20 UTC) #62
sgurun-gerrit only
On 2016/08/26 02:35:20, Changwan Ryu wrote: > Ok, as torne@ questioned, alternative approach of patch ...
4 years, 3 months ago (2016-08-26 04:00:04 UTC) #65
Torne
Selim, yes, the workaround here is unfortunate but because it's limited to a fixed range ...
4 years, 3 months ago (2016-08-26 11:25:01 UTC) #66
Changwan Ryu
https://codereview.chromium.org/2243753002/diff/240001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java (right): https://codereview.chromium.org/2243753002/diff/240001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java#newcode204 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java:204: if (mShouldDisableThreadChecking) disableThreadChecking(); On 2016/08/26 11:25:01, Torne wrote: > ...
4 years, 3 months ago (2016-08-26 11:36:31 UTC) #69
Torne
Thanks; LGTM :)
4 years, 3 months ago (2016-08-26 12:03:06 UTC) #70
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/2243753002/260001
4 years, 3 months ago (2016-08-26 15:16:08 UTC) #75
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 3 months ago (2016-08-26 15:19:56 UTC) #77
commit-bot: I haz the power
4 years, 3 months ago (2016-08-26 15:21:38 UTC) #79
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/f99c4ade4b10c24a59b7bf34de4d7509e7ca8708
Cr-Commit-Position: refs/heads/master@{#414717}

Powered by Google App Engine
This is Rietveld 408576698