Chromium Code Reviews

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 4106014: Tweaks to improve memory consumption by TopSites. The biggest culprit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/history/top_sites_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 288b5b6fa6e6d88d212b9124455fe29cff3a771a..e30970c4884e2e0793740c0cd8dfc5efd99cc216 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);
- }
}
}
« no previous file with comments | « chrome/browser/history/top_sites_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine