summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_throttler_manager.h
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 21:11:53 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 21:11:53 +0000
commit227b0e8d0e0f62dc2ee2a50aca77de83ff394278 (patch)
treee185402e8a1da224dc3ac55ebd0fa295ce07a5ad /net/url_request/url_request_throttler_manager.h
parent76c551c6fe7dcfc664b9261eaec812a1966d1984 (diff)
downloadchromium_src-227b0e8d0e0f62dc2ee2a50aca77de83ff394278.zip
chromium_src-227b0e8d0e0f62dc2ee2a50aca77de83ff394278.tar.gz
chromium_src-227b0e8d0e0f62dc2ee2a50aca77de83ff394278.tar.bz2
Support enabling/disabling the URL request throttler via the about:net-internals page:
- Add a new tab to the about:net-internals page. - Add a preference item to persist user's choice. - Remove the command line switch --disable-enforced-throttling. - Make throttling feature off by default for now. This is 95% based on yzshen@chromium.org's patch http://codereview.chromium.org/6286001/ which was never landed. The changes that have been made from that patch are mostly cosmetic, apart from updating it to match the codebase (the patch was prepared ~2 months ago) and responding to eroman@'s initial round of code review comments. BUG=66062 TEST=Make sure the checkbox on about:net-internals > HTTP Throttling is checked. (1) Type in the addresss bar a URL which is expected to return 5XX. (2) Keep clicking the "reload" button. (3) After a few clicks, Chrome displays an error page explaining why a net::ERR_TEMPORARILY_THROTTLED error occurs. Make sure the checkbox on about:net-internals > HTTP Throttling is unchecked. Following step (1) and (2) described above won't result in a net::ERR_TEMPORARILY_THROTTLED error page. Review URL: http://codereview.chromium.org/6677085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79455 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_throttler_manager.h')
-rw-r--r--net/url_request/url_request_throttler_manager.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/url_request/url_request_throttler_manager.h b/net/url_request/url_request_throttler_manager.h
index c48e917..d65b20f 100644
--- a/net/url_request/url_request_throttler_manager.h
+++ b/net/url_request/url_request_throttler_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -53,9 +53,15 @@ class URLRequestThrottlerManager : public base::NonThreadSafe {
// It is only used by unit tests.
void EraseEntryForTests(const GURL& url);
- void InitializeOptions(bool enforce_throttling);
+ // Turns threading model verification on or off. Any code that correctly
+ // uses the network stack should preferably call this function to enable
+ // verification of correct adherence to the network stack threading model.
+ void set_enable_thread_checks(bool enable);
+ bool enable_thread_checks() const;
- bool enforce_throttling() const { return enforce_throttling_; }
+ // Whether throttling is enabled or not.
+ void set_enforce_throttling(bool enforce);
+ bool enforce_throttling();
protected:
URLRequestThrottlerManager();
@@ -113,7 +119,7 @@ class URLRequestThrottlerManager : public base::NonThreadSafe {
//
// TODO(joi): See if we can fix the offending unit tests and remove this
// workaround.
- bool being_tested_;
+ bool enable_thread_checks_;
DISALLOW_COPY_AND_ASSIGN(URLRequestThrottlerManager);
};