OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
7 | 7 |
8 #include <inttypes.h> | 8 #include <inttypes.h> |
9 #include <vector> | 9 #include <vector> |
10 #include <google/protobuf/repeated_field.h> | 10 #include <google/protobuf/repeated_field.h> |
(...skipping 12 matching lines...) Expand all Loading... |
23 manifest_valid_(false), | 23 manifest_valid_(false), |
24 next_operation_(0), | 24 next_operation_(0), |
25 buffer_offset_(0), | 25 buffer_offset_(0), |
26 block_size_(0) {} | 26 block_size_(0) {} |
27 // flags and mode ignored. Once Close()d, a DeltaPerformer can't be | 27 // flags and mode ignored. Once Close()d, a DeltaPerformer can't be |
28 // Open()ed again. | 28 // Open()ed again. |
29 int Open(const char* path, int flags, mode_t mode); | 29 int Open(const char* path, int flags, mode_t mode); |
30 | 30 |
31 // Wrapper around write. Returns bytes written on success or | 31 // Wrapper around write. Returns bytes written on success or |
32 // -errno on error. | 32 // -errno on error. |
33 int Write(const void* bytes, size_t count); | 33 ssize_t Write(const void* bytes, size_t count); |
34 | 34 |
35 // Wrapper around close. Returns 0 on success or -errno on error. | 35 // Wrapper around close. Returns 0 on success or -errno on error. |
36 int Close(); | 36 int Close(); |
37 | 37 |
38 // Converts an ordered collection of Extent objects which contain data of | 38 // Converts an ordered collection of Extent objects which contain data of |
39 // length full_length to a comma-separated string. For each Extent, the | 39 // length full_length to a comma-separated string. For each Extent, the |
40 // string will have the start offset and then the length in bytes. | 40 // string will have the start offset and then the length in bytes. |
41 // The length value of the last extent in the string may be short, since | 41 // The length value of the last extent in the string may be short, since |
42 // the full length of all extents in the string is capped to full_length. | 42 // the full length of all extents in the string is capped to full_length. |
43 // Also, an extent starting at kSparseHole, appears as -1 in the string. | 43 // Also, an extent starting at kSparseHole, appears as -1 in the string. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // The block size (parsed from the manifest). | 90 // The block size (parsed from the manifest). |
91 uint32_t block_size_; | 91 uint32_t block_size_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); | 93 DISALLOW_COPY_AND_ASSIGN(DeltaPerformer); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace chromeos_update_engine | 96 } // namespace chromeos_update_engine |
97 | 97 |
98 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ | 98 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_PERFORMER_H__ |
OLD | NEW |