Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index f2a0f74dd0be0d5abaa9a5ac17b99f8c89617c12..320c28bc67facae764c203e0ef120806ac1a28e9 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -288,9 +288,9 @@ void BrowserPluginGuest::UpdateVisibility() { |
} |
void BrowserPluginGuest::CopyFromCompositingSurface( |
- gfx::Rect src_subrect, |
- gfx::Size dst_size, |
- const base::Callback<void(bool, const SkBitmap&)>& callback) { |
+ gfx::Rect src_subrect, |
+ gfx::Size dst_size, |
+ CopyFromCompositingSurfaceCallback& callback) { |
copy_request_callbacks_.insert(std::make_pair(++copy_request_id_, callback)); |
SendMessageToEmbedder( |
new BrowserPluginMsg_CopyFromCompositingSurface( |
@@ -734,8 +734,12 @@ void BrowserPluginGuest::OnCopyFromCompositingSurfaceAck( |
CHECK(copy_request_callbacks_.count(request_id)); |
if (!copy_request_callbacks_.count(request_id)) |
return; |
- const CopyRequestCallback& callback = copy_request_callbacks_[request_id]; |
- callback.Run(!bitmap.empty() && !bitmap.isNull(), bitmap); |
+ const CopyFromCompositingSurfaceCallback& callback = |
+ copy_request_callbacks_[request_id]; |
+ bool success = !bitmap.empty() && !bitmap.isNull(); |
+ callback.Run(success, |
+ bitmap, |
+ success ? content::READBACK_SUCCESS : content::READBACK_FAILED); |
copy_request_callbacks_.erase(request_id); |
} |