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

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

Issue 1088533003: Adding URLResponse Disk Cache to mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review 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
Index: shell/android/apk/src/org/chromium/mojo/shell/ShellMain.java
diff --git a/shell/android/apk/src/org/chromium/mojo/shell/ShellMain.java b/shell/android/apk/src/org/chromium/mojo/shell/ShellMain.java
index ab834afc1872525e87e95eb493aae5f36e9044d7..e815967d438f1fd4ba867c9eb68783d5b857db9d 100644
--- a/shell/android/apk/src/org/chromium/mojo/shell/ShellMain.java
+++ b/shell/android/apk/src/org/chromium/mojo/shell/ShellMain.java
@@ -29,6 +29,10 @@ public class ShellMain {
private static final String NETWORK_LIBRARY_APP = "network_service.mojo";
// Directory where the child executable will be extracted.
private static final String CHILD_DIRECTORY = "child";
+ // Directory to set TMPDIR to.
+ private static final String TMP_DIRECTORY = "tmp";
+ // Directory to set HOME to.
+ private static final String HOME_DIRECTORY = "home";
// Name of the child executable.
private static final String MOJO_SHELL_CHILD_EXECUTABLE = "mojo_shell_child";
// Path to the default origin of mojo: apps.
@@ -69,7 +73,8 @@ public class ShellMain {
nativeInit(applicationContext, mojoShellChild.getAbsolutePath(),
parametersList.toArray(new String[parametersList.size()]),
getLocalAppsDir(applicationContext).getAbsolutePath(),
- getTmpDir(applicationContext).getAbsolutePath());
+ getTmpDir(applicationContext).getAbsolutePath(),
+ getHomeDir(applicationContext).getAbsolutePath());
sInitialized = true;
} catch (Exception e) {
Log.e(TAG, "ShellMain initialization failed.", e);
@@ -109,7 +114,11 @@ public class ShellMain {
}
private static File getTmpDir(Context context) {
- return new File(context.getCacheDir(), "tmp");
+ return new File(context.getCacheDir(), TMP_DIRECTORY);
+ }
+
+ private static File getHomeDir(Context context) {
+ return context.getDir(HOME_DIRECTORY, Context.MODE_PRIVATE);
}
@CalledByNative
@@ -121,7 +130,7 @@ public class ShellMain {
* Initializes the native system. This API should be called only once per process.
**/
private static native void nativeInit(Context context, String mojoShellChildPath,
- String[] parameters, String bundledAppsDirectory, String tmpDir);
+ String[] parameters, String bundledAppsDirectory, String tmpDir, String homeDir);
private static native boolean nativeStart();
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java ('k') | shell/android/background_application_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698