diff options
| author | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 23:45:35 +0000 |
|---|---|---|
| committer | acolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 23:45:35 +0000 |
| commit | 2f0158e718ff28a6884ffed00fc740a771e7929f (patch) | |
| tree | 94e900a0a0be8f5cb20cd76eabfe73dfc1634437 /chrome/browser/tab_contents | |
| parent | fdd84dc3a652c41a5f4e27a2363221c7a215f4f3 (diff) | |
| download | chromium_src-2f0158e718ff28a6884ffed00fc740a771e7929f.zip chromium_src-2f0158e718ff28a6884ffed00fc740a771e7929f.tar.gz chromium_src-2f0158e718ff28a6884ffed00fc740a771e7929f.tar.bz2 | |
Revert 104597 - base::Bind: Complete cleanup of history/.
Breaks Linux Touch.
BUG=none
TEST=none
R=csilv@chromium.org
Review URL: http://codereview.chromium.org/8163005
TBR=jhawkins@chromium.org
Review URL: http://codereview.chromium.org/8207012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
| -rw-r--r-- | chrome/browser/tab_contents/thumbnail_generator.cc | 12 | ||||
| -rw-r--r-- | chrome/browser/tab_contents/thumbnail_generator.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc index 1f431ba..f7c16ba 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.cc +++ b/chrome/browser/tab_contents/thumbnail_generator.cc @@ -130,7 +130,7 @@ SkBitmap GetBitmapForBackingStore( } // namespace struct ThumbnailGenerator::AsyncRequestInfo { - ThumbnailReadyCallback callback; + scoped_ptr<ThumbnailReadyCallback> callback; scoped_ptr<TransportDIB> thumbnail_dib; RenderWidgetHost* renderer; // Not owned. }; @@ -195,9 +195,11 @@ void ThumbnailGenerator::MonitorRenderer(RenderWidgetHost* renderer, void ThumbnailGenerator::AskForSnapshot(RenderWidgetHost* renderer, bool prefer_backing_store, - const ThumbnailReadyCallback& callback, + ThumbnailReadyCallback* callback, gfx::Size page_size, gfx::Size desired_size) { + scoped_ptr<ThumbnailReadyCallback> callback_deleter(callback); + if (prefer_backing_store) { BackingStore* backing_store = renderer->GetBackingStore(false); if (backing_store) { @@ -208,7 +210,7 @@ void ThumbnailGenerator::AskForSnapshot(RenderWidgetHost* renderer, desired_size.height(), kNoOptions, NULL); - callback.Run(first_try); + callback->Run(first_try); return; } @@ -247,7 +249,7 @@ void ThumbnailGenerator::AskForSnapshot(RenderWidgetHost* renderer, #endif linked_ptr<AsyncRequestInfo> request_info(new AsyncRequestInfo); - request_info->callback = callback; + request_info->callback.reset(callback_deleter.release()); request_info->thumbnail_dib.reset(thumbnail_dib.release()); request_info->renderer = renderer; ThumbnailCallbackMap::value_type new_value(sequence_num, request_info); @@ -316,7 +318,7 @@ void ThumbnailGenerator::WidgetDidReceivePaintAtSizeAck( // TODO: Figure out a way to avoid this copy? non_owned_bitmap.copyTo(&result, SkBitmap::kARGB_8888_Config); - item->second->callback.Run(result); + item->second->callback->Run(result); // We're done with the callback, and with the DIB, so delete both. callback_map_.erase(item); diff --git a/chrome/browser/tab_contents/thumbnail_generator.h b/chrome/browser/tab_contents/thumbnail_generator.h index 8329f29..0c0e588 100644 --- a/chrome/browser/tab_contents/thumbnail_generator.h +++ b/chrome/browser/tab_contents/thumbnail_generator.h @@ -32,7 +32,7 @@ class TopSites; class ThumbnailGenerator : public NotificationObserver, public TabContentsObserver { public: - typedef base::Callback<void(const SkBitmap&)> ThumbnailReadyCallback; + typedef Callback1<const SkBitmap&>::Type ThumbnailReadyCallback; // The result of clipping. This can be used to determine if the // generated thumbnail is good or not. enum ClipResult { @@ -80,7 +80,7 @@ class ThumbnailGenerator : public NotificationObserver, // dimensions, but might not be the exact size requested. void AskForSnapshot(RenderWidgetHost* renderer, bool prefer_backing_store, - const ThumbnailReadyCallback& callback, + ThumbnailReadyCallback* callback, gfx::Size page_size, gfx::Size desired_size); |
