New issue
Advanced search Search tips

Issue 741950 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Call getApplicationContext for initSafeBrowsing

Project Member Reported by ntfschr@chromium.org, Jul 13 2017

Issue description

See internal bug http://b/63616213 for more info.

Android best practices dictate that static methods should call Context#getApplicationContext to verify that they're operating on an Application Context.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 13 2017

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

commit 65891f644a93ca144f9c14a74c09d67288fb6b76
Author: Nate Fischer <ntfschr@chromium.org>
Date: Thu Jul 13 06:30:05 2017

AW: enforce initSafeBrowsing only uses App Context

We need to call getApplicationContext() to enforce that
WebView#initSafeBrowsing can operate with only an Application Context.

Bug:  741950 
Test: manual - custom app
Change-Id: I274da8de6a53211eff64bacd663b00757b6348db
Reviewed-on: https://chromium-review.googlesource.com/569117
Reviewed-by: Selim Gurun <sgurun@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486292}
[modify] https://crrev.com/65891f644a93ca144f9c14a74c09d67288fb6b76/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java

Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 22 2017

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

commit 6b68ab09aea09ea44b77e6763eabc2690e073f0d
Author: Nate Fischer <ntfschr@chromium.org>
Date: Tue Aug 22 20:37:03 2017

AW: move some initSafeBrowsing out of glue layer for testing

No change in logic.

This moves the call to getApplicationContext from the glue layer to
normal android_webview layer so that we can integration test it.

Bug:  741950 
Test: run_webview_instrumentation_test_apk -f SafeBrowsingTest#testInitSafeBrowsingUsesAppContext
Change-Id: I568763b4544ec97a0a0af89fb4612b828ad1d3d0
Reviewed-on: https://chromium-review.googlesource.com/624996
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496430}
[modify] https://crrev.com/6b68ab09aea09ea44b77e6763eabc2690e073f0d/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
[modify] https://crrev.com/6b68ab09aea09ea44b77e6763eabc2690e073f0d/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
[modify] https://crrev.com/6b68ab09aea09ea44b77e6763eabc2690e073f0d/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java

Labels: WebView-SafeBrowsing
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