summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 22:33:44 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 22:33:44 +0000
commite6baed56407e548b4d4019aeb27d40d900824042 (patch)
tree96e41d4988731736323a124a87d5cf2c298ef023 /chrome/browser/tab_contents
parent07910cb764fe0772f93ca55ad95588c3f682e268 (diff)
downloadchromium_src-e6baed56407e548b4d4019aeb27d40d900824042.zip
chromium_src-e6baed56407e548b4d4019aeb27d40d900824042.tar.gz
chromium_src-e6baed56407e548b4d4019aeb27d40d900824042.tar.bz2
Tweaks to improve memory consumption by TopSites. The biggest culprit
seems to repeatedly querying history during this perf test. So, the biggest gain is made by scaling this back. Here are other tweaks I've made: . decrease the page size/cache size of the two DBs. Now that favicons doesn't store thumbnails the db doesn't need to be so big. . Set a cap to the max number of tmp thumnbails maintains. . Force jpg data vector to be only as big as it needs to be. . Tweak TopSitesCache so it doesn't end up duplicating so many GURLs. This is particularly helpful for long redirect lists. BUG=61487 TEST=none Review URL: http://codereview.chromium.org/4106014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 288b5b6..e30970c 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2572,19 +2572,19 @@ void TabContents::UpdateTargetURL(int32 page_id, const GURL& url) {
void TabContents::UpdateThumbnail(const GURL& url,
const SkBitmap& bitmap,
const ThumbnailScore& score) {
+ if (profile()->IsOffTheRecord())
+ return;
+
// Tell History about this thumbnail
if (history::TopSites::IsEnabled()) {
- if (!profile()->IsOffTheRecord()) {
- history::TopSites* ts = profile()->GetTopSites();
- if (ts)
- ts->SetPageThumbnail(url, bitmap, score);
- }
+ history::TopSites* ts = profile()->GetTopSites();
+ if (ts)
+ ts->SetPageThumbnail(url, bitmap, score);
} else {
- HistoryService* hs;
- if (!profile()->IsOffTheRecord() &&
- (hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS))) {
+ HistoryService* hs =
+ profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
+ if (hs)
hs->SetPageThumbnail(url, bitmap, score);
- }
}
}