Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side 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, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/top_sites_database.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } 2565 }
2566 2566
2567 void TabContents::UpdateTargetURL(int32 page_id, const GURL& url) { 2567 void TabContents::UpdateTargetURL(int32 page_id, const GURL& url) {
2568 if (delegate()) 2568 if (delegate())
2569 delegate()->UpdateTargetURL(this, url); 2569 delegate()->UpdateTargetURL(this, url);
2570 } 2570 }
2571 2571
2572 void TabContents::UpdateThumbnail(const GURL& url, 2572 void TabContents::UpdateThumbnail(const GURL& url,
2573 const SkBitmap& bitmap, 2573 const SkBitmap& bitmap,
2574 const ThumbnailScore& score) { 2574 const ThumbnailScore& score) {
2575 if (profile()->IsOffTheRecord())
2576 return;
2577
2575 // Tell History about this thumbnail 2578 // Tell History about this thumbnail
2576 if (history::TopSites::IsEnabled()) { 2579 if (history::TopSites::IsEnabled()) {
2577 if (!profile()->IsOffTheRecord()) { 2580 history::TopSites* ts = profile()->GetTopSites();
2578 history::TopSites* ts = profile()->GetTopSites(); 2581 if (ts)
2579 if (ts) 2582 ts->SetPageThumbnail(url, bitmap, score);
2580 ts->SetPageThumbnail(url, bitmap, score);
2581 }
2582 } else { 2583 } else {
2583 HistoryService* hs; 2584 HistoryService* hs =
2584 if (!profile()->IsOffTheRecord() && 2585 profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
2585 (hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS))) { 2586 if (hs)
2586 hs->SetPageThumbnail(url, bitmap, score); 2587 hs->SetPageThumbnail(url, bitmap, score);
2587 }
2588 } 2588 }
2589 } 2589 }
2590 2590
2591 void TabContents::UpdateInspectorSetting(const std::string& key, 2591 void TabContents::UpdateInspectorSetting(const std::string& key,
2592 const std::string& value) { 2592 const std::string& value) {
2593 RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value); 2593 RenderViewHostDelegateHelper::UpdateInspectorSetting(profile(), key, value);
2594 } 2594 }
2595 2595
2596 void TabContents::ClearInspectorSettings() { 2596 void TabContents::ClearInspectorSettings() {
2597 RenderViewHostDelegateHelper::ClearInspectorSettings(profile()); 2597 RenderViewHostDelegateHelper::ClearInspectorSettings(profile());
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
3320 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); 3320 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save));
3321 } 3321 }
3322 3322
3323 Profile* TabContents::GetProfileForPasswordManager() { 3323 Profile* TabContents::GetProfileForPasswordManager() {
3324 return profile(); 3324 return profile();
3325 } 3325 }
3326 3326
3327 bool TabContents::DidLastPageLoadEncounterSSLErrors() { 3327 bool TabContents::DidLastPageLoadEncounterSSLErrors() {
3328 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); 3328 return controller().ssl_manager()->ProcessedSSLErrorFromRequest();
3329 } 3329 }
OLDNEW
« 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
This is Rietveld 408576698