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

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)

Created:
4 years ago by Eric Seckler
Modified:
3 years, 11 months ago
CC:
apavlov+blink_chromium.org, blink-reviews, caseq+blink_chromium.org, chromium-reviews, darin-cc_chromium.org, devtools-reviews_chromium.org, dgozman, jam, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, Sami, danakj
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[devtools] Support different encodings for Page.CaptureScreenshot. This adds support for jpeg encoding of screenshots, similar to that for screencasts. For this purpose, the patch modifies ui::Grab*Snapshot* methods to return a gfx::Image instead of a png. Utility methods can then encode the gfx::Image to jpeg/png depending on its platform-specific backing representation. BUG=676282 Review-Url: https://codereview.chromium.org/2592983002 Cr-Original-Commit-Position: refs/heads/master@{#445730} Committed: https://chromium.googlesource.com/chromium/src/+/b6438b1ca6462f3cc014cd1bf18410957101a119 Review-Url: https://codereview.chromium.org/2592983002 Cr-Commit-Position: refs/heads/master@{#446021} Committed: https://chromium.googlesource.com/chromium/src/+/7233c1a70ea0194caf10f4365cf3520e5be7aa8f

Patch Set 1 : . #

Total comments: 2

Patch Set 2 : fix return value description + rebase #

Total comments: 1

Patch Set 3 : Encode in ui snapshot methods instead. #

Total comments: 10

Patch Set 4 : Return gfx::Image from ui snapshot methods instead. #

Total comments: 4

Patch Set 5 : Wait for load in CaptureScreenshotTest to fix android bot. #

Total comments: 26

Patch Set 6 : Address reviewer comments & partly fix snapshot unittests (aura/mac). #

Patch Set 7 : Fix snapshot unit tests & enable on trybots. #

Patch Set 8 : rebase & added a comment. #

Patch Set 9 : Disabled test on MacOS >=10.11, added ref to bug. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+457 lines, -327 lines) Patch
M chrome/browser/android/feedback/screenshot_task.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc View 1 2 3 6 chunks +17 lines, -22 lines 0 comments Download
M chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/devtools/protocol/devtools_protocol_browsertest.cc View 1 2 3 4 5 6 7 8 7 chunks +84 lines, -13 lines 0 comments Download
M content/browser/devtools/protocol/page_handler.h View 1 2 3 4 4 chunks +12 lines, -4 lines 0 comments Download
M content/browser/devtools/protocol/page_handler.cc View 1 2 3 4 6 chunks +32 lines, -35 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -13 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -28 lines 0 comments Download
M testing/buildbot/chromium.linux.json View 1 2 3 4 5 6 7 3 chunks +18 lines, -0 lines 0 comments Download
M testing/buildbot/chromium.mac.json View 1 2 3 4 5 6 5 chunks +25 lines, -0 lines 0 comments Download
M testing/buildbot/gn_isolate_map.pyl View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/browser_protocol.json View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/image/image_util.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/image/image_util.cc View 1 2 3 1 chunk +11 lines, -1 line 0 comments Download
A ui/gfx/image/image_util_mac.mm View 1 2 3 4 5 1 chunk +40 lines, -0 lines 0 comments Download
M ui/snapshot/BUILD.gn View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M ui/snapshot/screenshot_grabber.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M ui/snapshot/screenshot_grabber.cc View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download
M ui/snapshot/snapshot.h View 1 2 3 4 5 2 chunks +15 lines, -13 lines 0 comments Download
A ui/snapshot/snapshot.cc View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
M ui/snapshot/snapshot_android.cc View 1 2 3 4 5 2 chunks +17 lines, -26 lines 0 comments Download
M ui/snapshot/snapshot_async.h View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M ui/snapshot/snapshot_async.cc View 1 2 3 3 chunks +4 lines, -38 lines 0 comments Download
M ui/snapshot/snapshot_aura.cc View 1 2 3 4 5 2 chunks +15 lines, -19 lines 0 comments Download
M ui/snapshot/snapshot_aura_unittest.cc View 1 2 3 4 5 6 8 chunks +18 lines, -28 lines 0 comments Download
M ui/snapshot/snapshot_ios.mm View 1 2 3 4 5 2 chunks +12 lines, -16 lines 0 comments Download
M ui/snapshot/snapshot_mac.mm View 1 2 3 4 5 5 chunks +17 lines, -32 lines 0 comments Download
M ui/snapshot/snapshot_mac_unittest.mm View 1 2 3 4 5 6 7 8 1 chunk +19 lines, -16 lines 0 comments Download

Messages

