Skip to content

Commit

Permalink
AW: mark variable as synchronized
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
ntfschr-chromium authored and Commit Bot committed Apr 26, 2018
1 parent 6c42d28 commit e828005
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class AwSafeBrowsingConfigHelper {
private static final String OPT_IN_META_DATA_STR = "android.webkit.WebView.EnableSafeBrowsing";
private static final boolean DEFAULT_USER_OPT_IN = false;

private static Boolean sSafeBrowsingUserOptIn;
private static volatile Boolean sSafeBrowsingUserOptIn;

// Used to record the UMA histogram SafeBrowsing.WebView.AppOptIn. Since these values are
// persisted to logs, they should never be renumbered nor reused.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public boolean canUseGms() {
return false;
}

// Overriding implementations may call "callback" asynchronously, on any thread.
public void querySafeBrowsingUserConsent(
Context context, @NonNull final Callback<Boolean> callback) {
// User opt-in preference depends on a SafetyNet API.
Expand Down

0 comments on commit e828005

Please sign in to comment.