#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):

https://codereview.adblockplus.org/29677555/

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.

Change History (5)

comment:1 Changed 21 months ago by asmirnov

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 21 months ago by asmirnov

  • Description modified (diff)

comment:3 Changed 21 months ago by asmirnov

  • Description modified (diff)

comment:5 Changed 21 months ago by asmirnov

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.