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

Issue 1718001: AU: Class to perform delta updates. (Closed)

Created:
10 years, 8 months ago by adlr
Modified:
9 years ago
Reviewers:
Daniel Erat
CC:
chromium-os-reviews_chromium.org, dneiss, adlr
Visibility:
Public.

Description

AU: Class to perform delta updates. A class to perform delta updates and the associated unittests. Also, change the delta diff generator executable to be able to apply a delta, which is handy for debugging. TEST=Attached unit test, hand-tested on real build images BUG=552

Patch Set 1 #

Total comments: 72

Patch Set 2 : fixes for review #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+880 lines, -261 lines) Patch
M src/platform/update_engine/SConstruct View 3 chunks +2 lines, -7 lines 0 comments Download
M src/platform/update_engine/bzip_extent_writer.h View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/bzip_extent_writer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/bzip_extent_writer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/cycle_breaker.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/platform/update_engine/cycle_breaker_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/delta_diff_generator.h View 1 chunk +6 lines, -0 lines 2 comments Download
M src/platform/update_engine/delta_diff_generator.cc View 1 10 chunks +19 lines, -22 lines 0 comments Download
M src/platform/update_engine/delta_diff_generator_unittest.cc View 1 3 chunks +6 lines, -5 lines 0 comments Download
D src/platform/update_engine/delta_diff_parser.h View 1 chunk +0 lines, -14 lines 0 comments Download
D src/platform/update_engine/delta_diff_parser.cc View 1 chunk +0 lines, -9 lines 0 comments Download
D src/platform/update_engine/delta_diff_parser_unittest.cc View 1 chunk +0 lines, -2 lines 0 comments Download
A src/platform/update_engine/delta_performer.h View 1 1 chunk +98 lines, -0 lines 0 comments Download
A src/platform/update_engine/delta_performer.cc View 1 1 chunk +377 lines, -0 lines 0 comments Download
A src/platform/update_engine/delta_performer_unittest.cc View 1 1 chunk +194 lines, -0 lines 0 comments Download
M src/platform/update_engine/extent_mapper.h View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/extent_mapper.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/platform/update_engine/extent_mapper_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M src/platform/update_engine/extent_writer.h View 1 2 chunks +1 line, -5 lines 0 comments Download
M src/platform/update_engine/extent_writer.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/platform/update_engine/extent_writer_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/platform/update_engine/file_writer.h View 4 chunks +8 lines, -0 lines 0 comments Download
M src/platform/update_engine/filesystem_copier_action.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/generate_delta_main.cc View 4 chunks +27 lines, -0 lines 2 comments Download
M src/platform/update_engine/graph_types.h View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/graph_utils.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/platform/update_engine/graph_utils.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M src/platform/update_engine/set_bootable_flag_action_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/platform/update_engine/subprocess.h View 1 chunk +4 lines, -4 lines 0 comments Download
M src/platform/update_engine/subprocess.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/platform/update_engine/subprocess_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
D src/platform/update_engine/test_installer_main.cc View 1 chunk +0 lines, -157 lines 0 comments Download
M src/platform/update_engine/test_utils.h View 2 chunks +17 lines, -0 lines 2 comments Download
M src/platform/update_engine/test_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform/update_engine/utils.h View 1 5 chunks +43 lines, -4 lines 4 comments Download
M src/platform/update_engine/utils.cc View 1 4 chunks +47 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
adlr
Again, it's not as bad as it looks. One major class + unittest (delta_performer*), and ...
10 years, 8 months ago (2010-04-20 20:59:07 UTC) #1
Daniel Erat
http://codereview.chromium.org/1718001/diff/1/9 File src/platform/update_engine/delta_performer.cc (right): http://codereview.chromium.org/1718001/diff/1/9#newcode12 src/platform/update_engine/delta_performer.cc:12: #include "base/scoped_ptr.h" the include order here seems kinda weird ...
10 years, 8 months ago (2010-04-20 23:52:38 UTC) #2
adlr
PTAL. Also, thanks for doing these reviews. http://codereview.chromium.org/1718001/diff/1/9 File src/platform/update_engine/delta_performer.cc (right): http://codereview.chromium.org/1718001/diff/1/9#newcode12 src/platform/update_engine/delta_performer.cc:12: #include "base/scoped_ptr.h" ...
10 years, 8 months ago (2010-04-23 04:48:11 UTC) #3
Daniel Erat
LGTM after a few changes http://codereview.chromium.org/1718001/diff/1/9 File src/platform/update_engine/delta_performer.cc (right): http://codereview.chromium.org/1718001/diff/1/9#newcode12 src/platform/update_engine/delta_performer.cc:12: #include "base/scoped_ptr.h" On 2010/04/23 ...
10 years, 8 months ago (2010-04-23 17:47:25 UTC) #4
adlr
10 years, 8 months ago (2010-04-23 20:50:17 UTC) #5
fixed and submitted, thanks

