OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // otherwise, the settings are enforced on all observed network requests. | 35 // otherwise, the settings are enforced on all observed network requests. |
36 ChromeNetworkDelegate( | 36 ChromeNetworkDelegate( |
37 ExtensionEventRouterForwarder* event_router, | 37 ExtensionEventRouterForwarder* event_router, |
38 ExtensionInfoMap* extension_info_map, | 38 ExtensionInfoMap* extension_info_map, |
39 const policy::URLBlacklistManager* url_blacklist_manager, | 39 const policy::URLBlacklistManager* url_blacklist_manager, |
40 void* profile, | 40 void* profile, |
41 CookieSettings* cookie_settings, | 41 CookieSettings* cookie_settings, |
42 BooleanPrefMember* enable_referrers); | 42 BooleanPrefMember* enable_referrers); |
43 virtual ~ChromeNetworkDelegate(); | 43 virtual ~ChromeNetworkDelegate(); |
44 | 44 |
| 45 // Causes |OnCanThrottleRequest| to never return true. |
| 46 void NeverThrottleRequests(); |
| 47 |
45 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. | 48 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
46 // This method should be called on the UI thread. | 49 // This method should be called on the UI thread. |
47 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 50 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
48 PrefService* pref_service); | 51 PrefService* pref_service); |
49 | 52 |
50 // When called, all file:// URLs will now be accessible. If this is not | 53 // When called, all file:// URLs will now be accessible. If this is not |
51 // called, then some platforms restrict access to file:// paths. | 54 // called, then some platforms restrict access to file:// paths. |
52 static void AllowAccessToAllFiles(); | 55 static void AllowAccessToAllFiles(); |
53 | 56 |
54 private: | 57 private: |
(...skipping 26 matching lines...) Expand all Loading... |
81 const net::AuthChallengeInfo& auth_info, | 84 const net::AuthChallengeInfo& auth_info, |
82 const AuthCallback& callback, | 85 const AuthCallback& callback, |
83 net::AuthCredentials* credentials) OVERRIDE; | 86 net::AuthCredentials* credentials) OVERRIDE; |
84 virtual bool OnCanGetCookies(const net::URLRequest& request, | 87 virtual bool OnCanGetCookies(const net::URLRequest& request, |
85 const net::CookieList& cookie_list) OVERRIDE; | 88 const net::CookieList& cookie_list) OVERRIDE; |
86 virtual bool OnCanSetCookie(const net::URLRequest& request, | 89 virtual bool OnCanSetCookie(const net::URLRequest& request, |
87 const std::string& cookie_line, | 90 const std::string& cookie_line, |
88 net::CookieOptions* options) OVERRIDE; | 91 net::CookieOptions* options) OVERRIDE; |
89 virtual bool OnCanAccessFile(const net::URLRequest& request, | 92 virtual bool OnCanAccessFile(const net::URLRequest& request, |
90 const FilePath& path) const OVERRIDE; | 93 const FilePath& path) const OVERRIDE; |
| 94 virtual bool OnCanThrottleRequest( |
| 95 const net::URLRequest& request) const OVERRIDE; |
91 | 96 |
92 scoped_refptr<ExtensionEventRouterForwarder> event_router_; | 97 scoped_refptr<ExtensionEventRouterForwarder> event_router_; |
93 void* profile_; | 98 void* profile_; |
94 scoped_refptr<CookieSettings> cookie_settings_; | 99 scoped_refptr<CookieSettings> cookie_settings_; |
95 | 100 |
96 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 101 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
97 | 102 |
98 // Weak, owned by our owner. | 103 // Weak, owned by our owner. |
99 BooleanPrefMember* enable_referrers_; | 104 BooleanPrefMember* enable_referrers_; |
100 | 105 |
| 106 // True if OnCanThrottleRequest should always return false. |
| 107 bool never_throttle_requests_; |
| 108 |
101 // Weak, owned by our owner. | 109 // Weak, owned by our owner. |
102 const policy::URLBlacklistManager* url_blacklist_manager_; | 110 const policy::URLBlacklistManager* url_blacklist_manager_; |
103 | 111 |
104 // When true, allow access to all file:// URLs. | 112 // When true, allow access to all file:// URLs. |
105 static bool g_allow_file_access_; | 113 static bool g_allow_file_access_; |
106 | 114 |
107 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 115 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
108 }; | 116 }; |
109 | 117 |
110 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 118 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |