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

Unified Diff: chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc

Issue 2838923004: logPrivate API: prevent log dump from trying to use a non-native path (Closed)
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
diff --git a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
index 822e9ff45c04792981eed2f643b36616f61cc889..9d1971483800bce143ed6b594dfc60a90b0c0c43 100644
--- a/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
+++ b/chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc
@@ -39,6 +39,7 @@
#include "net/log/net_log_entry.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h"
#include "chrome/browser/chromeos/system_logs/debug_log_writer.h"
#endif
@@ -111,7 +112,15 @@ base::FilePath GetAppLogDirectory() {
// will be stored - /home/chronos/<user_profile_dir>/Downloads/log_dumps
base::FilePath GetLogDumpDirectory(content::BrowserContext* context) {
const DownloadPrefs* const prefs = DownloadPrefs::FromBrowserContext(context);
- return prefs->DownloadPath().Append(kLogDumpsSubdir);
+ base::FilePath path = prefs->DownloadPath();
+
+#if defined(OS_CHROMEOS)
+ Profile* profile = Profile::FromBrowserContext(context);
+ if (file_manager::util::IsUnderNonNativeLocalPath(profile, path))
+ path = prefs->GetDefaultDownloadDirectoryForProfile();
+#endif
+
+ return path.Append(kLogDumpsSubdir);
}
// Removes direcotry content of |logs_dumps| and |app_logs_dir| (only for the
« 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