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

Issue 179963002: New Zip::ZipFromMemory API. (Closed)

Created:
6 years, 10 months ago by João Eiras
Modified:
6 years, 6 months ago
Reviewers:
satorux1, hshi1
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

=== First commit === New ZipReader::ExtractCurrentEntryToRefCountedMemory API. New API which extract a zip entry into a memory buffer. A bug in unzip.c was fixed that would cause uncompressing a file bigger than the uncompressed size declared in the zip file's metadata to fail with a CRC error. === Second commit === New Zip::ZipFromMemory API. New API which allows a zip file to be modified (files added, replaced and removed) from memory, without having to do a round trip to the disk. Unfortunatelly, minizip does not support replacing or removing files from a zip archive, therefore when that needs to happen, the file is recreated from scratch. === Third commit === Use Zip::ZipFromMemory in a couple places. Removed unused references to zip.h ====== TEST=out/Release/unit_tests --gtest_filter=Zip*

Patch Set 1 : First commit: New ZipReader::ExtractCurrentEntryToRefCountedMemory API #

Patch Set 2 : Second commit: New Zip::ZipFromMemory API #

Patch Set 3 : Third commit: Use Zip::ZipFromMemory in a couple places #

Patch Set 4 : fixup! Second commit: New Zip::ZipFromMemory API #

Patch Set 5 : fixup! New Zip::ZipFromMemory API. #

Total comments: 12

Patch Set 6 : Move code to zip_writer, add ExtractCurrentEntryToString #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 4

Patch Set 9 : addressing comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+849 lines, -97 lines) Patch
M chrome/browser/component_updater/component_patcher_operation.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/image_writer_private/operation_linux.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/feedback/feedback_util.cc View 1 2 3 4 5 2 chunks +4 lines, -11 lines 0 comments Download
M chrome/browser/safe_browsing/download_protection_service_unittest.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -12 lines 2 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/zlib/contrib/minizip/unzip.c View 1 chunk +0 lines, -5 lines 1 comment Download
A third_party/zlib/google/test/data/test_mismatch_size.zip View Binary file 0 comments Download
M third_party/zlib/google/zip.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/zlib/google/zip.cc View 1 2 3 4 5 6 7 8 4 chunks +5 lines, -61 lines 0 comments Download
M third_party/zlib/google/zip.gyp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/zlib/google/zip_internal.h View 1 2 3 4 5 4 chunks +44 lines, -1 line 1 comment Download
M third_party/zlib/google/zip_internal.cc View 1 2 3 4 5 4 chunks +298 lines, -2 lines 0 comments Download
M third_party/zlib/google/zip_reader.h View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -1 line 0 comments Download
M third_party/zlib/google/zip_reader.cc View 1 2 3 4 5 6 7 8 2 chunks +75 lines, -1 line 0 comments Download
M third_party/zlib/google/zip_reader_unittest.cc View 1 2 3 4 5 6 7 3 chunks +44 lines, -1 line 0 comments Download
M third_party/zlib/google/zip_unittest.cc View 2 3 4 5 2 chunks +30 lines, -0 lines 0 comments Download
A third_party/zlib/google/zip_writer.h View 1 2 3 4 5 6 7 8 1 chunk +116 lines, -0 lines 0 comments Download
A third_party/zlib/google/zip_writer.cc View 1 2 3 4 5 6 7 8 1 chunk +81 lines, -0 lines 0 comments Download
A third_party/zlib/google/zip_writer_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +123 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
João Eiras
So, this is the review I told by e-mail. I pushed each commit separately so ...
6 years, 10 months ago (2014-02-25 15:20:53 UTC) #1
satorux1
Took a quick look. Here's high level comments: 1) I think ability to manipulate zip ...
6 years, 10 months ago (2014-02-26 04:05:46 UTC) #2
João Eiras
On 2014/02/26 04:05:46, satorux at chromium.org wrote: > Took a quick look. Here's high level ...
6 years, 10 months ago (2014-02-26 17:35:27 UTC) #3
João Eiras
https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c File third_party/zlib/contrib/minizip/unzip.c (left): https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c#oldcode1711 third_party/zlib/contrib/minizip/unzip.c:1711: (uInt)pfile_in_zip_read_info->rest_read_uncompressed; On 2014/02/26 04:05:47, satorux at chromium.org wrote: > ...
6 years, 10 months ago (2014-02-26 17:35:38 UTC) #4
satorux1
https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c File third_party/zlib/contrib/minizip/unzip.c (left): https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c#oldcode1711 third_party/zlib/contrib/minizip/unzip.c:1711: (uInt)pfile_in_zip_read_info->rest_read_uncompressed; On 2014/02/26 17:35:38, João Eiras wrote: > On ...
6 years, 10 months ago (2014-02-27 06:57:00 UTC) #5
satorux1
https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/google/zip_reader.h File third_party/zlib/google/zip_reader.h (right): https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/google/zip_reader.h#newcode201 third_party/zlib/google/zip_reader.h:201: base::RefCountedMemory** output) const; On 2014/02/27 06:57:00, satorux at chromium.org ...
6 years, 9 months ago (2014-02-27 16:39:02 UTC) #6
João Eiras
> > Which APIs would belong there then ? All the zip::Zip* functions ? > ...
6 years, 9 months ago (2014-02-27 17:12:01 UTC) #7
João Eiras
https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c File third_party/zlib/contrib/minizip/unzip.c (left): https://codereview.chromium.org/179963002/diff/70001/third_party/zlib/contrib/minizip/unzip.c#oldcode1711 third_party/zlib/contrib/minizip/unzip.c:1711: (uInt)pfile_in_zip_read_info->rest_read_uncompressed; On 2014/02/27 06:57:00, satorux at chromium.org wrote: > ...
6 years, 9 months ago (2014-02-27 17:12:17 UTC) #8
satorux1
On 2014/02/27 17:12:01, João Eiras wrote: > > > Which APIs would belong there then ...
6 years, 9 months ago (2014-02-27 17:22:10 UTC) #9
João Eiras
Ping :)
6 years, 9 months ago (2014-03-19 13:21:44 UTC) #10
João Eiras
On 2014/03/19 13:21:44, João Eiras wrote: > Ping :)
6 years, 9 months ago (2014-03-19 13:23:08 UTC) #11
João Eiras
On 2014/03/19 13:23:08, João Eiras wrote: > On 2014/03/19 13:21:44, João Eiras wrote: > > ...
6 years, 9 months ago (2014-03-19 13:23:57 UTC) #12
hshi1
https://codereview.chromium.org/179963002/diff/130001/third_party/zlib/google/zip.cc File third_party/zlib/google/zip.cc (right): https://codereview.chromium.org/179963002/diff/130001/third_party/zlib/google/zip.cc#newcode190 third_party/zlib/google/zip.cc:190: iter != src_relative_paths.end() && success; ++iter) { the "&& ...
6 years, 9 months ago (2014-03-19 17:33:26 UTC) #13
João Eiras
https://codereview.chromium.org/179963002/diff/130001/third_party/zlib/google/zip_reader.h File third_party/zlib/google/zip_reader.h (right): https://codereview.chromium.org/179963002/diff/130001/third_party/zlib/google/zip_reader.h#newcode196 third_party/zlib/google/zip_reader.h:196: int max_read_bytes, On 2014/03/19 17:33:27, hshi1 wrote: > question: ...
6 years, 9 months ago (2014-03-20 13:52:45 UTC) #14
satorux1
6 years, 9 months ago (2014-03-24 06:16:07 UTC) #15
Sorry for the belated response. I took a quick look. Overall the code looked
good but the patch was a bit too big. Could you split this into smaller patches?
That'd be easier to review.

