From 03c5e868627fd74ec5c13cb26df3cb110853765f Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Tue, 17 Feb 2009 22:50:14 +0000 Subject: Persist info about subresources on pages for DNS pre-resolution The DNS pre-resolution system already "learns" what domains are commonly needed when rendering sub-resources of a page at a given domain. This patch saves (some of) the information learned into a persistent pref, and restores it on startup. For now, I put in a wimpy pruning of the list each time I save, so that the list will not grow endlessly from session to session. I probably need a better pruning algorithm, such as one that prunes after a given amount of time, rather than only during shutdown. For now, this should get a lot of nice results, and provide slightly larger than needed lists to users that have long lived sessions, which is similar to the current performance, where I didn't persist any info, and only pruned (actually discarded) all learned info at shutdown. r=mbelshe Review URL: http://codereview.chromium.org/21374 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9912 0039d316-1c4b-4281-b951-d872f2087c98 --- base/values.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base/values.h') diff --git a/base/values.h b/base/values.h index 19a1cb9..cad1311 100644 --- a/base/values.h +++ b/base/values.h @@ -260,14 +260,14 @@ class DictionaryValue : public Value { // It can't be used to modify the dictionary. class key_iterator : private std::iterator { - public: + public: key_iterator(ValueMap::const_iterator itr) { itr_ = itr; } key_iterator operator++() { ++itr_; return *this; } const std::wstring& operator*() { return itr_->first; } bool operator!=(const key_iterator& other) { return itr_ != other.itr_; } bool operator==(const key_iterator& other) { return itr_ == other.itr_; } - private: + private: ValueMap::const_iterator itr_; }; -- cgit v1.1