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

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

Issue 1315443012: Revert of Pre-cache downloads directory path in PathUtils. (patchset #1 id:1 of https://codereview.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Added the commit SHA from which it is cherry-picked. Created 5 years, 3 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 | no next file » | 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 05697e2bbceafcdc0e29e5f8958887dd9177080a..8d676fa850e82604d5cb8523aa87094809cf204c 100644
--- a/base/android/java/src/org/chromium/base/PathUtils.java
+++ b/base/android/java/src/org/chromium/base/PathUtils.java
@@ -23,8 +23,7 @@ public abstract class PathUtils {
private static final int DATA_DIRECTORY = 0;
private static final int DATABASE_DIRECTORY = 1;
private static final int CACHE_DIRECTORY = 2;
- private static final int DOWNLOADS_DIRECTORY = 3;
- private static final int NUM_DIRECTORIES = 4;
+ private static final int NUM_DIRECTORIES = 3;
private static AsyncTask<String, Void, String[]> sDirPathFetchTask;
private static File sThumbnailDirectory;
@@ -50,10 +49,7 @@ public abstract class PathUtils {
paths[DATABASE_DIRECTORY] = appContext.getDatabasePath("foo").getParent();
// TODO(wnwen): Find a way to avoid calling this function in renderer process.
if (appContext.getCacheDir() != null) {
- // These paths are only available in the browser process.
paths[CACHE_DIRECTORY] = appContext.getCacheDir().getPath();
- paths[DOWNLOADS_DIRECTORY] = Environment.getExternalStoragePublicDirectory(
- Environment.DIRECTORY_DOWNLOADS).getPath();
}
return paths;
}
@@ -119,8 +115,8 @@ public abstract class PathUtils {
@SuppressWarnings("unused")
@CalledByNative
private static String getDownloadsDirectory(Context appContext) {
- assert sDirPathFetchTask != null : "setDataDirectorySuffix must be called first.";
- return getDirectoryPath(DOWNLOADS_DIRECTORY);
+ return Environment.getExternalStoragePublicDirectory(
+ Environment.DIRECTORY_DOWNLOADS).getPath();
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698