New issue
Advanced search Search tips

Issue 735602 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocked on:
issue 543161



Sign in to add a comment

Consider making SafeBrowsingDatabaseManager a pure virtual interface

Project Member Reported by csharrison@chromium.org, Jun 21 2017

Issue description

kmarshall hit some problems with the subresource filter FakeSafeBrowsingDatabaseManager actually being not a true fake, and it inherited some of the implementation's deletion thread affinity which was confusing and not necessary.

Ideally, it would be nice for SafeBrowsingDatabaseManager itself to be a pure interface so our fake could implement it and be as simple as possible. Then the current SafeBrowsingDatabaseManager could be SafeBrowsingDatabaseManagerImpl or something like that.
 
Cc: vakh@chromium.org
Labels: OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
The short term fix might be to inherit from TestSafeBrowsingDatabaseManager instead, and ensure that has only methods that call NOTREACHED(). I guess there could still be affects from the ctor/dtor.  Was that the issue?

Longer term, this could definitely be refactored. The current tree looks like this:

SBDbM: 80% is pure virtual, but 20% implements the API Blacklisting code used by desktop+android
\-
  TestSBDbM: Implements all pure-virtual functions with NOTREACHED()
  RemoteSBDbM: Implements a few methods (with calls to GMSCore), and the rest are NOTREACHED().
  LocalSBDbM: Implements desktop V3 DbM.
  V4SBDbM: Implements desktop v4 DbM.

We should find a better way to compose the shared functionality of the Remote/V4 implementations, so the parent class could be a pure interface. We could either use several layers of inheritance (ick), or put the API Blacklisting code in a separate class and have the Remote/V4 impls delegate to that.  That's just a little more code, but much easier to understand.
Yes I believe the issue was in destruction logic. We do already inherit from TestSafeBrowsingDatabaseManager for our fake implementation.

Comment 3 by vakh@chromium.org, Jun 30 2017

Blockedon: 543161
Labels: SafeBrowsing-Triaged
Owner: vakh@chromium.org
Status: Assigned (was: Untriaged)

Comment 4 by est...@chromium.org, Nov 10 2017

Labels: Hotlist-EnamelAndFriendsFixIt

Comment 5 by est...@chromium.org, Feb 18 2018

Labels: -Hotlist-EnamelAndFriendsFixIt

Sign in to add a comment