diff options
author | Sen Jiang <senj@google.com> | 2019-02-26 21:54:59 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-02-26 21:54:59 -0800 |
commit | 210d09987267d12800f0e3dc2fa5c9ff8c27657f (patch) | |
tree | 4aed0f65559d40c54c9afdfae060c8ae10115fed | |
parent | 0730ba3059694686e1cdbb55e8445c5f02daf186 (diff) | |
parent | cebb6882f8dfc87231d64e9a0dba969666e013a4 (diff) | |
download | update_engine-210d09987267d12800f0e3dc2fa5c9ff8c27657f.tar.gz |
Use InstallOperation::Type instead of InstallOperation_Type.
am: cebb6882f8
Change-Id: I8e0267e413602cdeeba5e9121368b09c40e8893c
-rw-r--r-- | payload_consumer/payload_constants.cc | 2 | ||||
-rw-r--r-- | payload_consumer/payload_constants.h | 2 | ||||
-rw-r--r-- | payload_generator/ab_generator.cc | 2 | ||||
-rw-r--r-- | payload_generator/ab_generator_unittest.cc | 8 | ||||
-rw-r--r-- | payload_generator/cycle_breaker.cc | 2 | ||||
-rw-r--r-- | payload_generator/delta_diff_utils.cc | 10 | ||||
-rw-r--r-- | payload_generator/delta_diff_utils.h | 6 | ||||
-rw-r--r-- | payload_generator/delta_diff_utils_unittest.cc | 2 | ||||
-rw-r--r-- | payload_generator/full_update_generator.cc | 2 | ||||
-rw-r--r-- | payload_generator/inplace_generator.cc | 2 | ||||
-rw-r--r-- | payload_generator/inplace_generator_unittest.cc | 2 | ||||
-rw-r--r-- | payload_generator/payload_file.cc | 18 | ||||
-rw-r--r-- | payload_generator/payload_generation_config.cc | 2 | ||||
-rw-r--r-- | payload_generator/payload_generation_config.h | 2 |
14 files changed, 31 insertions, 31 deletions
diff --git a/payload_consumer/payload_constants.cc b/payload_consumer/payload_constants.cc index 213d798f..a2368a43 100644 --- a/payload_consumer/payload_constants.cc +++ b/payload_consumer/payload_constants.cc @@ -42,7 +42,7 @@ const char kPartitionNameRoot[] = "root"; const char kDeltaMagic[4] = {'C', 'r', 'A', 'U'}; -const char* InstallOperationTypeName(InstallOperation_Type op_type) { +const char* InstallOperationTypeName(InstallOperation::Type op_type) { switch (op_type) { case InstallOperation::BSDIFF: return "BSDIFF"; diff --git a/payload_consumer/payload_constants.h b/payload_consumer/payload_constants.h index 7f768984..16424887 100644 --- a/payload_consumer/payload_constants.h +++ b/payload_consumer/payload_constants.h @@ -77,7 +77,7 @@ extern const char kDeltaMagic[4]; const uint64_t kSparseHole = std::numeric_limits<uint64_t>::max(); // Return the name of the operation type. -const char* InstallOperationTypeName(InstallOperation_Type op_type); +const char* InstallOperationTypeName(InstallOperation::Type op_type); } // namespace chromeos_update_engine diff --git a/payload_generator/ab_generator.cc b/payload_generator/ab_generator.cc index f4cc9fba..d9b9d885 100644 --- a/payload_generator/ab_generator.cc +++ b/payload_generator/ab_generator.cc @@ -276,7 +276,7 @@ bool ABGenerator::AddDataAndSetType(AnnotatedOperation* aop, target_part_path, dst_extents, &data, data.size(), kBlockSize)); brillo::Blob blob; - InstallOperation_Type op_type; + InstallOperation::Type op_type; TEST_AND_RETURN_FALSE( diff_utils::GenerateBestFullOperation(data, version, &blob, &op_type)); diff --git a/payload_generator/ab_generator_unittest.cc b/payload_generator/ab_generator_unittest.cc index 2f8c0c60..270657ab 100644 --- a/payload_generator/ab_generator_unittest.cc +++ b/payload_generator/ab_generator_unittest.cc @@ -49,7 +49,7 @@ bool ExtentEquals(const Extent& ext, } // Tests splitting of a REPLACE/REPLACE_BZ operation. -void TestSplitReplaceOrReplaceBzOperation(InstallOperation_Type orig_type, +void TestSplitReplaceOrReplaceBzOperation(InstallOperation::Type orig_type, bool compressible) { const size_t op_ex1_start_block = 2; const size_t op_ex1_num_blocks = 2; @@ -124,7 +124,7 @@ void TestSplitReplaceOrReplaceBzOperation(InstallOperation_Type orig_type, version, aop, part_file.path(), &result_ops, &blob_file)); // Check the result. - InstallOperation_Type expected_type = + InstallOperation::Type expected_type = compressible ? InstallOperation::REPLACE_BZ : InstallOperation::REPLACE; ASSERT_EQ(2U, result_ops.size()); @@ -200,7 +200,7 @@ void TestSplitReplaceOrReplaceBzOperation(InstallOperation_Type orig_type, } // Tests merging of REPLACE/REPLACE_BZ operations. -void TestMergeReplaceOrReplaceBzOperations(InstallOperation_Type orig_type, +void TestMergeReplaceOrReplaceBzOperations(InstallOperation::Type orig_type, bool compressible) { const size_t first_op_num_blocks = 1; const size_t second_op_num_blocks = 2; @@ -287,7 +287,7 @@ void TestMergeReplaceOrReplaceBzOperations(InstallOperation_Type orig_type, &aops, version, 5, part_file.path(), &blob_file)); // Check the result. - InstallOperation_Type expected_op_type = + InstallOperation::Type expected_op_type = compressible ? InstallOperation::REPLACE_BZ : InstallOperation::REPLACE; EXPECT_EQ(1U, aops.size()); InstallOperation new_op = aops[0].op; diff --git a/payload_generator/cycle_breaker.cc b/payload_generator/cycle_breaker.cc index d76f679f..d6eeed2b 100644 --- a/payload_generator/cycle_breaker.cc +++ b/payload_generator/cycle_breaker.cc @@ -56,7 +56,7 @@ void CycleBreaker::BreakCycles(const Graph& graph, set<Edge>* out_cut_edges) { skipped_ops_ = 0; for (Graph::size_type i = 0; i < subgraph_.size(); i++) { - InstallOperation_Type op_type = graph[i].aop.op.type(); + InstallOperation::Type op_type = graph[i].aop.op.type(); if (op_type == InstallOperation::REPLACE || op_type == InstallOperation::REPLACE_BZ) { skipped_ops_++; diff --git a/payload_generator/delta_diff_utils.cc b/payload_generator/delta_diff_utils.cc index 1bad4d75..4ba6e24f 100644 --- a/payload_generator/delta_diff_utils.cc +++ b/payload_generator/delta_diff_utils.cc @@ -760,7 +760,7 @@ bool DeltaReadFile(vector<AnnotatedOperation>* aops, bool GenerateBestFullOperation(const brillo::Blob& new_data, const PayloadVersion& version, brillo::Blob* out_blob, - InstallOperation_Type* out_type) { + InstallOperation::Type* out_type) { if (new_data.empty()) return false; @@ -863,7 +863,7 @@ bool ReadExtentsToDiff(const string& old_part, // Try generating a full operation for the given new data, regardless of the // old_data. - InstallOperation_Type op_type; + InstallOperation::Type op_type; TEST_AND_RETURN_FALSE( GenerateBestFullOperation(new_data, version, &data_blob, &op_type)); operation.set_type(op_type); @@ -892,7 +892,7 @@ bool ReadExtentsToDiff(const string& old_part, ScopedPathUnlinker unlinker(patch.value()); std::unique_ptr<bsdiff::PatchWriterInterface> bsdiff_patch_writer; - InstallOperation_Type operation_type = InstallOperation::BSDIFF; + InstallOperation::Type operation_type = InstallOperation::BSDIFF; if (version.OperationAllowed(InstallOperation::BROTLI_BSDIFF)) { bsdiff_patch_writer = bsdiff::CreateBSDF2PatchWriter(patch.value(), @@ -1010,13 +1010,13 @@ bool ReadExtentsToDiff(const string& old_part, return true; } -bool IsAReplaceOperation(InstallOperation_Type op_type) { +bool IsAReplaceOperation(InstallOperation::Type op_type) { return (op_type == InstallOperation::REPLACE || op_type == InstallOperation::REPLACE_BZ || op_type == InstallOperation::REPLACE_XZ); } -bool IsNoSourceOperation(InstallOperation_Type op_type) { +bool IsNoSourceOperation(InstallOperation::Type op_type) { return (IsAReplaceOperation(op_type) || op_type == InstallOperation::ZERO || op_type == InstallOperation::DISCARD); } diff --git a/payload_generator/delta_diff_utils.h b/payload_generator/delta_diff_utils.h index 2306572c..2211b307 100644 --- a/payload_generator/delta_diff_utils.h +++ b/payload_generator/delta_diff_utils.h @@ -119,13 +119,13 @@ bool ReadExtentsToDiff(const std::string& old_part, bool GenerateBestFullOperation(const brillo::Blob& new_data, const PayloadVersion& version, brillo::Blob* out_blob, - InstallOperation_Type* out_type); + InstallOperation::Type* out_type); // Returns whether |op_type| is one of the REPLACE full operations. -bool IsAReplaceOperation(InstallOperation_Type op_type); +bool IsAReplaceOperation(InstallOperation::Type op_type); // Returns true if an operation with type |op_type| has no |src_extents|. -bool IsNoSourceOperation(InstallOperation_Type op_type); +bool IsNoSourceOperation(InstallOperation::Type op_type); // Returns true if |op| is a no-op operation that doesn't do any useful work // (e.g., a move operation that copies blocks onto themselves). diff --git a/payload_generator/delta_diff_utils_unittest.cc b/payload_generator/delta_diff_utils_unittest.cc index f730cc93..b2950e8b 100644 --- a/payload_generator/delta_diff_utils_unittest.cc +++ b/payload_generator/delta_diff_utils_unittest.cc @@ -390,7 +390,7 @@ TEST_F(DeltaDiffUtilsTest, ReplaceSmallTest) { EXPECT_FALSE(data.empty()); EXPECT_TRUE(op.has_type()); - const InstallOperation_Type expected_type = + const InstallOperation::Type expected_type = (i == 0 ? InstallOperation::REPLACE : InstallOperation::REPLACE_BZ); EXPECT_EQ(expected_type, op.type()); EXPECT_FALSE(op.has_data_offset()); diff --git a/payload_generator/full_update_generator.cc b/payload_generator/full_update_generator.cc index 4d8b2f99..94a43ab7 100644 --- a/payload_generator/full_update_generator.cc +++ b/payload_generator/full_update_generator.cc @@ -99,7 +99,7 @@ bool ChunkProcessor::ProcessChunk() { fd_, buffer_in_.data(), buffer_in_.size(), offset_, &bytes_read)); TEST_AND_RETURN_FALSE(bytes_read == static_cast<ssize_t>(size_)); - InstallOperation_Type op_type; + InstallOperation::Type op_type; TEST_AND_RETURN_FALSE(diff_utils::GenerateBestFullOperation( buffer_in_, version_, &op_blob, &op_type)); diff --git a/payload_generator/inplace_generator.cc b/payload_generator/inplace_generator.cc index ee19b620..d553cc41 100644 --- a/payload_generator/inplace_generator.cc +++ b/payload_generator/inplace_generator.cc @@ -273,7 +273,7 @@ void InplaceGenerator::MoveAndSortFullOpsToBack( vector<Vertex::Index> full_ops; ret.reserve(op_indexes->size()); for (auto op_index : *op_indexes) { - InstallOperation_Type type = (*graph)[op_index].aop.op.type(); + InstallOperation::Type type = (*graph)[op_index].aop.op.type(); if (type == InstallOperation::REPLACE || type == InstallOperation::REPLACE_BZ) { full_ops.push_back(op_index); diff --git a/payload_generator/inplace_generator_unittest.cc b/payload_generator/inplace_generator_unittest.cc index ab3b8671..8028f366 100644 --- a/payload_generator/inplace_generator_unittest.cc +++ b/payload_generator/inplace_generator_unittest.cc @@ -55,7 +55,7 @@ void GenVertex(Vertex* out, const vector<Extent>& src_extents, const vector<Extent>& dst_extents, const string& path, - InstallOperation_Type type) { + InstallOperation::Type type) { out->aop.op.set_type(type); out->aop.name = path; StoreExtents(src_extents, out->aop.op.mutable_src_extents()); diff --git a/payload_generator/payload_file.cc b/payload_generator/payload_file.cc index 085ea16a..a111fd63 100644 --- a/payload_generator/payload_file.cc +++ b/payload_generator/payload_file.cc @@ -365,15 +365,15 @@ void PayloadFile::ReportPayloadUsage(uint64_t metadata_size) const { const DeltaObject& object = object_count.first; // Use printf() instead of LOG(INFO) because timestamp makes it difficult to // compare two reports. - printf( - kFormatString, - object.size * 100.0 / total_size, - object.size, - (object.type >= 0 ? InstallOperationTypeName( - static_cast<InstallOperation_Type>(object.type)) - : "-"), - object.name.c_str(), - object_count.second); + printf(kFormatString, + object.size * 100.0 / total_size, + object.size, + (object.type >= 0 + ? InstallOperationTypeName( + static_cast<InstallOperation::Type>(object.type)) + : "-"), + object.name.c_str(), + object_count.second); } printf(kFormatString, 100.0, total_size, "", "<total>", total_op); fflush(stdout); diff --git a/payload_generator/payload_generation_config.cc b/payload_generator/payload_generation_config.cc index 694c71fa..648fe8b9 100644 --- a/payload_generator/payload_generation_config.cc +++ b/payload_generator/payload_generation_config.cc @@ -222,7 +222,7 @@ bool PayloadVersion::Validate() const { return true; } -bool PayloadVersion::OperationAllowed(InstallOperation_Type operation) const { +bool PayloadVersion::OperationAllowed(InstallOperation::Type operation) const { switch (operation) { // Full operations: case InstallOperation::REPLACE: diff --git a/payload_generator/payload_generation_config.h b/payload_generator/payload_generation_config.h index 2153ab07..584ac7b6 100644 --- a/payload_generator/payload_generation_config.h +++ b/payload_generator/payload_generation_config.h @@ -165,7 +165,7 @@ struct PayloadVersion { bool Validate() const; // Return whether the passed |operation| is allowed by this payload. - bool OperationAllowed(InstallOperation_Type operation) const; + bool OperationAllowed(InstallOperation::Type operation) const; // Whether this payload version is a delta payload. bool IsDelta() const; |