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

Unified Diff: base/android/java/src/org/chromium/base/PathUtils.java

Issue 2811173002: Setup download internal directory (Closed)
Patch Set: fix browser test Created 3 years, 8 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
« no previous file with comments | « no previous file | base/android/path_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/PathUtils.java
diff --git a/base/android/java/src/org/chromium/base/PathUtils.java b/base/android/java/src/org/chromium/base/PathUtils.java
index 00977d56d576ac94335c6ab0578a86c75b1c2833..1cadb250ac033d231912f13cde31885362f99a41 100644
--- a/base/android/java/src/org/chromium/base/PathUtils.java
+++ b/base/android/java/src/org/chromium/base/PathUtils.java
@@ -25,12 +25,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
@MainDex
public abstract class PathUtils {
private static final String THUMBNAIL_DIRECTORY_NAME = "textures";
+ private static final String DOWNLOAD_INTERNAL_DIRECTORY_NAME = "download_internal";
private static final int DATA_DIRECTORY = 0;
private static final int THUMBNAIL_DIRECTORY = 1;
private static final int DATABASE_DIRECTORY = 2;
private static final int CACHE_DIRECTORY = 3;
- private static final int NUM_DIRECTORIES = 4;
+ private static final int DOWNLOAD_INTERNAL_DIRECTORY = 4;
+ private static final int NUM_DIRECTORIES = 5;
private static final AtomicBoolean sInitializationStarted = new AtomicBoolean();
private static AsyncTask<Void, Void, String[]> sDirPathFetchTask;
@@ -102,6 +104,8 @@ public abstract class PathUtils {
sDataDirectorySuffix, Context.MODE_PRIVATE).getPath();
paths[THUMBNAIL_DIRECTORY] = appContext.getDir(
THUMBNAIL_DIRECTORY_NAME, Context.MODE_PRIVATE).getPath();
+ paths[DOWNLOAD_INTERNAL_DIRECTORY] =
+ appContext.getDir(DOWNLOAD_INTERNAL_DIRECTORY_NAME, Context.MODE_PRIVATE).getPath();
paths[DATABASE_DIRECTORY] = appContext.getDatabasePath("foo").getParent();
if (appContext.getCacheDir() != null) {
paths[CACHE_DIRECTORY] = appContext.getCacheDir().getPath();
@@ -177,6 +181,12 @@ public abstract class PathUtils {
return getDirectoryPath(THUMBNAIL_DIRECTORY);
}
+ @CalledByNative
+ public static String getDownloadInternalDirectory() {
+ assert sDirPathFetchTask != null : "setDataDirectorySuffix must be called first.";
+ return getDirectoryPath(DOWNLOAD_INTERNAL_DIRECTORY);
+ }
+
/**
* @return the public downloads directory.
*/
« no previous file with comments | « no previous file | base/android/path_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698