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

Unified Diff: chrome/browser/thumbnails/thumbnail_tab_helper.h

Issue 1461463002: Reland fix for thumbnail generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tight ownership of context, still ref counted Created 4 years, 11 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/thumbnails/thumbnail_tab_helper.h
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.h b/chrome/browser/thumbnails/thumbnail_tab_helper.h
index df9a731da1adaf3b3d8b551015a118608715b40b..27af8d8b245081a0bc3054c2e4a5dd5ec9f964d5 100644
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.h
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/thumbnails/thumbnailing_context.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -39,7 +40,19 @@ class ThumbnailTabHelper
void DidStartLoading() override;
void NavigationStopped() override;
- // Update the thumbnail of the given tab contents if necessary.
+ void DecrementCapturerCount();
+ void UpdateThumbnail(
+ const thumbnails::ThumbnailingContext& context,
+ const SkBitmap& thumbnail);
+ void ProcessCapturedBitmap(
+ scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm,
+ const SkBitmap& bitmap,
+ content::ReadbackResponse response);
+
+ void AsyncProcessThumbnail(
+ scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm);
+
+// Update the thumbnail of the given tab contents if necessary.
void UpdateThumbnailIfNecessary(content::WebContents* web_contents);
// Called when a render view host was created for a WebContents.
@@ -49,9 +62,12 @@ class ThumbnailTabHelper
void WidgetHidden(content::RenderWidgetHost* widget);
content::NotificationRegistrar registrar_;
+ scoped_refptr<thumbnails::ThumbnailingContext> thumbnailing_context_;
bool load_interrupted_;
+ base::WeakPtrFactory<ThumbnailTabHelper> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper);
};
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698