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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: net/url_request/url_request_file_job.cc
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 3c8deae2f6385c7f51d83bce334c171a35144ada..c44f9fbd650f3cc13cf7d63157d1301e87be0ea5 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -20,6 +20,7 @@
#include "net/url_request/url_request_file_job.h"
#include "base/bind.h"
+#include "base/chromeos/chromeos_version.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "base/platform_file.h"
@@ -137,6 +138,18 @@ bool URLRequestFileJob::AccessDisabled(const FilePath& file_path) {
return false;
}
+ // If we're running Chrome for ChromeOS on Linux, we want to allow files
zel 2012/04/12 20:19:40 if this is for debugging only on Linux machines wi
Greg Spencer (Chromium) 2012/04/12 20:26:58 It's already inside of OS_CHROMEOS, and while I se
willchan no longer on Chromium 2012/04/12 23:44:59 Ugh, I don't know why this whitelist was allowed i
+ // within the user's Downloads directory.
+ if (!base::chromeos::IsRunningOnChromeOS()) {
+ const char* home = getenv("HOME");
+ if (home && strlen(home) > 0) {
+ FilePath home_path(home);
+ home_path.AppendASCII("Downloads");
+ if (home_path.IsParent(file_path))
+ return false;
+ }
+ }
+
for (size_t i = 0; i < arraysize(kLocalAccessWhiteList); ++i) {
const FilePath white_listed_path(kLocalAccessWhiteList[i]);
// FilePath::operator== should probably handle trailing seperators.
« 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