Total messages: 164 (125 generated)
Eric Seckler
Dmitry, would you be up for having a look at this? :)
4 years ago (2016-12-21 15:10:54 UTC) #9
Sami
https://codereview.chromium.org/2592983002/diff/20001/third_party/WebKit/Source/core/inspector/browser_protocol.json File third_party/WebKit/Source/core/inspector/browser_protocol.json (right): https://codereview.chromium.org/2592983002/diff/20001/third_party/WebKit/Source/core/inspector/browser_protocol.json#newcode424 third_party/WebKit/Source/core/inspector/browser_protocol.json:424: { "name": "data", "type": "string", "description": "Base64-encoded image data ...
4 years ago (2016-12-21 16:30:24 UTC) #10
Eric Seckler
Dmitry, WDYT? :) https://codereview.chromium.org/2592983002/diff/20001/third_party/WebKit/Source/core/inspector/browser_protocol.json File third_party/WebKit/Source/core/inspector/browser_protocol.json (right): https://codereview.chromium.org/2592983002/diff/20001/third_party/WebKit/Source/core/inspector/browser_protocol.json#newcode424 third_party/WebKit/Source/core/inspector/browser_protocol.json:424: { "name": "data", "type": "string", "description": ...
4 years ago (2016-12-22 16:57:32 UTC) #13
pfeldman
https://codereview.chromium.org/2592983002/diff/40001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (left): https://codereview.chromium.org/2592983002/diff/40001/content/browser/renderer_host/render_widget_host_impl.cc#oldcode2358 content/browser/renderer_host/render_widget_host_impl.cc:2358: if (ui::GrabViewSnapshot( The idea behind this grab method is ...
4 years ago (2016-12-22 18:07:41 UTC) #15
Eric Seckler
Thanks for taking a look, Pavel :) On 2016/12/22 18:07:41, pfeldman wrote: > https://codereview.chromium.org/2592983002/diff/40001/content/browser/renderer_host/render_widget_host_impl.cc > ...
4 years ago (2016-12-22 19:52:37 UTC) #16
pfeldman
On 2016/12/22 19:52:37, Eric Seckler wrote: > Thanks for taking a look, Pavel :) > ...
4 years ago (2016-12-22 22:56:18 UTC) #17
Eric Seckler
Thanks for confirming, Pavel. I've moved the encoding into the ui::Grab*Snapshot methods, PTAL :)
3 years, 11 months ago (2017-01-03 10:55:28 UTC) #33
pfeldman
I think we should grab once and encode multiple times instead of grabbing for each ...
3 years, 11 months ago (2017-01-03 18:42:33 UTC) #36
Eric Seckler
Thanks Pavel, comments inline :) https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode665 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:665: content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), On 2017/01/03 18:42:33, ...
3 years, 11 months ago (2017-01-03 19:18:09 UTC) #37
pfeldman
https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode665 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:665: content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), Oh, you are using the harness one. I ...
3 years, 11 months ago (2017-01-04 00:10:50 UTC) #38
Eric Seckler
https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/120001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode665 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:665: content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), On 2017/01/04 00:10:50, pfeldman wrote: > Oh, you ...
3 years, 11 months ago (2017-01-06 21:06:01 UTC) #60
pfeldman
lgtm, thanks! Please run ui/macos-specific code against corresponding owners.
3 years, 11 months ago (2017-01-07 01:13:14 UTC) #67
pfeldman
https://codereview.chromium.org/2592983002/diff/240001/content/browser/devtools/protocol/page_handler.cc File content/browser/devtools/protocol/page_handler.cc (right): https://codereview.chromium.org/2592983002/diff/240001/content/browser/devtools/protocol/page_handler.cc#newcode572 content/browser/devtools/protocol/page_handler.cc:572: base::PostTaskWithTraitsAndReplyWithResult( Why is this necessary? Weren't we doing it ...
3 years, 11 months ago (2017-01-07 01:13:28 UTC) #68
Eric Seckler
enne@, you might be able to help with a comment in ui/snapshot/snapshot_aura_unittest.cc below. Also adding ...
3 years, 11 months ago (2017-01-09 14:52:05 UTC) #74
Avi (use Gerrit)
https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode506 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:506: static_cast<int32_t>(expected_color)) > error_limit) { An SkColor is a set ...
3 years, 11 months ago (2017-01-09 16:57:34 UTC) #77
David Trainor- moved to gerrit
chrome/browser/android/feedback lgtm!
3 years, 11 months ago (2017-01-09 22:17:33 UTC) #78
Avi (use Gerrit)
https://codereview.chromium.org/2592983002/diff/260001/ui/gfx/image/image_util.h File ui/gfx/image/image_util.h (right): https://codereview.chromium.org/2592983002/diff/260001/ui/gfx/image/image_util.h#newcode36 ui/gfx/image/image_util.h:36: bool JPEG1xEncodedDataFromSkiaRepresentation(const Image& image, On 2017/01/09 16:57:33, Avi wrote: ...
3 years, 11 months ago (2017-01-09 22:59:57 UTC) #79
sadrul
https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot.cc File ui/snapshot/snapshot.cc (right): https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot.cc#newcode37 ui/snapshot/snapshot.cc:37: background_task_runner, callback)); std::move(background_task_runner) https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot.h File ui/snapshot/snapshot.h (right): https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot.h#newcode40 ui/snapshot/snapshot.h:40: ...
3 years, 11 months ago (2017-01-10 05:12:50 UTC) #80
enne (OOO)
https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc File ui/snapshot/snapshot_aura_unittest.cc (right): https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc#newcode150 ui/snapshot/snapshot_aura_unittest.cc:150: // TODO(eseckler): This doesn't actually wait until the copy ...
3 years, 11 months ago (2017-01-10 19:26:04 UTC) #81
Eric Seckler
Thanks everyone, PTAL! :) https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode506 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:506: static_cast<int32_t>(expected_color)) > error_limit) { On ...
3 years, 11 months ago (2017-01-11 15:58:44 UTC) #97
Avi (use Gerrit)
lgtm https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc File content/browser/devtools/protocol/devtools_protocol_browsertest.cc (right): https://codereview.chromium.org/2592983002/diff/260001/content/browser/devtools/protocol/devtools_protocol_browsertest.cc#newcode657 content/browser/devtools/protocol/devtools_protocol_browsertest.cc:657: // See crbug.com/653637. On 2017/01/11 15:58:44, Eric Seckler ...
3 years, 11 months ago (2017-01-11 17:09:20 UTC) #98
sadrul
https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc File ui/snapshot/snapshot_aura_unittest.cc (right): https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc#newcode150 ui/snapshot/snapshot_aura_unittest.cc:150: // TODO(eseckler): This doesn't actually wait until the copy ...
3 years, 11 months ago (2017-01-11 17:16:54 UTC) #99
oshima
On 2017/01/11 17:16:54, sadrul wrote: > https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc > File ui/snapshot/snapshot_aura_unittest.cc (right): > > https://codereview.chromium.org/2592983002/diff/260001/ui/snapshot/snapshot_aura_unittest.cc#newcode150 > ...
3 years, 11 months ago (2017-01-13 22:08:27 UTC) #100
Eric Seckler
Sadrul, PTAL. oshima@, can you also have a look at the chromeos bits, please? +phajdan.jr@ ...
3 years, 11 months ago (2017-01-19 13:49:12 UTC) #120
oshima
c/b/chromeos lgtm
3 years, 11 months ago (2017-01-20 00:34:46 UTC) #123
Eric Seckler
https://codereview.chromium.org/2592983002/diff/260001/content/browser/renderer_host/render_widget_host_impl.h File content/browser/renderer_host/render_widget_host_impl.h (right): https://codereview.chromium.org/2592983002/diff/260001/content/browser/renderer_host/render_widget_host_impl.h#newcode210 content/browser/renderer_host/render_widget_host_impl.h:210: // by an NSImage on MacOS or by an ...
3 years, 11 months ago (2017-01-20 09:22:12 UTC) #124
sadrul
lgtm
3 years, 11 months ago (2017-01-20 16:15:19 UTC) #125
Eric Seckler
-Pawel (ooo) +dpranke@ instead (for testing/buildbot). Dirk, please let me know if you have any ...
3 years, 11 months ago (2017-01-20 16:29:23 UTC) #127
Dirk Pranke
lgtm
3 years, 11 months ago (2017-01-23 23:27:55 UTC) #128
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2592983002/480001
3 years, 11 months ago (2017-01-24 11:02:04 UTC) #131
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/376825)
3 years, 11 months ago (2017-01-24 12:15:18 UTC) #133
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2592983002/480001
3 years, 11 months ago (2017-01-24 15:14:38 UTC) #142
commit-bot: I haz the power
Committed patchset #8 (id:480001) as https://chromium.googlesource.com/chromium/src/+/b6438b1ca6462f3cc014cd1bf18410957101a119
3 years, 11 months ago (2017-01-24 15:19:35 UTC) #145
mohsen
A revert of this CL (patchset #8 id:480001) has been created in https://codereview.chromium.org/2650903003/ by mohsen@chromium.org. ...
3 years, 11 months ago (2017-01-24 16:31:44 UTC) #146
findit-for-me
FYI: Findit identified this CL at revision 445730 as the culprit for failures in the ...
3 years, 11 months ago (2017-01-24 16:31:45 UTC) #147
Eric Seckler
I could reproduce this on a 10.12 macbook (so looks like it's broken >= macos ...
3 years, 11 months ago (2017-01-24 18:56:08 UTC) #148
Eric Seckler
On 2017/01/24 18:56:08, Eric Seckler wrote: > I could reproduce this on a 10.12 macbook ...
3 years, 11 months ago (2017-01-25 10:46:43 UTC) #152
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2592983002/500001
3 years, 11 months ago (2017-01-25 15:02:55 UTC) #161
commit-bot: I haz the power
3 years, 11 months ago (2017-01-25 15:08:41 UTC) #164
Message was sent while issue was closed.
Committed patchset #9 (id:500001) as
https://chromium.googlesource.com/chromium/src/+/7233c1a70ea0194caf10f4365cf3...

Powered by Google App Engine
This is Rietveld 408576698