New issue
Advanced search Search tips

Issue 835497 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 836064

Blocking:
issue 817644



Sign in to add a comment

WebView startup is delayed by querying for Safe Browsing user consent

Project Member Reported by ntfschr@chromium.org, Apr 20 2018

Issue description

See also: http://crrev/i/611093.

WebView startup is currently unnecessarily delayed by querying for Safe Browsing user consent. We query for Safe Browsing user consent asynchronously using PlatformServiceBridge#querySafeBrowsingUserConsent [1].

Under the hood, the downstream implementation of this method calls an async GMS API [2]. Even though that API itself is async, the synchronous parts of the method take a long time (initial estimates are ~9ms, thorough results will be posted here [3]).

We should post this work (similar to http://crrev/i/611093) to improve startup.

Because querySafeBrowsingUserConsent is asynchronous, it has always been possible that we would detect a known-malicious URL, but would not know the user's opt-in preference (and would therefore mark this as a "safe" URL). If we re-implement querySafeBrowsingUserConsent to use AsyncTask, we should be careful to check that we don't hit this case significantly more frequently.

[1] https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java?l=54&rcl=90e886d1638437a1346367e36bbff675a826fe66
[2] https://cs.corp.google.com/clankium/src/clank/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridgeImpl.java?q=package:clankium+f:clank+querySafeBrowsingUserConsent&l=136
[3] https://docs.google.com/spreadsheets/d/1r-u4la0eXvaTIwsuoSO5jBmghn2TBBR9Dj8FGtyvSqg/edit?usp=sharing
 
Blockedon: 836064
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e828005515489de18a46730b52273a6b3e052b23

commit e828005515489de18a46730b52273a6b3e052b23
Author: Nate Fischer <ntfschr@chromium.org>
Date: Thu Apr 26 19:36:59 2018

AW: mark variable as synchronized

This marks Safe Browsing user opt-out as volatile, since it may be
set by a background thread.

This also documents that querySafeBrowsingUserConsent can invoke the
callback on any thread (because this will be implemented by
http://crrev/i/615168).

Bug:  835497 
Test: manual
Change-Id: I557dd5979aeaf7a4a2119ec0c8604528278e05a6
Reviewed-on: https://chromium-review.googlesource.com/1029423
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554118}
[modify] https://crrev.com/e828005515489de18a46730b52273a6b3e052b23/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
[modify] https://crrev.com/e828005515489de18a46730b52273a6b3e052b23/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/d3953c5ec81ea722d28f1bb142df5361c59ffbbc

commit d3953c5ec81ea722d28f1bb142df5361c59ffbbc
Author: Nate Fischer <ntfschr@google.com>
Date: Fri Apr 27 22:50:05 2018

Status: Fixed (was: Started)
No manual verification necessary.
Status: Verified (was: Fixed)
Bulk edit: marking stale 'fixed' bugs as 'verified' since they don't need verification at this point.

Sign in to add a comment