Index: chrome/browser/thumbnails/thumbnail_tab_helper.cc |
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc |
index f8322e76f9a2d9573939dea942a32fe342b8bffb..7cdfa3f9cf04e6e1dbb09c821b547c93c4b93b2f 100644 |
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc |
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc |
@@ -66,6 +66,9 @@ void ProcessCapturedBitmap(scoped_refptr<ThumbnailingContext> context, |
scoped_refptr<ThumbnailingAlgorithm> algorithm, |
const SkBitmap& bitmap, |
content::ReadbackResponse response) { |
+ // Balance the IncrementCapturerCount() from UpdateThumbnailIfNecessary(). |
+ context->web_contents->DecrementCapturerCount(); |
+ |
if (response != content::READBACK_SUCCESS) |
return; |
@@ -196,6 +199,8 @@ void ThumbnailTabHelper::UpdateThumbnailIfNecessary( |
return; |
} |
+ web_contents->IncrementCapturerCount(gfx::Size()); |
+ |
scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm( |
thumbnail_service->GetThumbnailingAlgorithm()); |