Chromium Code Reviews| 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. |