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

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: Providing implementations for the other platforms 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..3f21d11d23a684d725fef9403eb408eccbe908c3 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -502,8 +502,9 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary(
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
history::TopSites* top_sites = profile->GetTopSites();
+ bool has_surface = web_contents->GetRenderWidgetHostView()->HasSurface();
// Skip if we don't need to update the thumbnail.
- if (!ShouldUpdateThumbnail(profile, top_sites, url))
+ if (!ShouldUpdateThumbnail(profile, top_sites, url, has_surface))
return;
AsyncUpdateThumbnail(web_contents);
@@ -583,7 +584,10 @@ void ThumbnailGenerator::AsyncUpdateThumbnailFinish(
bool ThumbnailGenerator::ShouldUpdateThumbnail(Profile* profile,
history::TopSites* top_sites,
- const GURL& url) {
+ const GURL& url,
+ bool has_surface) {
+ if (!has_surface)
+ return false;
if (!profile || !top_sites)
return false;
// Skip if it's in the incognito mode.

Powered by Google App Engine
This is Rietveld 408576698