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

Unified Diff: shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java

Issue 1133283002: Android handler: Fix name collision. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Validate entry, also move version in first position so that we can completely change the entry defi… Created 5 years, 7 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
« shell/android/android_handler.cc ('K') | « shell/android/android_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java b/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
index 9719f1902e18f05f2cd55512860535e6a7ae382d..d03c581ae8f8b7955b7acf1bc5da33ff4cf9b272 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/AndroidHandler.java
@@ -85,7 +85,8 @@ public class AndroidHandler {
TraceEvent.begin("MoveBootstrapNativeLibrary");
// Rename the bootstrap library to prevent dlopen to think it is alread opened.
new File(assetDir, BOOTSTRAP_NATIVE_LIBRARY)
- .renameTo(File.createTempFile("bootstrap", ".so", assetDir));
+ .renameTo(new File(nativeCreateTemporaryFile(
+ assetDir.getAbsolutePath(), "bootstrap", ".so")));
TraceEvent.end("MoveBootstrapNativeLibrary");
new java.io.FileOutputStream(preparedSentinel).close();
} catch (Exception e) {
@@ -124,4 +125,7 @@ public class AndroidHandler {
return true;
}
+ // Create a new temporary file. The android version has predictable names.
+ private static native String nativeCreateTemporaryFile(
+ String directory, String basename, String extension);
}
« shell/android/android_handler.cc ('K') | « shell/android/android_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698