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

Issue 551132: AU: Extent writer utility classes (Closed)

Created:
10 years, 11 months ago by adlr
Modified:
6 years ago
Reviewers:
Daniel Erat
CC:
chromium-os-reviews_googlegroups.com
Visibility:
Public.

Description

AU: Extent writer utility classes These are similar to the FileWriter classes, but focus on writing to extents within a file (or device) rather than writing a file in order. Again there is a ExtentWriter interface from which all types of extent writers interit. There are also two basic extent writers: a direct extent writer that writes data directly to the file descriptor, and a zero padding extent writer that piggy-backs on another extent writer. When the zero-padding extent writer is End()ed, it fills out the rest of the extent with zeros. Also, BzipExtentWriter: an ExtentWriter concrete subclass that writes to another ExtentWriter. BzipExtentWriter bzip2 decompresses all data passed through.

Patch Set 1 #

Total comments: 32

Patch Set 2 : fixes for review #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+699 lines, -6 lines) Patch
M src/platform/update_engine/SConstruct View 2 chunks +5 lines, -1 line 0 comments Download
A src/platform/update_engine/bzip_extent_writer.h View 1 1 chunk +38 lines, -0 lines 2 comments Download
A src/platform/update_engine/bzip_extent_writer.cc View 1 1 chunk +75 lines, -0 lines 2 comments Download
A src/platform/update_engine/bzip_extent_writer_unittest.cc View 1 chunk +121 lines, -0 lines 2 comments Download
A src/platform/update_engine/extent_writer.h View 1 1 chunk +125 lines, -0 lines 0 comments Download
A src/platform/update_engine/extent_writer.cc View 1 1 chunk +67 lines, -0 lines 0 comments Download
A src/platform/update_engine/extent_writer_unittest.cc View 1 1 chunk +252 lines, -0 lines 4 comments Download
M src/platform/update_engine/test_utils.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/platform/update_engine/test_utils.cc View 1 chunk +14 lines, -5 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
adlr
10 years, 11 months ago (2010-01-23 00:35:46 UTC) #1
Daniel Erat
I haven't looked at the tests in much detail. http://codereview.chromium.org/551132/diff/1/2 File src/package_repo/package-list-dev.txt (right): http://codereview.chromium.org/551132/diff/1/2#newcode63 src/package_repo/package-list-dev.txt:63: ...
10 years, 11 months ago (2010-01-23 02:13:50 UTC) #2
adlr
http://codereview.chromium.org/551132/diff/1/2 File src/package_repo/package-list-dev.txt (right): http://codereview.chromium.org/551132/diff/1/2#newcode63 src/package_repo/package-list-dev.txt:63: libbz2-dev On 2010/01/23 02:13:50, Daniel Erat wrote: > can ...
10 years, 10 months ago (2010-02-02 22:53:12 UTC) #3
Daniel Erat
LGTM http://codereview.chromium.org/551132/diff/5001/5003 File src/platform/update_engine/bzip_extent_writer.cc (right): http://codereview.chromium.org/551132/diff/5001/5003#newcode61 src/platform/update_engine/bzip_extent_writer.cc:61: new_input_buffer.insert(new_input_buffer.end(), i think you can just pass the ...
10 years, 10 months ago (2010-02-03 02:12:24 UTC) #4
adlr
10 years, 10 months ago (2010-02-04 22:25:37 UTC) #5
fixed and submitted. thanks!

http://codereview.chromium.org/551132/diff/5001/5003
File src/platform/update_engine/bzip_extent_writer.cc (right):

http://codereview.chromium.org/551132/diff/5001/5003#newcode61
src/platform/update_engine/bzip_extent_writer.cc:61:
new_input_buffer.insert(new_input_buffer.end(),
On 2010/02/03 02:12:24, Daniel Erat wrote:
> i think you can just pass the two iterators to the c'tor and skip calling
> insert()

Done.

http://codereview.chromium.org/551132/diff/5001/5004
File src/platform/update_engine/bzip_extent_writer.h (right):

http://codereview.chromium.org/551132/diff/5001/5004#newcode13
src/platform/update_engine/bzip_extent_writer.h:13: // BzipExtentWriter is a
concrete ExtentWriter subclass that bzip decompresses
On 2010/02/03 02:12:24, Daniel Erat wrote:
> s/bzip decompresses/bzip-decompresses/
> 
> (just 'cause i misparse this every time i read it otherwise)

Done.

http://codereview.chromium.org/551132/diff/5001/5005
File src/platform/update_engine/bzip_extent_writer_unittest.cc (right):

http://codereview.chromium.org/551132/diff/5001/5005#newcode72
src/platform/update_engine/bzip_extent_writer_unittest.cc:72: ssize_t rc =
pread(fd(), buf, sizeof(buf) - 1, 0);
On 2010/02/03 02:12:24, Daniel Erat wrote:
> rename 'rc' to something like 'bytes_read'

Done.

http://codereview.chromium.org/551132/diff/5001/5008
File src/platform/update_engine/extent_writer_unittest.cc (right):

http://codereview.chromium.org/551132/diff/5001/5008#newcode42
src/platform/update_engine/extent_writer_unittest.cc:42: void
WriteAlignedExtents(size_t chunk_size, size_t first_chunk_size);
On 2010/02/03 02:12:24, Daniel Erat wrote:
> add brief comments describing what these methods do

Done.

http://codereview.chromium.org/551132/diff/5001/5008#newcode247
src/platform/update_engine/extent_writer_unittest.cc:247:
//EXPECT_EQ(expected_data[0], resultant_data[0]);
On 2010/02/03 02:12:24, Daniel Erat wrote:
> why are these commented out?

Oops. they were helpful when the test was failing, but redundant when it passes.
removed these lines.

Powered by Google App Engine
This is Rietveld 408576698