summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 01:15:32 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 01:15:32 +0000
commit47661b7e351e70c02e339ba352eb3b92f0a6b849 (patch)
treec7067fb0d59252f83e8f68ccaffe563d65ffc041 /chrome
parent5c50ef53508d10638e7d32c059eef5471539d7db (diff)
downloadchromium_src-47661b7e351e70c02e339ba352eb3b92f0a6b849.zip
chromium_src-47661b7e351e70c02e339ba352eb3b92f0a6b849.tar.gz
chromium_src-47661b7e351e70c02e339ba352eb3b92f0a6b849.tar.bz2
Exclude chrome:// requests from showing up on the about:net-internals page.
The problem is that most people would get to about:net-internals by first opening a new tab and then navigating it. Opening a new tab page generates lots of requests, which could end up overwriting things we cared about in the circular buffer of recent requests. BUG=30163 Review URL: http://codereview.chromium.org/491062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc8
-rw-r--r--chrome/browser/net/chrome_url_request_context.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 97fba69..3873748 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -632,6 +632,8 @@ void ChromeURLRequestContextGetter::GetCookieStoreAsyncHelper(
ChromeURLRequestContext::ChromeURLRequestContext() {
CheckCurrentlyOnIOThread();
+ url_request_tracker()->SetGraveyardFilter(
+ &ChromeURLRequestContext::ShouldTrackRequest);
}
ChromeURLRequestContext::~ChromeURLRequestContext() {
@@ -791,6 +793,12 @@ void ChromeURLRequestContext::OnDefaultCharsetChange(
net::HttpUtil::GenerateAcceptCharsetHeader(default_charset);
}
+// static
+bool ChromeURLRequestContext::ShouldTrackRequest(const GURL& url) {
+ // Exclude "chrome://" URLs from our recent requests circular buffer.
+ return !url.SchemeIs("chrome");
+}
+
// ----------------------------------------------------------------------------
// ChromeURLRequestContextFactory
// ----------------------------------------------------------------------------
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 912f484..5d697fc 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -279,6 +279,10 @@ class ChromeURLRequestContext : public URLRequestContext {
bool is_off_the_record_;
private:
+ // Filter for url_request_tracker(), that prevents "chrome://" requests from
+ // being tracked by "about:net-internals".
+ static bool ShouldTrackRequest(const GURL& url);
+
DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext);
};