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

Issue 1726403006: Switch Safe Browsing's metadata from string to struct. (Closed)

Created:
4 years, 10 months ago by Nathan Parker
Modified:
4 years, 10 months ago
Reviewers:
Lei Zhang, mattm
CC:
chromium-reviews, grt+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch Safe Browsing's metadata from string to struct. This is needed so we can add more types to it. This CL plumbs through the struct but keeps the string in-tact. This is backward compatible with clank/'s current implementation. I've added parsing methods in the appropriate place in the stack: - For Pver4: v4_get_hash_protocol_manager.cc - For XLB: safe_browsing_api_handler_util.cc - For Pver3: protocol_parser.cc [separate CL] The next two CLs: - Switch clank/ to use the struct. https://chrome-internal-review.googlesource.com/#/c/249571/ - Enable parsing for Pver3, switch ui_manager.cc to use the parsed values, and clean up. BUG=589610 Committed: https://crrev.com/c7614e617a9a7830a6b0da02701b0340699566b3 Cr-Commit-Position: refs/heads/master@{#378082}

Patch Set 1 #

Patch Set 2 : made clank buildable w/o simultaneous patch #

Patch Set 3 : fix safe_browsing_service_browsertest and update components_tests.gyp #

Total comments: 6

Patch Set 4 : Fix mattm's comments #

Total comments: 3

Patch Set 5 : Fix ParseJson in test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+301 lines, -77 lines) Patch
M chrome/browser/renderer_host/safe_browsing_resource_throttle.h View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/safe_browsing_resource_throttle.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/local_database_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_parser.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_parser_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/ui_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/ui_manager.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/components_tests.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/safe_browsing_db/database_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M components/safe_browsing_db/remote_database_manager.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M components/safe_browsing_db/safe_browsing_api_handler.h View 1 1 chunk +13 lines, -2 lines 0 comments Download
M components/safe_browsing_db/safe_browsing_api_handler.cc View 1 2 chunks +25 lines, -0 lines 0 comments Download
M components/safe_browsing_db/safe_browsing_api_handler_unittest.cc View 1 2 3 4 3 chunks +44 lines, -24 lines 0 comments Download
M components/safe_browsing_db/safe_browsing_api_handler_util.h View 1 2 3 1 chunk +6 lines, -4 lines 0 comments Download
M components/safe_browsing_db/safe_browsing_api_handler_util.cc View 1 2 3 3 chunks +96 lines, -13 lines 0 comments Download
A components/safe_browsing_db/testing_util.h View 1 1 chunk +38 lines, -0 lines 0 comments Download
M components/safe_browsing_db/util.h View 1 2 3 2 chunks +32 lines, -1 line 0 comments Download
M components/safe_browsing_db/util.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M components/safe_browsing_db/v4_get_hash_protocol_manager.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/safe_browsing_db/v4_get_hash_protocol_manager_unittest.cc View 1 4 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 26 (13 generated)
Nathan Parker
thestig: Please review changes in safe_browsing_resource_throttle.* mattm: Please review everything else. Thanks!
4 years, 10 months ago (2016-02-26 00:56:09 UTC) #8
mattm
https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/safe_browsing_api_handler_util.h File components/safe_browsing_db/safe_browsing_api_handler_util.h (right): https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/safe_browsing_api_handler_util.h#newcode50 components/safe_browsing_db/safe_browsing_api_handler_util.h:50: UmaRemoteCallResult ParseJson(const std::string& metadata_str, less generic name https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/util.h File ...
4 years, 10 months ago (2016-02-26 02:32:23 UTC) #9
Lei Zhang
On 2016/02/26 00:56:09, nparker wrote: > thestig: Please review changes in safe_browsing_resource_throttle.* lgtm
4 years, 10 months ago (2016-02-26 02:36:54 UTC) #10
Nathan Parker
https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/util.h File components/safe_browsing_db/util.h (right): https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/util.h#newcode66 components/safe_browsing_db/util.h:66: struct ThreatMetadata { On 2016/02/26 02:32:23, mattm wrote: > ...
4 years, 10 months ago (2016-02-26 18:54:48 UTC) #11
mattm
https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/util.h File components/safe_browsing_db/util.h (right): https://codereview.chromium.org/1726403006/diff/120001/components/safe_browsing_db/util.h#newcode66 components/safe_browsing_db/util.h:66: struct ThreatMetadata { On 2016/02/26 18:54:48, nparker wrote: > ...
4 years, 10 months ago (2016-02-26 23:23:20 UTC) #12
Nathan Parker
PTAL https://codereview.chromium.org/1726403006/diff/140001/components/safe_browsing_db/safe_browsing_api_handler_unittest.cc File components/safe_browsing_db/safe_browsing_api_handler_unittest.cc (right): https://codereview.chromium.org/1726403006/diff/140001/components/safe_browsing_db/safe_browsing_api_handler_unittest.cc#newcode22 components/safe_browsing_db/safe_browsing_api_handler_unittest.cc:22: return ParseJson(json, &threat_, &meta_); On 2016/02/26 23:23:19, mattm ...
4 years, 10 months ago (2016-02-26 23:34:52 UTC) #13
mattm
lgtm https://codereview.chromium.org/1726403006/diff/140001/components/safe_browsing_db/safe_browsing_api_handler_unittest.cc File components/safe_browsing_db/safe_browsing_api_handler_unittest.cc (right): https://codereview.chromium.org/1726403006/diff/140001/components/safe_browsing_db/safe_browsing_api_handler_unittest.cc#newcode22 components/safe_browsing_db/safe_browsing_api_handler_unittest.cc:22: return ParseJson(json, &threat_, &meta_); On 2016/02/26 23:34:52, nparker ...
4 years, 10 months ago (2016-02-26 23:43:24 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1726403006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1726403006/160001
4 years, 10 months ago (2016-02-26 23:48:11 UTC) #17
Nathan Parker
Filed https://bugs.chromium.org/p/chromium/issues/detail?id=590389 , though I'm not sure I have the right labels to have it ...
4 years, 10 months ago (2016-02-26 23:55:19 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/122748)
4 years, 10 months ago (2016-02-27 01:12:19 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1726403006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1726403006/160001
4 years, 10 months ago (2016-02-27 01:21:43 UTC) #22
commit-bot: I haz the power
Committed patchset #5 (id:160001)
4 years, 10 months ago (2016-02-27 02:12:37 UTC) #24
commit-bot: I haz the power
4 years, 10 months ago (2016-02-27 02:14:50 UTC) #26
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/c7614e617a9a7830a6b0da02701b0340699566b3
Cr-Commit-Position: refs/heads/master@{#378082}

Powered by Google App Engine
This is Rietveld 408576698