Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.h |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h |
| index 8c17eef9be6970a9fd9b47198fb2d10594983947..a5a56bedef1dc2b8c69a8675f94671e8e4e37f1c 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.h |
| +++ b/content/browser/renderer_host/render_widget_host_impl.h |
| @@ -53,10 +53,6 @@ struct FrameHostMsg_HittestData_Params; |
| struct ViewHostMsg_SelectionBounds_Params; |
| struct ViewHostMsg_UpdateRect_Params; |
| -namespace base { |
| -class RefCountedBytes; |
| -} |
| - |
| namespace blink { |
| class WebInputEvent; |
| class WebMouseEvent; |
| @@ -70,6 +66,7 @@ class PowerSaveBlocker; |
| #endif |
| namespace gfx { |
| +class Image; |
| class Range; |
| } |
| @@ -209,9 +206,11 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, |
| void NotifyScreenInfoChanged(); |
| // Forces redraw in the renderer and when the update reaches the browser |
| - // grabs snapshot from the compositor. Returns PNG-encoded snapshot. |
| + // grabs snapshot from the compositor. Returns a gfx::Image that is backed |
| + // by an NSImage on MacOS or by an SkBitmap otherwise. The gfx::Image may be |
|
Avi (use Gerrit)
2017/01/09 16:57:33
Why are we doing things differently on the Mac tha
Eric Seckler
2017/01/11 15:58:44
Everywhere but on Mac, we're grabbing from cc laye
Avi (use Gerrit)
2017/01/11 17:09:20
Can we have some kind of note in the code? It's al
Eric Seckler
2017/01/20 09:22:12
Added a comment here. As I understand it, Mac is s
|
| + // empty if the snapshot failed. |
| using GetSnapshotFromBrowserCallback = |
| - base::Callback<void(const unsigned char*, size_t)>; |
| + base::Callback<void(const gfx::Image&)>; |
| void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback); |
| const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; |
| @@ -700,13 +699,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, |
| void WindowSnapshotReachedScreen(int snapshot_id); |
| - void OnSnapshotDataReceived(int snapshot_id, |
| - const unsigned char* png, |
| - size_t size); |
| - |
| - void OnSnapshotDataReceivedAsync( |
| - int snapshot_id, |
| - scoped_refptr<base::RefCountedBytes> png_data); |
| + void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); |
| // 1. Grants permissions to URL (if any) |
| // 2. Grants permissions to filenames |