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

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

Issue 10349013: Prevent browser thumbnailer from trying to read from frontbuffer (surface texture) when none exists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renaming HasSurface to IsSurfaceAvailableForCopy Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/thumbnail_generator.cc
diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc
index 162094b85936b01bd7cd204243670ba5e27907e1..d16924e379f1d11f769cbb2e37be1fede3edfc32 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -502,8 +502,10 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary(
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
history::TopSites* top_sites = profile->GetTopSites();
+ bool surface_available =
+ web_contents->GetRenderWidgetHostView()->IsSurfaceAvailableForCopy();
// Skip if we don't need to update the thumbnail.
- if (!ShouldUpdateThumbnail(profile, top_sites, url))
+ if (!ShouldUpdateThumbnail(profile, top_sites, url, surface_available))
mazda 2012/05/04 22:20:32 How about just doing as follows? if (!surface_ava
mmocny 2012/05/07 13:28:23 Yes, it is certainly a bit silly to move the bool
mazda 2012/05/07 16:37:19 We do not plan to use ShouldUpdateThumbnail in oth
return;
AsyncUpdateThumbnail(web_contents);
@@ -583,7 +585,10 @@ void ThumbnailGenerator::AsyncUpdateThumbnailFinish(
bool ThumbnailGenerator::ShouldUpdateThumbnail(Profile* profile,
history::TopSites* top_sites,
- const GURL& url) {
+ const GURL& url,
+ bool surface_available) {
+ if (!surface_available)
+ return false;
if (!profile || !top_sites)
return false;
// Skip if it's in the incognito mode.
« no previous file with comments | « chrome/browser/tab_contents/thumbnail_generator.h ('k') | chrome/browser/tab_contents/thumbnail_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698