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

Issue 2926473002: Mac Archive Type Sniffing (Closed)

Created:
3 years, 6 months ago by mortonm
Modified:
3 years, 5 months ago
CC:
chromium-reviews, grt+watch_chromium.org, vakh+watch_chromium.org, timvolodine
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Rather than simply relying on file extension (e.g. .DMG) to determine whether to extract DMG features from download, instead look at file metadata to check for existence of 'koly' signature which identifies Mac archive types. BUG=600392 >Review-Url: https://codereview.chromium.org/2926473002 >Cr-Commit-Position: refs/heads/master@{#480631} >Committed: >https://chromium.googlesource.com/chromium/src/+/6602ea616cce79869b300ffa82c3fc64fe422200 Review-Url: https://codereview.chromium.org/2926473002 Cr-Commit-Position: refs/heads/master@{#482463} Committed: https://chromium.googlesource.com/chromium/src/+/177cde5a7f2d95de6601f01e9bee8fdedf13a96b

Patch Set 1 #

Patch Set 2 : checkpoint #

Patch Set 3 : koly check compiling, not yet tested #

Patch Set 4 : removing unnecessary big endian conversions #

Patch Set 5 : removing comments #

Patch Set 6 : linker error with template stuff in posttaskandreplywithresult #

Patch Set 7 : updated build file #

Patch Set 8 : saving work #

Patch Set 9 : tester compiler error with destructor #

Patch Set 10 : adding tester file #

Patch Set 11 : restructured tester to take place on file thread #

Patch Set 12 : tests pass #

Patch Set 13 : testing all the disk image formats #

Patch Set 14 : added ParseTrailer() functionality to UDIFParser and switched to value-parameterized tests #

Patch Set 15 : simplified unit test since not parsing actual compressed data in DMGs #

Total comments: 18

Patch Set 16 : added check that ParseTrailer() is only called once #

Total comments: 4

Patch Set 17 : addressing comments #

Total comments: 2

Patch Set 18 : removed GetTrailer() function from UDIFParser #

Total comments: 5

Patch Set 19 : adding tester for download protection service #

Total comments: 8

Patch Set 20 : moving UDIFResourceFile definition back into .cc file #

Patch Set 21 : matching style #

Total comments: 11

Patch Set 22 : addressing comments #

Patch Set 23 : more addressing comments #

Patch Set 24 : minor edit to comment #

Total comments: 6

Patch Set 25 : adding comment to download protection unit test #

Total comments: 3

Patch Set 26 : simplifying code flow in download protection service unit test #

Patch Set 27 : adding switch for either only parse UDIF trailer or completely unpack archive #

Patch Set 28 : reading file directly #

Patch Set 29 : adding signature check file read and removing mods to UDIFParser #

Patch Set 30 : adding signature check file read and removing mods to UDIFParser #

Total comments: 10

Patch Set 31 : addressing comments #

Total comments: 6

Patch Set 32 : addressing comments. still have to rename mac_archive_type_sniffer #

Patch Set 33 : changing name of MacArchiveTypeSniffer to DiskImageTypeSnifferMac #

Patch Set 34 : changing name of tester #

Total comments: 12

Patch Set 35 : addressing comments #

Patch Set 36 : removing redundant DCHECK #

Patch Set 37 : revising DownloadProtectionServiceTest.TestDownloadItemDestroyed #

Patch Set 38 : adding ifdef for Mac in tester #

Patch Set 39 : debugging CQ failure #

Patch Set 40 : checkpoint #

Patch Set 41 : fixing bad commit #

Patch Set 42 : resolving merge conflict #

Patch Set 43 : avoiding multiple asynchronous calls in tester for mac #

