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

Unified Diff: third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp

Issue 673093005: Fallback for loading library from a zipfile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
index 1ca932109ddcbed447c11be7dfde8ccbf0764143..f0fb451b2f3fd9c2a94b4af871877c7e2b52c49b 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
@@ -393,21 +393,26 @@ LibraryView* LibraryList::LoadLibrary(const char* lib_name,
#endif
const size_t kMaxFilenameInZip = 256;
-const size_t kPageSize = 4096;
-LibraryView* LibraryList::LoadLibraryInZipFile(const char* zip_file_path,
- const char* lib_name,
- int dlopen_flags,
- uintptr_t load_address,
- SearchPathList* search_path_list,
- Error* error) {
+String LibraryList::LibraryFilenameInZipFile(const char* lib_name) {
String fullname;
fullname.Reserve(kMaxFilenameInZip);
fullname = "lib/";
fullname += CURRENT_ABI;
fullname += "/crazy.";
fullname += lib_name;
+ return fullname;
+}
+const size_t kPageSize = 4096;
+
+LibraryView* LibraryList::LoadLibraryInZipFile(const char* zip_file_path,
+ const char* lib_name,
+ int dlopen_flags,
+ uintptr_t load_address,
+ SearchPathList* search_path_list,
+ Error* error) {
+ String fullname = LibraryFilenameInZipFile(lib_name);
if (fullname.size() + 1 > kMaxFilenameInZip) {
picksi1 2014/10/28 12:25:27 Should this be >= without the +1 as happens elsewh
Anton 2014/10/28 12:42:15 Agreed
error->Format("Filename too long for a file in a zip file %s\n",
fullname.c_str());

Powered by Google App Engine
This is Rietveld 408576698