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

Unified Diff: net/url_request/url_request_file_job.h

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes 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
Index: net/url_request/url_request_file_job.h
diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h
index 0c250f843bfb84e076bd212013b9c3768ad8d693..82c8c9924085659289fcadaaa061f0d69cdb4e2a 100644
--- a/net/url_request/url_request_file_job.h
+++ b/net/url_request/url_request_file_job.h
@@ -46,6 +46,8 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
virtual void SetExtraRequestHeaders(
const HttpRequestHeaders& headers) OVERRIDE;
+ static void AllowAccessToAllFiles();
+
protected:
virtual ~URLRequestFileJob();
@@ -53,6 +55,12 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
FilePath file_path_;
private:
+ // Tests to see if access to |path| is allowed. If g_allow_file_access_ is
+ // true, then this will return true. If the NetworkDelegate associated with
+ // the |request| says it's OK, then this will also return true.
+ static bool IsFileAccessAllowed(const URLRequest& request,
+ const FilePath& path);
+
// Callback after fetching file info on a background thread.
void DidResolve(bool exists, const base::PlatformFileInfo& file_info);
@@ -71,6 +79,9 @@ class NET_EXPORT URLRequestFileJob : public URLRequestJob {
friend class AsyncResolver;
scoped_refptr<AsyncResolver> async_resolver_;
+ // If true, allows access to all files.
+ static bool g_allow_file_access_;
+
DISALLOW_COPY_AND_ASSIGN(URLRequestFileJob);
};

Powered by Google App Engine
This is Rietveld 408576698