Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 2635693002: [WebView] initial webview-side implementation of safebrowsing (Closed)

Created:
3 years, 11 months ago by timvolodine
Modified:
3 years, 11 months ago
CC:
chromium-reviews, android-webview-reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[WebView] initial webview-side implementation of safebrowsing Based on the original sgurun's patch https://codereview.chromium.org/2615393002/ This CL implements the basics for Safebrowsing for Webview - A basic UI manager that decides (using a simple policy) whether or not show an interstitial - A mechanism to call back to GMSCore for checking In addition to the base patch the following changed have been done: - added switch and functionality to enable/disable - replaced UI thread check in PlatformServiceBridge.java with a lock to avoid crashes (due to https://codereview.chromium.org/2611883002) - rebases, fixed DEPS, added todos, - added visibility check in canShowInterstitial() and comment/todo patch from issue 2615393002 at patchset 160001 (http://crrev.com/2615393002#ps160001) BUG= Review-Url: https://codereview.chromium.org/2635693002 Cr-Commit-Position: refs/heads/master@{#444177} Committed: https://chromium.googlesource.com/chromium/src/+/49207db970b2bff94d1ca2d0c2b3d5c7979a59c8

Patch Set 1 #

Patch Set 2 : rebase + fix DEPS #

Patch Set 3 : add switch #

Patch Set 4 : cleanup and comments #

Patch Set 5 : use AwSwitches for java #

Patch Set 6 : add visibility check and comments #

Total comments: 1

Patch Set 7 : rebase #

Patch Set 8 : replace UI thread check in PlatformServiceBridge with a lock #

Total comments: 16

Patch Set 9 : rebase #

Patch Set 10 : Selim's comments #

Patch Set 11 : refactor switch out of resource_dispatcher, add in aw_main_delegate #

Total comments: 2

Patch Set 12 : rebase #

