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

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed)

Created:
5 years, 8 months ago by Nathan Parker
Modified:
5 years, 7 months ago
Reviewers:
Nico, mattm, scottmg
CC:
chromium-reviews, davidben+watch_chromium.org, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, tburkard+watch_chromium.org, grt+watch_chromium.org, gavinp+prer_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Split to SafeBrowsingDatabaseManager into Local* and Remote*. SafeBrowsingDatabaseManager: Pure interface TestSafeBrowsingDatabaseManager: Dummy impl for tests LocalSafeBrowsingDatabaseManager: Existing full impl. RemoteSafeBrowsingDatabaseManager: New for Android Wire up the safe_browsing=3 build-mode to switch Android to use Remote*. Move SafeBrowsingCheck into Local* and create the Test* impl that can't accidentally call a real implementation's methods. Adjust tests to use either Test* or Local*. The initial implementation of Remote* does the bookeeping of requests, but doesn't yet make calls to Java and isn't tested. BUG=474608 Committed: https://crrev.com/b2cd5eef530be7100274af882af3f5aff4d1c4be Cr-Commit-Position: refs/heads/master@{#329551}

Patch Set 1 #

Patch Set 2 : fix refptr visibility #

Patch Set 3 : Fix delegate interface #

Patch Set 4 : Fix up tests #

Patch Set 5 : nits and rebase #

Patch Set 6 : fix mismerge #

Total comments: 19

Patch Set 7 : Refactor API handler, respond to review #

Patch Set 8 : extend test db manager to fix browser tests #

Total comments: 16

Patch Set 9 : Renable SafeBrowsingServiceTest.StartAndStop. Oddly it fails at HEAD for me. #

Patch Set 10 : rebase #

Patch Set 11 : Move delegate mgmt to sb service. Use weak_ptr for ClientRequest #

Total comments: 25

Patch Set 12 : Rebase #

Patch Set 13 : Respond to review #

Patch Set 14 : Fix a few comments #

Total comments: 4

