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

Side by Side Diff: src/platform/update_engine/bzip_extent_writer.cc

Issue 1718001: AU: Class to perform delta updates. (Closed)
Patch Set: fixes for review Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "update_engine/bzip_extent_writer.h" 5 #include "update_engine/bzip_extent_writer.h"
6 6
7 using std::vector; 7 using std::vector;
8 8
9 namespace chromeos_update_engine { 9 namespace chromeos_update_engine {
10 10
11 namespace { 11 namespace {
12 const vector<char>::size_type kOutputBufferLength = 1024 * 1024; 12 const vector<char>::size_type kOutputBufferLength = 1024 * 1024;
13 } 13 }
14 14
15 bool BzipExtentWriter::Init(int fd, 15 bool BzipExtentWriter::Init(int fd,
16 const vector<Extent>& extents, 16 const vector<Extent>& extents,
17 uint32 block_size) { 17 uint32_t block_size) {
18 // Init bzip2 stream 18 // Init bzip2 stream
19 int rc = BZ2_bzDecompressInit(&stream_, 19 int rc = BZ2_bzDecompressInit(&stream_,
20 0, // verbosity. (0 == silent) 20 0, // verbosity. (0 == silent)
21 0 // 0 = faster algo, more memory 21 0 // 0 = faster algo, more memory
22 ); 22 );
23 TEST_AND_RETURN_FALSE(rc == BZ_OK); 23 TEST_AND_RETURN_FALSE(rc == BZ_OK);
24 24
25 return next_->Init(fd, extents, block_size); 25 return next_->Init(fd, extents, block_size);
26 } 26 }
27 27
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return true; 64 return true;
65 } 65 }
66 66
67 bool BzipExtentWriter::EndImpl() { 67 bool BzipExtentWriter::EndImpl() {
68 TEST_AND_RETURN_FALSE(input_buffer_.empty()); 68 TEST_AND_RETURN_FALSE(input_buffer_.empty());
69 TEST_AND_RETURN_FALSE(BZ2_bzDecompressEnd(&stream_) == BZ_OK); 69 TEST_AND_RETURN_FALSE(BZ2_bzDecompressEnd(&stream_) == BZ_OK);
70 return next_->End(); 70 return next_->End();
71 } 71 }
72 72
73 } // namespace chromeos_update_engine 73 } // namespace chromeos_update_engine
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698