From b095f022a9683a9123018c01e22595cf969fd88b Mon Sep 17 00:00:00 2001 From: David Sehr Date: Fri, 22 Jun 2018 14:38:51 -0700 Subject: Refactor DexFile ownership Avoid bare pointers in DexFileLoader APIs, which caused clang-tidy issues and other problems. Bug: none Test: build and boot Change-Id: Ic277bc83af1997774b42c55d3d631ec940b9c015 --- libdexfile/dex/dex_file_loader.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdexfile/dex/dex_file_loader.h') diff --git a/libdexfile/dex/dex_file_loader.h b/libdexfile/dex/dex_file_loader.h index 01532203eb..0bd6446b7b 100644 --- a/libdexfile/dex/dex_file_loader.h +++ b/libdexfile/dex/dex_file_loader.h @@ -161,17 +161,17 @@ class DexFileLoader { kVerifyFailed }; - static std::unique_ptr OpenCommon(const uint8_t* base, - size_t size, - const uint8_t* data_base, - size_t data_size, + // main_section points to the header and fixed-sized objects (ids, etc.) + // If not empty (Begin != nullptr) data_section points to the dex file's variable-sized + // objects such as strings, class_data_items, etc. + static std::unique_ptr OpenCommon(std::unique_ptr main_section, + std::unique_ptr data_section, const std::string& location, uint32_t location_checksum, const OatDexFile* oat_dex_file, bool verify, bool verify_checksum, std::string* error_msg, - std::unique_ptr container, VerifyResult* verify_result); private: -- cgit v1.2.3-59-g8ed1b