Patch Set 15 : Respond to review. Tweak comments and list initializer. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+961 lines, -2002 lines) Patch
M build/common.gypi View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +13 lines, -5 lines 0 comments Download
M build/config/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M build/config/features.gni View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/fake_safe_browsing_database_manager.h View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/fake_safe_browsing_database_manager.cc View 1 2 3 4 5 6 3 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +13 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 2 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle.cc View 1 chunk +0 lines, -6 lines 2 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc View 3 chunks +6 lines, -6 lines 0 comments Download
A chrome/browser/safe_browsing/android_safe_browsing_api_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +71 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc View 1 2 3 4 5 6 10 11 3 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/safe_browsing/client_side_detection_host_unittest.cc View 1 2 3 3 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/safe_browsing/database_manager.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +23 lines, -308 lines 0 comments Download
D chrome/browser/safe_browsing/database_manager.cc View 1 chunk +0 lines, -1114 lines 0 comments Download
D chrome/browser/safe_browsing/database_manager_unittest.cc View 1 chunk +0 lines, -231 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +16 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc View 1 2 3 3 chunks +4 lines, -9 lines 0 comments Download
A + chrome/browser/safe_browsing/local_database_manager.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +50 lines, -115 lines 0 comments Download
A + chrome/browser/safe_browsing/local_database_manager.cc View 1 2 3 4 5 6 7 8 9 10 43 chunks +118 lines, -105 lines 0 comments Download
A + chrome/browser/safe_browsing/local_database_manager_unittest.cc View 4 chunks +17 lines, -17 lines 0 comments Download
A chrome/browser/safe_browsing/remote_database_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +71 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/remote_database_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +211 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +20 lines, -6 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +38 lines, -10 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +21 lines, -7 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_test.cc View 1 2 3 4 5 6 5 chunks +16 lines, -2 lines 0 comments Download
A chrome/browser/safe_browsing/test_database_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/test_database_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +90 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +23 lines, -4 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 22 (4 generated)
Nathan Parker
Hi Matt -- Please start with the *DatabaseManager classes since I'm still picking off some ...
5 years, 7 months ago (2015-04-29 00:34:07 UTC) #2
mattm
https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc File chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc (right): https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc#newcode27 chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc:27: RemoteSafeBrowsingDatabaseManager::ClientRequest* client_request) { I find the split of ClientRequests ...
5 years, 7 months ago (2015-04-29 22:59:59 UTC) #3
Nathan Parker
Thanks for the review, Matt! PTAL. I've added a delayed callback to simulate the Java ...
5 years, 7 months ago (2015-05-04 21:17:19 UTC) #4
mattm
https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/database_manager.h File chrome/browser/safe_browsing/database_manager.h (right): https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/database_manager.h#newcode121 chrome/browser/safe_browsing/database_manager.h:121: virtual SafeBrowsingProtocolManagerDelegate* GetProtocolManagerDelegate() = 0; On 2015/05/04 21:17:18, nparker ...
5 years, 7 months ago (2015-05-06 02:42:46 UTC) #5
Nathan Parker
PTAL. Thanks for the suggestions, this is much improved. https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/database_manager.h File chrome/browser/safe_browsing/database_manager.h (right): https://codereview.chromium.org/1110723002/diff/100001/chrome/browser/safe_browsing/database_manager.h#newcode121 chrome/browser/safe_browsing/database_manager.h:121: ...
5 years, 7 months ago (2015-05-06 22:27:36 UTC) #6
Nathan Parker
thakis@chromium.org: Please review changes in chrome/browser/ excluding safe_browsing (mattm has those) scottmg@chromium.org: Please review changes ...
5 years, 7 months ago (2015-05-06 22:47:09 UTC) #8
scottmg
build/ lgtm
5 years, 7 months ago (2015-05-06 23:00:24 UTC) #9
mattm
https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc File chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc (right): https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc#newcode33 chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc:33: // will delete this ptr, thus releasing the internal ...
5 years, 7 months ago (2015-05-08 02:17:26 UTC) #10
Nathan Parker
Thanks for the review. PTAL. https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc File chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc (right): https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc#newcode33 chrome/browser/safe_browsing/android_safe_browsing_api_handler.cc:33: // will delete this ...
5 years, 7 months ago (2015-05-12 01:04:02 UTC) #11
mattm
https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/remote_database_manager.h File chrome/browser/safe_browsing/remote_database_manager.h (right): https://codereview.chromium.org/1110723002/diff/200001/chrome/browser/safe_browsing/remote_database_manager.h#newcode26 chrome/browser/safe_browsing/remote_database_manager.h:26: // Need to initialize before using. On 2015/05/12 01:04:01, ...
5 years, 7 months ago (2015-05-12 07:00:41 UTC) #12
Nathan Parker
Done. https://codereview.chromium.org/1110723002/diff/260001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.h File chrome/browser/safe_browsing/android_safe_browsing_api_handler.h (right): https://codereview.chromium.org/1110723002/diff/260001/chrome/browser/safe_browsing/android_safe_browsing_api_handler.h#newcode1 chrome/browser/safe_browsing/android_safe_browsing_api_handler.h:1: // Copyright (c) 2015 The Chromium Authors. All ...
5 years, 7 months ago (2015-05-12 18:23:20 UTC) #13
mattm
lgtm
5 years, 7 months ago (2015-05-12 20:34:15 UTC) #14
Nathan Parker
thakis@ -- Can you review the following files? Thanks. chrome/browser/extensions/fake_safe_browsing_database_manager.h chrome/browser/extensions/fake_safe_browsing_database_manager.cc chrome/browser/prerender/prerender_browsertest.cc chrome/browser/profiles/profile_impl.cc chrome/browser/renderer_host/safe_browsing_resource_throttle.cc chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h ...
5 years, 7 months ago (2015-05-12 22:14:41 UTC) #15
Nico
lgtm except that I don't understand the finch changes. (feng, who added them, is no ...
5 years, 7 months ago (2015-05-13 00:07:23 UTC) #16
Nathan Parker
Thanks. https://codereview.chromium.org/1110723002/diff/280001/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (left): https://codereview.chromium.org/1110723002/diff/280001/chrome/browser/profiles/profile_impl.cc#oldcode839 chrome/browser/profiles/profile_impl.cc:839: // for users enrolled in Finch trial before. ...
5 years, 7 months ago (2015-05-13 00:11:23 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1110723002/280001
5 years, 7 months ago (2015-05-13 00:13:06 UTC) #20
commit-bot: I haz the power
Committed patchset #15 (id:280001)
5 years, 7 months ago (2015-05-13 01:12:19 UTC) #21
commit-bot: I haz the power
5 years, 7 months ago (2015-05-13 01:13:20 UTC) #22
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/b2cd5eef530be7100274af882af3f5aff4d1c4be
Cr-Commit-Position: refs/heads/master@{#329551}

Powered by Google App Engine
This is Rietveld 408576698