1) the fix in third_party/zlib/contrib/minizip/unzip.c

2) moving of code to zip_internal.h/cc

3) very minor changes like removing thid_party/zlib/google/zip.h from files that
don't need this header file

4) introduction of zip_writer.h/cc

5) new features

https://codereview.chromium.org/179963002/diff/150001/chrome/browser/safe_bro...
File chrome/browser/safe_browsing/download_protection_service_unittest.cc
(right):

https://codereview.chromium.org/179963002/diff/150001/chrome/browser/safe_bro...
chrome/browser/safe_browsing/download_protection_service_unittest.cc:712:
base::StringPiece("dummy file", 10));
please drop ", 10". this should be unnecessary.

https://codereview.chromium.org/179963002/diff/150001/chrome/browser/safe_bro...
chrome/browser/safe_browsing/download_protection_service_unittest.cc:726:
base::StringPiece("dummy file", 10));
ditto

https://codereview.chromium.org/179963002/diff/150001/third_party/zlib/contri...
File third_party/zlib/contrib/minizip/unzip.c (left):

https://codereview.chromium.org/179963002/diff/150001/third_party/zlib/contri...
third_party/zlib/contrib/minizip/unzip.c:1711:
(uInt)pfile_in_zip_read_info->rest_read_uncompressed;
please create a separate patch for this change.

https://codereview.chromium.org/179963002/diff/150001/third_party/zlib/google...
File third_party/zlib/google/zip_internal.h (right):

https://codereview.chromium.org/179963002/diff/150001/third_party/zlib/google...
third_party/zlib/google/zip_internal.h:98: 
Could you create a separate patch for this?

Powered by Google App Engine
This is Rietveld 408576698