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

Unified Diff: chrome/browser/download/download_path_reservation_tracker.cc

Issue 2117343007: Show download error message if sdcard is not available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: chrome/browser/download/download_path_reservation_tracker.cc
diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc
index 6f5603e3cd5531094121b5ebd8efb2d92bec6fe0..014a96e05cdf4ad4094235de840e0bf04b602144 100644
--- a/chrome/browser/download/download_path_reservation_tracker.cc
+++ b/chrome/browser/download/download_path_reservation_tracker.cc
@@ -164,7 +164,6 @@ bool CreateReservation(
base::FilePath* reserved_path) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK(suggested_path.IsAbsolute());
-
// Create a reservation map if one doesn't exist. It will be automatically
// deleted when all the reservations are revoked.
if (g_reservation_map == NULL)
@@ -202,9 +201,15 @@ bool CreateReservation(
// to the user's "My Documents" directory. We'll prompt them in this case.
if (!base::PathIsWritable(target_dir)) {
DVLOG(1) << "Unable to write to directory \"" << target_dir.value() << "\"";
+#if defined(OS_ANDROID)
asanka 2016/07/07 21:12:48 This code is conditioned on OS_ANDROID while the o
qinmin 2016/07/07 22:49:37 Done.
+ // On Android, file will not be by other apps if it is downloaded to
+ // Chrome's own directory.
asanka 2016/07/07 21:12:48 The comment should mention that DIR_USER_DOCUMENTS
qinmin 2016/07/07 22:49:37 Done.
+ return false;
+#else
is_path_writeable = false;
PathService::Get(chrome::DIR_USER_DOCUMENTS, &target_dir);
target_path = target_dir.Append(filename);
+#endif
}
if (is_path_writeable) {

Powered by Google App Engine
This is Rietveld 408576698