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

Unified Diff: third_party/android_crazy_linker/src/src/crazy_linker_api.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_api.cpp
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp
index 10a64bfa63ee9b6290ba88a64ec33340d48073e4..3b1d2efe5f2ebc16d3783d79ee3f0b040fa1e4c3 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_api.cpp
@@ -223,6 +223,18 @@ crazy_status_t crazy_library_open(crazy_library_t** library,
return CRAZY_STATUS_SUCCESS;
}
+crazy_status_t crazy_library_filename_in_zip_file(
+ const char* lib_name, char* buffer, size_t buffer_size) {
+ crazy::String pathname =
+ crazy::LibraryList::LibraryFilenameInZipFile(lib_name);
+ if (pathname.size() >= buffer_size) {
+ return CRAZY_STATUS_FAILURE;
+ }
+ memcpy(buffer, pathname.c_str(), pathname.size());
+ buffer[pathname.size()] = '\0';
picksi1 2014/10/28 12:25:26 Would strncpy(buffer, pathname.c_str(), pathname.s
Anton 2014/10/28 12:42:15 Agreed, though strncpy does not guarantee the null
+ return CRAZY_STATUS_SUCCESS;
+}
+
crazy_status_t crazy_library_open_in_zip_file(crazy_library_t** library,
const char* zipfile_name,
const char* lib_name,

Powered by Google App Engine
This is Rietveld 408576698