summaryrefslogtreecommitdiff
path: root/runtime/hidden_api_test.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2023-02-13 12:42:12 +0000
committer David Srbecky <dsrbecky@google.com> 2023-02-21 18:00:00 +0000
commit052f5fb6d28717b7ff236c508f5fb36a7705f662 (patch)
treed148b944857d92cc4ad5666f7139c16b6ba56394 /runtime/hidden_api_test.cc
parent4184f23701a64e9902ffced803968fcc5601764b (diff)
Refactor DexFileLoader
The first parameter of the Open methods specifies the data source, that we intend to load the dex file(s) from. This creates large number of overloads when multiplied by diversity of the other arguments. Move the data source parameters to the constructor of DexFileLoader. Specifically, the constructor just creates the right DexFileContainer, and the rest of the loader is independent of the data source used. This removes large amount of the overloads as well as large amount of copy-pasted code. Majority of ArtDexFileLoader has been removed. Bug: 266950186 Test: ./art/test.py -b --host --optimizing --64 Change-Id: I6580b49e65441eec93a7e0124be23bd8c859904a
Diffstat (limited to 'runtime/hidden_api_test.cc')
-rw-r--r--runtime/hidden_api_test.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index a3d5db1f79..c2c40c5af3 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -63,12 +63,11 @@ static bool LoadDexFiles(const std::string& path,
/* out */ std::vector<std::unique_ptr<const DexFile>>* dex_files,
/* out */ ObjPtr<mirror::ClassLoader>* class_loader,
/* out */ std::string* error_msg) REQUIRES_SHARED(Locks::mutator_lock_) {
- if (!ArtDexFileLoader().Open(path.c_str(),
- path,
- /* verify= */ true,
- /* verify_checksum= */ true,
- error_msg,
- dex_files)) {
+ ArtDexFileLoader dex_file_loader(path);
+ if (!dex_file_loader.Open(/* verify= */ true,
+ /* verify_checksum= */ true,
+ error_msg,
+ dex_files)) {
return false;
}