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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: fix return value description + rebase Created 4 years 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: 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..ed5fe6b696e27be8e0fe99783294fe52d3ebc2d7 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -49,14 +49,11 @@
#include "ui/events/latency_info.h"
#include "ui/gfx/native_widget_types.h"
+class SkBitmap;
struct FrameHostMsg_HittestData_Params;
struct ViewHostMsg_SelectionBounds_Params;
struct ViewHostMsg_UpdateRect_Params;
-namespace base {
-class RefCountedBytes;
-}
-
namespace blink {
class WebInputEvent;
class WebMouseEvent;
@@ -209,9 +206,9 @@ 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.
- using GetSnapshotFromBrowserCallback =
- base::Callback<void(const unsigned char*, size_t)>;
+ // grabs snapshot from the compositor. Returns an SkBitmap containing the
+ // snapshot or an empty SkBitmap if taking the snapshot failed.
+ using GetSnapshotFromBrowserCallback = base::Callback<void(const SkBitmap&)>;
void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback);
const NativeWebKeyboardEvent* GetLastKeyboardEvent() const;
@@ -700,13 +697,10 @@ 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,
+ int retry_count,
+ const SkBitmap& bitmap,
+ ReadbackResponse response);
// 1. Grants permissions to URL (if any)
// 2. Grants permissions to filenames

Powered by Google App Engine
This is Rietveld 408576698