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

Issue 673093005: Fallback for loading library from a zipfile. (Closed)

Created:
6 years, 2 months ago by Anton
Modified:
6 years, 1 month ago
Reviewers:
picksi1, petrcermak
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fallback for loading library from a zipfile. This approach copies the library out of the zip file into a separate file and loads it from there. This fallback approach should work for corrupted zip files, but not for SELinux issues on which occur on some Samsung devices. Change needs further work to detect corrupted zip files. BUG= Closed as Petr, committed this in: https://codereview.chromium.org/684163002/

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -31 lines) Patch
M base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java View 5 chunks +11 lines, -10 lines 0 comments Download
M base/android/java/src/org/chromium/base/library_loader/Linker.java View 9 chunks +272 lines, -14 lines 4 comments Download
M base/android/linker/linker_jni.cc View 2 chunks +18 lines, -0 lines 0 comments Download
M third_party/android_crazy_linker/src/include/crazy_linker.h View 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/android_crazy_linker/src/src/crazy_linker_api.cpp View 1 chunk +12 lines, -0 lines 2 comments Download
M third_party/android_crazy_linker/src/src/crazy_linker_library_list.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp View 1 chunk +12 lines, -7 lines 2 comments Download

Messages

Total messages: 5 (2 generated)
Anton
Not really for review at this stage.
6 years, 2 months ago (2014-10-24 16:47:45 UTC) #2
picksi1
I don't know if this code is ready for reviews, but I have a couple ...
6 years, 1 month ago (2014-10-28 12:25:27 UTC) #4
Anton
6 years, 1 month ago (2014-10-28 12:42:15 UTC) #5
This change isn't ready for submission (and maybe eclipsed by Petr's changed),
but comments are fine at this point.

https://codereview.chromium.org/673093005/diff/1/base/android/java/src/org/ch...
File base/android/java/src/org/chromium/base/library_loader/Linker.java (right):

https://codereview.chromium.org/673093005/diff/1/base/android/java/src/org/ch...
base/android/java/src/org/chromium/base/library_loader/Linker.java:997: }
On 2014/10/28 12:25:26, picksi1 wrote:
> Should the above block of code be re-jigged slightly and moved into its own
> function called (e.g.) removeOutOfDateFallBackFile(). The code could then be
> re-arranged to look like:
> 
> removeOutOfDateFallBackFile();
> useExistingFallbackFile = fallbackLib.exists();
> 
> So 'fallbackLib.exists()' becomes the golden source for using the fallback or
> not.

Agreed to the decomposition. Though fallbackLib.exists() is not a good source of
truth. I particular, deletion is best effort and can fail. I think that the
renderer may not be able to delete a file made by the browser (for example).

https://codereview.chromium.org/673093005/diff/1/base/android/java/src/org/ch...
base/android/java/src/org/chromium/base/library_loader/Linker.java:1040: byte[]
buffer = new byte[4096];
On 2014/10/28 12:25:26, picksi1 wrote:
> Will this leak? Or does 'byte' contain a destructor that fixes it up?

Nope. This is Java it is garbage collected.

https://codereview.chromium.org/673093005/diff/1/third_party/android_crazy_li...
File third_party/android_crazy_linker/src/src/crazy_linker_api.cpp (right):

https://codereview.chromium.org/673093005/diff/1/third_party/android_crazy_li...
third_party/android_crazy_linker/src/src/crazy_linker_api.cpp:234:
buffer[pathname.size()] = '\0';
On 2014/10/28 12:25:26, picksi1 wrote:
> Would strncpy(buffer, pathname.c_str(), pathname.size()) be clearer?

Agreed, though strncpy does not guarantee the null '\0', so you still want for
buffer[pathname.size()] = '\0' for safety.

https://codereview.chromium.org/673093005/diff/1/third_party/android_crazy_li...
File third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
(right):

https://codereview.chromium.org/673093005/diff/1/third_party/android_crazy_li...
third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp:416: if
(fullname.size() + 1 > kMaxFilenameInZip) {
On 2014/10/28 12:25:27, picksi1 wrote:
> Should this be >= without the +1 as happens elsewhere?

Agreed

Powered by Google App Engine
This is Rietveld 408576698