http://codereview.chromium.org/1718001/diff/1/9
File src/platform/update_engine/delta_performer.cc (right):

http://codereview.chromium.org/1718001/diff/1/9#newcode12
src/platform/update_engine/delta_performer.cc:12: #include "base/scoped_ptr.h"
On 2010/04/23 17:47:25, Daniel Erat wrote:
> On 2010/04/23 04:48:11, adlr wrote:
> > On 2010/04/20 23:52:38, Daniel Erat wrote:
> > > the include order here seems kinda weird -- move the "base/..." includes
> into
> > > the same block as the "update_engine/..." ones?
> > 
> > I thought base was a library. I certainly link a library called base and I
> > thought this was the same code...
> > 
> > The order I have is:
> > - corresponding .h
> > - C standard includes
> > - C++ standard includes
> > - library includes
> > - local includes
> 
> The style guide says this:
> 
> 1. dir2/foo2.h (preferred location — see details below).
> 2. C system files.
> 3. C++ system files.
> 4. Other libraries' .h files.
> 5. Your project's .h files.
> 
> I've interpreted "your project's .h files" to mean "Chrome OS's .h files",
that
> is, stuff that has doublequotes around it instead of brackets, mostly since
that
> seems to be what Chrome does too (choosing a file at random):
>
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/gtk/browser_wi...

Done.

http://codereview.chromium.org/1718001/diff/1/9#newcode135
src/platform/update_engine/delta_performer.cc:135: memcpy(&protobuf_length,
On 2010/04/23 17:47:25, Daniel Erat wrote:
> On 2010/04/23 04:48:11, adlr wrote:
> > On 2010/04/20 23:52:38, Daniel Erat wrote:
> > > #include <cstring> for this
> > 
> > how about just <string.h>, as specified by man memcpy? If so, done.
> 
> I think that the C header string.h is deprecated in C++ in favor of the C++
> wrapper cstring, but sure, that'll probably work too.

Didn't realize this. I've changed it and I'll try to remember to use the <c...>
headers in the future.

http://codereview.chromium.org/1718001/diff/9001/10008
File src/platform/update_engine/delta_diff_generator.h (right):

http://codereview.chromium.org/1718001/diff/9001/10008#newcode115
src/platform/update_engine/delta_diff_generator.h:115: const char* const
kBsdiffPath = "/usr/bin/bsdiff";
On 2010/04/23 17:47:25, Daniel Erat wrote:
> Same objection as in delta_performer.h here -- I don't think that you should
be
> defining constants at the bottom of a header file (why at the bottom?  why in
an
> anon namespace?).

Sorry, I think I just threw this in while writing code. It seemed like, at least
for integer constant, this might be more efficient since they could be inlined.
the anon namespace was the c++ conversion of 'static', which is how i would have
done it in c.

anyway, changed to non-anon namespace and to just declarations with the
definitions in the corresponding .cc file.

http://codereview.chromium.org/1718001/diff/9001/10024
File src/platform/update_engine/generate_delta_main.cc (right):

http://codereview.chromium.org/1718001/diff/9001/10024#newcode65
src/platform/update_engine/generate_delta_main.cc:65: CHECK_EQ(0,
performer.Open(FLAGS_old_image.c_str(), 0, 0));
On 2010/04/23 17:47:25, Daniel Erat wrote:
> mind using the more-natural-to-read CHECK_EQ(actual, expected) here?  i think
> it's only the gtest EXPECT/ASSERT macros that take the expected first, and
> that's just because they're copying junit or whatever

Done.

http://codereview.chromium.org/1718001/diff/9001/10034
File src/platform/update_engine/test_utils.h (right):

http://codereview.chromium.org/1718001/diff/9001/10034#newcode122
src/platform/update_engine/test_utils.h:122: const std::string dev_;
On 2010/04/23 17:47:25, Daniel Erat wrote:
> add DISALLOW_COPY_AND_ASSIGN (especially for RAII-ish classes)

Done.

http://codereview.chromium.org/1718001/diff/9001/10036
File src/platform/update_engine/utils.h (right):

http://codereview.chromium.org/1718001/diff/9001/10036#newcode178
src/platform/update_engine/utils.h:178: const std::string path_;
On 2010/04/23 17:47:25, Daniel Erat wrote:
> DISALLOW_COPY_AND_ASSIGN

Done (for all in this file)

http://codereview.chromium.org/1718001/diff/9001/10036#newcode190
src/platform/update_engine/utils.h:190: const std::string path_;
On 2010/04/23 17:47:25, Daniel Erat wrote:
> DISALLOW_COPY_AND_ASSIGN

Done.

Powered by Google App Engine
This is Rietveld 408576698