From 1da70a5924f41d7e2682c43e175b1b05796d13d4 Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Fri, 23 Jan 2009 01:00:16 +0000 Subject: Handle race between deleting a low use referrer acruing value Prevent a DCHECK from firing. As we adaptively learn about referrers to enhance DNS pre-resolution, we are forced to evict some entries to prevent accidentally getting really large lists (when we make mistakes). Sometimes we evict a referred item from a list *while* that item is being resolved (because it was in teh list). In that case, we have to be careful when we try to acrue credit (latency savings). r=paulg Review URL: http://codereview.chromium.org/18527 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8531 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/net/referrer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'chrome/browser/net/referrer.h') diff --git a/chrome/browser/net/referrer.h b/chrome/browser/net/referrer.h index 455b9b7..d3fb12e 100644 --- a/chrome/browser/net/referrer.h +++ b/chrome/browser/net/referrer.h @@ -47,13 +47,13 @@ typedef std::map HostNameMap; //------------------------------------------------------------------------------ // There is one Referrer instance for each hostname that has acted as an HTTP -// referer (note mispelling is intentional) for a domain that was otherwise -// unexpectedly navgated towards ("unexpected" in the sense that the domain was -// probably for a subresource of a page, and was not otherwise predictable until -// the content with the reference arrived). Most typically, an outer page was a -// page fetched by the user, and this instance lists names in HostNameMap which -// are subresources and that were needed to complete the rendering of the outer -// page. +// referer (note mispelling is intentional) for a hostname that was otherwise +// unexpectedly navgated towards ("unexpected" in the sense that the hostname +// was probably needad as a subresource of a page, and was not otherwise +// predictable until the content with the reference arrived). Most typically, +// an outer page was a page fetched by the user, and this instance lists names +// in HostNameMap which are subresources and that were needed to complete the +// rendering of the outer page. class Referrer : public HostNameMap { public: // Add the indicated host to the list of hosts that are resolved via DNS when @@ -69,7 +69,7 @@ class Referrer : public HostNameMap { // Helper function for pruning list. Metric for usefulness is "large accrued // value," in the form of latency_ savings associated with a host name. We // also give credit for a name being newly added, by scalling latency per - // lifetime (time since birth). For instance, when to names have accrued + // lifetime (time since birth). For instance, when two names have accrued // the same latency_ savings, the older one is less valuable as it didn't // accrue savings as quickly. void DeleteLeastUseful(); -- cgit v1.1