Unified diffs Side-by-side diffs Delta from patch set Stats (+385 lines, -20 lines) Patch
M chrome/browser/safe_browsing/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/disk_image_type_sniffer_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/disk_image_type_sniffer_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/disk_image_type_sniffer_mac_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +106 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 3 chunks +30 lines, -0 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 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 12 chunks +136 lines, -20 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/test/data/safe_browsing/dmg/generate_test_data.sh View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +17 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 100 (61 generated)
mortonm
3 years, 6 months ago (2017-06-09 16:32:36 UTC) #7
Jialiu Lin
Good job! Mostly nits. https://codereview.chromium.org/2926473002/diff/270001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/270001/chrome/browser/safe_browsing/download_protection_service.cc#newcode801 chrome/browser/safe_browsing/download_protection_service.cc:801: } else { nit: curly ...
3 years, 6 months ago (2017-06-09 18:48:50 UTC) #11
mortonm
https://codereview.chromium.org/2926473002/diff/270001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/270001/chrome/browser/safe_browsing/download_protection_service.cc#newcode801 chrome/browser/safe_browsing/download_protection_service.cc:801: } else { On 2017/06/09 18:48:49, Jialiu Lin wrote: ...
3 years, 6 months ago (2017-06-09 19:47:21 UTC) #15
Robert Sesek
https://codereview.chromium.org/2926473002/diff/290001/chrome/utility/safe_browsing/mac/udif.cc File chrome/utility/safe_browsing/mac/udif.cc (right): https://codereview.chromium.org/2926473002/diff/290001/chrome/utility/safe_browsing/mac/udif.cc#newcode307 chrome/utility/safe_browsing/mac/udif.cc:307: trailer_successfully_parsed_ = ParseTrailer(); On 2017/06/09 19:47:21, mortonm wrote: > ...
3 years, 6 months ago (2017-06-09 20:02:32 UTC) #19
mortonm
https://codereview.chromium.org/2926473002/diff/290001/chrome/utility/safe_browsing/mac/udif.cc File chrome/utility/safe_browsing/mac/udif.cc (right): https://codereview.chromium.org/2926473002/diff/290001/chrome/utility/safe_browsing/mac/udif.cc#newcode307 chrome/utility/safe_browsing/mac/udif.cc:307: trailer_successfully_parsed_ = ParseTrailer(); On 2017/06/09 20:02:32, Robert Sesek wrote: ...
3 years, 6 months ago (2017-06-09 20:23:12 UTC) #22
Jialiu Lin
https://codereview.chromium.org/2926473002/diff/310001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/310001/chrome/browser/safe_browsing/download_protection_service.cc#newcode476 chrome/browser/safe_browsing/download_protection_service.cc:476: // Checks for existence of "koly" signature even if ...
3 years, 6 months ago (2017-06-09 20:24:18 UTC) #23
Robert Sesek
https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h#newcode26 chrome/utility/safe_browsing/mac/udif.h:26: #pragma pack(push, 1) Can this be left back in ...
3 years, 6 months ago (2017-06-09 21:46:20 UTC) #24
mortonm
https://codereview.chromium.org/2926473002/diff/310001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/310001/chrome/browser/safe_browsing/download_protection_service.cc#newcode476 chrome/browser/safe_browsing/download_protection_service.cc:476: // Checks for existence of "koly" signature even if ...
3 years, 6 months ago (2017-06-09 22:47:26 UTC) #25
mortonm
https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h#newcode26 chrome/utility/safe_browsing/mac/udif.h:26: #pragma pack(push, 1) On 2017/06/09 21:46:19, Robert Sesek wrote: ...
3 years, 6 months ago (2017-06-09 23:00:44 UTC) #26
mortonm
https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h#newcode26 chrome/utility/safe_browsing/mac/udif.h:26: #pragma pack(push, 1) On 2017/06/09 21:46:19, Robert Sesek wrote: ...
3 years, 6 months ago (2017-06-09 23:11:13 UTC) #27
vakh (use Gerrit instead)
https://codereview.chromium.org/2926473002/diff/350001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/350001/chrome/browser/safe_browsing/download_protection_service.cc#newcode479 chrome/browser/safe_browsing/download_protection_service.cc:479: BrowserThread::PostTaskAndReplyWithResult( qq: does this mean that the method goes ...
3 years, 6 months ago (2017-06-12 16:20:28 UTC) #30
mortonm
https://codereview.chromium.org/2926473002/diff/350001/chrome/browser/safe_browsing/download_protection_service.cc File chrome/browser/safe_browsing/download_protection_service.cc (right): https://codereview.chromium.org/2926473002/diff/350001/chrome/browser/safe_browsing/download_protection_service.cc#newcode479 chrome/browser/safe_browsing/download_protection_service.cc:479: BrowserThread::PostTaskAndReplyWithResult( On 2017/06/12 16:20:28, vakh (Varun Khaneja) wrote: > ...
3 years, 6 months ago (2017-06-12 16:35:54 UTC) #32
Robert Sesek
https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h#newcode26 chrome/utility/safe_browsing/mac/udif.h:26: #pragma pack(push, 1) On 2017/06/09 23:11:13, mortonm wrote: > ...
3 years, 6 months ago (2017-06-12 16:38:40 UTC) #33
mortonm
https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/330001/chrome/utility/safe_browsing/mac/udif.h#newcode26 chrome/utility/safe_browsing/mac/udif.h:26: #pragma pack(push, 1) On 2017/06/12 16:38:39, Robert Sesek wrote: ...
3 years, 6 months ago (2017-06-12 18:31:16 UTC) #34
mortonm
https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h#newcode53 chrome/utility/safe_browsing/mac/udif.h:53: bool ParseTrailer(); On 2017/06/12 18:31:16, mortonm wrote: > On ...
3 years, 6 months ago (2017-06-12 20:04:01 UTC) #35
Robert Sesek
https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h#newcode53 chrome/utility/safe_browsing/mac/udif.h:53: bool ParseTrailer(); On 2017/06/12 20:04:01, mortonm wrote: > On ...
3 years, 6 months ago (2017-06-12 20:52:36 UTC) #36
mortonm
https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h File chrome/utility/safe_browsing/mac/udif.h (right): https://codereview.chromium.org/2926473002/diff/390001/chrome/utility/safe_browsing/mac/udif.h#newcode53 chrome/utility/safe_browsing/mac/udif.h:53: bool ParseTrailer(); On 2017/06/12 20:52:34, Robert Sesek wrote: > ...
3 years, 6 months ago (2017-06-12 21:39:50 UTC) #37
Robert Sesek
https://codereview.chromium.org/2926473002/diff/470001/chrome/browser/safe_browsing/mac_archive_type_sniffer.cc File chrome/browser/safe_browsing/mac_archive_type_sniffer.cc (right): https://codereview.chromium.org/2926473002/diff/470001/chrome/browser/safe_browsing/mac_archive_type_sniffer.cc#newcode7 chrome/browser/safe_browsing/mac_archive_type_sniffer.cc:7: #include "chrome/utility/safe_browsing/mac/udif.h" On 2017/06/12 21:39:49, mortonm wrote: > On ...
3 years, 6 months ago (2017-06-13 15:52:55 UTC) #38
mortonm
On 2017/06/13 15:52:55, Robert Sesek wrote: > https://codereview.chromium.org/2926473002/diff/470001/chrome/browser/safe_browsing/mac_archive_type_sniffer.cc > File chrome/browser/safe_browsing/mac_archive_type_sniffer.cc (right): > > https://codereview.chromium.org/2926473002/diff/470001/chrome/browser/safe_browsing/mac_archive_type_sniffer.cc#newcode7 ...
3 years, 6 months ago (2017-06-13 16:56:57 UTC) #39
Robert Sesek
On 2017/06/13 16:56:57, mortonm wrote: > On 2017/06/13 15:52:55, Robert Sesek wrote: > > > ...
3 years, 6 months ago (2017-06-13 17:25:45 UTC) #40
mortonm
On 2017/06/13 17:25:45, Robert Sesek wrote: > On 2017/06/13 16:56:57, mortonm wrote: > > On ...
3 years, 6 months ago (2017-06-13 20:41:59 UTC) #41
mortonm
3 years, 6 months ago (2017-06-13 20:42:09 UTC) #42
Jialiu Lin
Looking good! Mostly nits. :-) https://codereview.chromium.org/2926473002/diff/560001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/560001/chrome/browser/BUILD.gn#newcode2407 chrome/browser/BUILD.gn:2407: if (is_mac) { nit: ...
3 years, 6 months ago (2017-06-13 20:55:38 UTC) #43
mortonm
https://codereview.chromium.org/2926473002/diff/560001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/560001/chrome/browser/BUILD.gn#newcode2407 chrome/browser/BUILD.gn:2407: if (is_mac) { On 2017/06/13 20:55:38, Jialiu Lin wrote: ...
3 years, 6 months ago (2017-06-13 22:09:44 UTC) #44
Robert Sesek
Last few comments! https://codereview.chromium.org/2926473002/diff/580001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/580001/chrome/browser/BUILD.gn#newcode2403 chrome/browser/BUILD.gn:2403: if (is_mac) { If you rename ...
3 years, 6 months ago (2017-06-13 22:18:56 UTC) #45
mortonm
Adding rkaplow@ for OWNER of: tools/metrics/histograms/histograms.xml https://codereview.chromium.org/2926473002/diff/580001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/580001/chrome/browser/BUILD.gn#newcode2403 chrome/browser/BUILD.gn:2403: if (is_mac) { ...
3 years, 6 months ago (2017-06-13 23:45:45 UTC) #47
Jialiu Lin
No more comments from me. LGTM :-)
3 years, 6 months ago (2017-06-13 23:49:10 UTC) #48
vakh (use Gerrit instead)
lgtm https://codereview.chromium.org/2926473002/diff/640001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/640001/chrome/browser/BUILD.gn#newcode2405 chrome/browser/BUILD.gn:2405: "safe_browsing/disk_image_type_sniffer_mac.cc", Optional but recommended: Add a target for ...
3 years, 6 months ago (2017-06-14 00:53:07 UTC) #49
Robert Sesek
LGTM with just a few nits. Thanks for bearing with us on the review :). ...
3 years, 6 months ago (2017-06-14 15:11:43 UTC) #50
mortonm
https://codereview.chromium.org/2926473002/diff/640001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/2926473002/diff/640001/chrome/browser/BUILD.gn#newcode2403 chrome/browser/BUILD.gn:2403: if (is_mac) { On 2017/06/14 15:11:43, Robert Sesek wrote: ...
3 years, 6 months ago (2017-06-14 17:13:16 UTC) #51
rkaplow
lgtm
3 years, 6 months ago (2017-06-14 18:55:16 UTC) #52
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/2926473002/660001
3 years, 6 months ago (2017-06-15 18:00:07 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/478120)
3 years, 6 months ago (2017-06-15 19:06:48 UTC) #57
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/2926473002/720001
3 years, 6 months ago (2017-06-19 23:24:51 UTC) #74
commit-bot: I haz the power
Committed patchset #38 (id:720001) as https://chromium.googlesource.com/chromium/src/+/6602ea616cce79869b300ffa82c3fc64fe422200
3 years, 6 months ago (2017-06-19 23:30:22 UTC) #77
findit-for-me
Findit (https://goo.gl/kROfz5) identified this CL at revision 480631 as the culprit for failures in the ...
3 years, 6 months ago (2017-06-20 01:21:10 UTC) #78
pdr.
On 2017/06/20 at 01:21:10, findit-for-me wrote: > Findit (https://goo.gl/kROfz5) identified this CL at revision 480631 ...
3 years, 6 months ago (2017-06-20 01:45:28 UTC) #79
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/2926473002/840001
3 years, 5 months ago (2017-06-26 23:36:45 UTC) #97
commit-bot: I haz the power
3 years, 5 months ago (2017-06-26 23:41:55 UTC) #100
Message was sent while issue was closed.
Committed patchset #43 (id:840001) as
https://chromium.googlesource.com/chromium/src/+/177cde5a7f2d95de6601f01e9bee...

Powered by Google App Engine
This is Rietveld 408576698