Move calls to GMS apis to the end of SCL

GMS operations are heavy and involve multiple binder calls. This can
lead to binder lock contention and/or SCL being indirectly blocked or
delayed.

Prior to GMS's bindService optimizations which moves bindService and
onServiceConnected calls to the bg thread, this was not a problem as GMS
operations are blocked until the above methods are called, which could
only happen on the UI thread.

With the optimization enabled, bindService and onService* happen on the
bg thread and thus in parallel with SCL, meaning that the follow-up API
calls also run in parallel with SCL leading to contention.

This cl is an attempt to move interactions with GMS to the end of SCL.

The downside of this is that we are delaying the GMS operations further
and might not get the information to run other parts of WebView eg
SafeBrowsing, on time.

Metrics to watch for:
- SafeBrowsing.WebView.UserOptInKnown.*
- Android.WebView.RestrictedContentBlocking.*
- UMA.RecordsCount

Change-Id: I6506f05b34166e914aea87915741702fa375b58d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7209549
Commit-Queue: Chidera Olibie <[email protected]>
Reviewed-by: Nate Fischer <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1552720}
NOKEYCHECK=True
GitOrigin-RevId: 3c1a097b2310c2d812479d9c30681e1a9ab906d3
1 file changed
tree: 62674ec4b680d9f0b4ba18a2f6ca9985f3751820
  1. java/
  2. BUILD.gn
  3. OWNERS
  4. README.md
README.md

//android_webview/glue/

This folder contains a shim layer between the public frameworks APIs (android.webkit.*) and WebView's implementation, and allows them to (mostly) not directly depend on each other.

Folder Dependencies

//android_webview/java/ must not depend on this directory.

See Also