Patch Set 13 : rename lock, add crbug comment #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -23 lines) Patch
M android_webview/BUILD.gn View 1 2 3 4 5 6 3 chunks +5 lines, -0 lines 0 comments Download
M android_webview/apk/java/proguard.flags View 1 chunk +4 lines, -0 lines 0 comments Download
M android_webview/browser/DEPS View 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.h View 3 chunks +10 lines, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.cc View 2 chunks +22 lines, -0 lines 0 comments Download
A android_webview/browser/aw_safe_browsing_ui_manager.h View 1 chunk +41 lines, -0 lines 0 comments Download
A android_webview/browser/aw_safe_browsing_ui_manager.cc View 1 chunk +36 lines, -0 lines 0 comments Download
M android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +17 lines, -2 lines 0 comments Download
M android_webview/common/aw_switches.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/common/aw_switches.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M android_webview/java/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java View 1 2 3 4 5 6 7 8 9 4 chunks +23 lines, -0 lines 3 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 1 chunk +16 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwSwitches.java View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +24 lines, -20 lines 0 comments Download
M android_webview/lib/main/aw_main_delegate.h View 2 chunks +6 lines, -0 lines 0 comments Download
M android_webview/lib/main/aw_main_delegate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -0 lines 0 comments Download
M android_webview/native/aw_contents.h View 3 chunks +6 lines, -1 line 0 comments Download
M android_webview/native/aw_contents.cc View 3 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (28 generated)
timvolodine
3 years, 11 months ago (2017-01-15 22:22:56 UTC) #18
sgurun-gerrit only
On 2017/01/15 22:22:56, timvolodine wrote:
3 years, 11 months ago (2017-01-16 15:10:58 UTC) #19
sgurun-gerrit only
https://codereview.chromium.org/2635693002/diff/100001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java File android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java (right): https://codereview.chromium.org/2635693002/diff/100001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java#newcode97 android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java:97: Log.w(TAG, "Could not find SafeBrowsingApiHandler"); let's remove this log ...
3 years, 11 months ago (2017-01-16 15:11:19 UTC) #20
timvolodine
Selim thanks for the comments! https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode279 android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc:279: if (safebrowsing_support_enabled) { On ...
3 years, 11 months ago (2017-01-16 18:58:58 UTC) #21
timvolodine
https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode279 android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc:279: if (safebrowsing_support_enabled) { On 2017/01/16 18:58:57, timvolodine wrote: > ...
3 years, 11 months ago (2017-01-16 19:01:56 UTC) #22
timvolodine
On 2017/01/16 19:01:56, timvolodine wrote: > https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc > File > android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc > (right): > > ...
3 years, 11 months ago (2017-01-16 21:38:34 UTC) #25
timvolodine
https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc File android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/2635693002/diff/140001/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc#newcode287 android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc:287: LOG(WARNING) << "Failed creating safebrowsing throttle"; On 2017/01/16 18:58:57, ...
3 years, 11 months ago (2017-01-16 22:42:00 UTC) #28
Tobias Sargeant
https://codereview.chromium.org/2635693002/diff/200001/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java File android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java (right): https://codereview.chromium.org/2635693002/diff/200001/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java#newcode29 android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java:29: public static PlatformServiceBridge getInstance(Context appContext) { It seems strange ...
3 years, 11 months ago (2017-01-16 23:18:47 UTC) #29
timvolodine
https://codereview.chromium.org/2635693002/diff/200001/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java File android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java (right): https://codereview.chromium.org/2635693002/diff/200001/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java#newcode29 android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java:29: public static PlatformServiceBridge getInstance(Context appContext) { On 2017/01/16 23:18:47, ...
3 years, 11 months ago (2017-01-17 13:07:45 UTC) #30
Tobias Sargeant
On 2017/01/17 13:07:45, timvolodine wrote: > https://codereview.chromium.org/2635693002/diff/200001/android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java > File > android_webview/java/src/org/chromium/android_webview/PlatformServiceBridge.java > (right): > > ...
3 years, 11 months ago (2017-01-17 13:14:19 UTC) #31
sgurun-gerrit only
On 2017/01/17 13:14:19, Tobias Sargeant wrote: > On 2017/01/17 13:07:45, timvolodine wrote: > > > ...
3 years, 11 months ago (2017-01-17 18:13:53 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2635693002/240001
3 years, 11 months ago (2017-01-17 18:14:25 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/343303)
3 years, 11 months ago (2017-01-17 18:21:27 UTC) #36
paulmiller
https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java File android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java (right): https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java#newcode86 android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java:86: private void initSafeBrowsingApiHandler() { Wouldn't you rather use PlatformServiceBridge ...
3 years, 11 months ago (2017-01-17 21:45:01 UTC) #38
sgurun-gerrit only
Jialiu need LGTM for deps. https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java File android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java (right): https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java#newcode86 android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java:86: private void initSafeBrowsingApiHandler() { ...
3 years, 11 months ago (2017-01-17 22:59:50 UTC) #40
Jialiu Lin
lgtm
3 years, 11 months ago (2017-01-17 23:03:08 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2635693002/240001
3 years, 11 months ago (2017-01-17 23:05:09 UTC) #43
commit-bot: I haz the power
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/chromium/src/+/49207db970b2bff94d1ca2d0c2b3d5c7979a59c8
3 years, 11 months ago (2017-01-17 23:14:13 UTC) #46
paulmiller
3 years, 11 months ago (2017-01-18 00:58:03 UTC) #47
Message was sent while issue was closed.
https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/s...
File android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
(right):

https://codereview.chromium.org/2635693002/diff/240001/android_webview/java/s...
android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java:86:
private void initSafeBrowsingApiHandler() {
On 2017/01/17 22:59:50, sgurun wrote:
> On 2017/01/17 21:45:01, paulmiller wrote:
> > Wouldn't you rather use PlatformServiceBridge for this? The idea with
> > PlatformServiceBridge was that it'd be a generic way to connect to closed
GMS
> > code, which would keep the reflection ugliness isolated. (That's why we
picked
> > such a vague name.) This logic seems redundant.
> 
> I think it is not super important, we could do it in a follow up cl if there
is
> an advantage. Honestly, I don't see an immediate advantage now.

Come to think of it, PlatformServiceBridge doesn't just encapsulate the
reflection; it also encapsulates the call which allows WebView to use GMS in the
first place (see the downstream constructor). Remember, that's why we decided to
move the call from tryEnableGms to the constructor; so upstream code could just
use GMS through PlatformServiceBridge and not worry about the complexities of
the WebView/GMS interaction. I'll file a bug.

Powered by Google App Engine
This is Rietveld 408576698