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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10068021: Fix file access on Chrome for ChromeOS on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload after sync 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: chrome/browser/net/chrome_network_delegate.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index a582c388f1dfee223c44229f80cc69d40481944c..75ded9091933ee556cfac5867a6ec46d65cdde11 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -47,6 +47,10 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
PrefService* pref_service);
+ // When called, all file:// URLs will now be accessible. If this is not
+ // called, then some platforms restrict access to file:// paths.
+ static void AllowAccessToAllFiles();
+
private:
// NetworkDelegate implementation.
virtual int OnBeforeURLRequest(net::URLRequest* request,
@@ -77,11 +81,14 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
net::AuthCredentials* credentials) OVERRIDE;
- virtual bool CanGetCookies(const net::URLRequest* request,
- const net::CookieList& cookie_list) OVERRIDE;
- virtual bool CanSetCookie(const net::URLRequest* request,
- const std::string& cookie_line,
- net::CookieOptions* options) OVERRIDE;
+ virtual bool CanGetCookiesInternal(
+ const net::URLRequest& request,
+ const net::CookieList& cookie_list) OVERRIDE;
+ virtual bool CanSetCookieInternal(const net::URLRequest& request,
+ const std::string& cookie_line,
+ net::CookieOptions* options) OVERRIDE;
+ virtual bool CanAccessFileInternal(const net::URLRequest& request,
+ const FilePath& path) const OVERRIDE;
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
void* profile_;
@@ -95,6 +102,9 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
// Weak, owned by our owner.
const policy::URLBlacklistManager* url_blacklist_manager_;
+ // When true, allow access to all file:// URLs.
+ static bool g_allow_file_access_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698