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

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: Fix net unittests Created 8 years, 7 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..dda92d5a556aaa25c42fb5278872cd4a6f213eca 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,13 @@ 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 OnCanGetCookies(const net::URLRequest& request,
+ const net::CookieList& cookie_list) OVERRIDE;
+ virtual bool OnCanSetCookie(const net::URLRequest& request,
+ const std::string& cookie_line,
+ net::CookieOptions* options) OVERRIDE;
+ virtual bool OnCanAccessFile(const net::URLRequest& request,
+ const FilePath& path) const OVERRIDE;
scoped_refptr<ExtensionEventRouterForwarder> event_router_;
void* profile_;
@@ -95,6 +101,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);
};
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698