Opened on 01/23/2018 at 06:09:58 AM
Closed on 01/23/2018 at 12:05:18 PM
#6299 closed change (fixed)
Avoid main thread lock on URL loading
Reported by: | asmirnov | Assignee: | |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Libadblockplus-Android | Keywords: | |
Cc: | Blocked By: | #6265 | |
Blocking: | Platform: | Android | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by asmirnov)
Background
In issue #6265 we've optimized locking in order to avoid ANR (since AdblockEngine is now creating on background thread and on AdblockWebView request). However we can't start using it and it happens in startAbpLoading(...) in main thread:
https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android-webview/src/org/adblockplus/libadblockplus/android/webview/AdblockWebView.java#L1125
We can go further and waitForReady() in background threads. For this we have to move domain request from main thread to background thread https://github.com/adblockplus/libadblockplus-android/blob/master/libadblockplus-android-webview/src/org/adblockplus/libadblockplus/android/webview/AdblockWebView.java#L1127 and wait for engine in shouldInterceptRequest as it happens on background thread too.
What to change
Move domain request to background thread (elemhide thread), waitForReady in background threads only.
Attachments (0)
Change History (5)
comment:1 Changed on 01/23/2018 at 06:14:36 AM by asmirnov
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:4 Changed on 01/23/2018 at 12:04:42 PM by abpbot
comment:5 Changed on 01/23/2018 at 12:05:18 PM by asmirnov
- Resolution set to fixed
- Status changed from reviewing to closed
Some commits referencing this issue have landed: