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

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

Issue 10854069: Fix a bad inversion of logic (see OnCanThrottleRequest) and a bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comment. Created 8 years, 4 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
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 0295195285ba36cd297c38422f76c77a72bd8907..c9f69cc5f68ba611223563a6609831582d0aff68 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -53,6 +53,10 @@ bool ChromeNetworkDelegate::g_allow_file_access_ = false;
bool ChromeNetworkDelegate::g_allow_file_access_ = true;
#endif
+// This remains false unless the --disable-extensions-http-throttling
+// flag is passed to the browser.
+bool ChromeNetworkDelegate::g_never_throttle_requests_ = false;
+
namespace {
// If the |request| failed due to problems with a proxy, forward the error to
@@ -134,7 +138,6 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
cookie_settings_(cookie_settings),
extension_info_map_(extension_info_map),
enable_referrers_(enable_referrers),
- never_throttle_requests_(false),
url_blacklist_manager_(url_blacklist_manager),
cache_stats_(cache_stats) {
DCHECK(event_router);
@@ -144,8 +147,9 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
ChromeNetworkDelegate::~ChromeNetworkDelegate() {}
+// static
void ChromeNetworkDelegate::NeverThrottleRequests() {
- never_throttle_requests_ = true;
+ g_never_throttle_requests_ = true;
}
// static
@@ -368,11 +372,11 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
bool ChromeNetworkDelegate::OnCanThrottleRequest(
const net::URLRequest& request) const {
- if (never_throttle_requests_) {
+ if (g_never_throttle_requests_) {
return false;
}
- return request.first_party_for_cookies().scheme() !=
+ return request.first_party_for_cookies().scheme() ==
chrome::kExtensionScheme;
}
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698