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

Issue 1876653003: Register clipboard image blob in the browser process to copy data less. (Closed)

Created:
4 years, 8 months ago by dcheng
Modified:
4 years, 8 months ago
Reviewers:
kinuko, tkent, dmurph
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, jam, jochen+watch_chromium.org, kinuko+fileapi, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-test-runner_chromium.org, nasko+codewatch_chromium.org, nhiroki, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Register clipboard image blob in the browser process to copy data less. The original code encodes the PNG and sends the buffer over to the renderer. The renderer then registers a blob with that buffer, which transfers all the data back to the browser. Then the data is copied back over to the renderer when the page tries to read the image/png DataTransferItem. Instead of sending the data back and forth so many times, just register the blob directly in the browser process. On a 1366x768 test image, there's no measurable difference: it takes ~0.125s to execute DataTransferItem::getAsFile() for an image. On a 4000x4000 test image, there's a small difference: the old version takes ~9.1s and the new version takes ~8.9s. It turns out memcpy is pretty fast! BUG=none Committed: https://crrev.com/d5854aa09923d4700ae07b8da0d858e1da88e43c Cr-Commit-Position: refs/heads/master@{#388583}

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Add mock interface and fix tests. #

Total comments: 2

Patch Set 4 : Add interface comment. #

Total comments: 7

Patch Set 5 : Use blocking pool. #

Total comments: 1

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -112 lines) Patch
M components/test_runner/pixel_dump.cc View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter.h View 4 chunks +10 lines, -2 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter.cc View 1 2 3 4 5 5 chunks +61 lines, -32 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter_unittest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/common/clipboard_messages.h View 1 chunk +4 lines, -3 lines 0 comments Download
M content/renderer/renderer_clipboard_delegate.h View 1 chunk +4 lines, -1 line 0 comments Download
M content/renderer/renderer_clipboard_delegate.cc View 1 chunk +4 lines, -9 lines 0 comments Download
M content/renderer/webclipboard_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/webclipboard_impl.cc View 3 chunks +12 lines, -8 lines 0 comments Download
M content/test/mock_webclipboard_impl.h View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M content/test/mock_webclipboard_impl.cc View 1 2 2 chunks +24 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp View 1 chunk +4 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 2 3 4 5 3 chunks +3 lines, -5 lines 0 comments Download
M third_party/WebKit/public/blink_headers.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebClipboard.h View 2 chunks +7 lines, -7 lines 0 comments Download
A third_party/WebKit/public/platform/WebMockClipboard.h View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (8 generated)
dcheng
I have some followup patches that reduce the main thread blocking time to ~3.5s for ...
4 years, 8 months ago (2016-04-11 03:22:54 UTC) #4
dcheng
cc dmurph as well, in case there are some blob apis that i missed that ...
4 years, 8 months ago (2016-04-11 03:26:15 UTC) #5
tkent
components/test_runner lgtm
4 years, 8 months ago (2016-04-11 03:27:27 UTC) #6
dmurph
My main concern here (from the blob system) is the size of the data. We ...
4 years, 8 months ago (2016-04-11 06:39:14 UTC) #8
dcheng
On 2016/04/11 06:39:14, dmurph wrote: > My main concern here (from the blob system) is ...
4 years, 8 months ago (2016-04-11 08:11:19 UTC) #9
kinuko
Large image case would be problematic, but as Daniel noted this had existed before this ...
4 years, 8 months ago (2016-04-11 08:35:48 UTC) #10
dcheng
https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc#newcode182 content/browser/renderer_host/clipboard_message_filter.cc:182: // TODO(dcheng): Just use the worker pool. On 2016/04/11 ...
4 years, 8 months ago (2016-04-11 09:13:07 UTC) #11
kinuko
https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc#newcode220 content/browser/renderer_host/clipboard_message_filter.cc:220: // Give the renderer a minute to pick up ...
4 years, 8 months ago (2016-04-11 09:52:02 UTC) #12
dcheng
https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc#newcode220 content/browser/renderer_host/clipboard_message_filter.cc:220: // Give the renderer a minute to pick up ...
4 years, 8 months ago (2016-04-11 23:26:33 UTC) #13
dcheng
4 years, 8 months ago (2016-04-11 23:26:36 UTC) #14
dmurph
On 2016/04/11 at 08:11:19, dcheng wrote: > On 2016/04/11 06:39:14, dmurph wrote: > > My ...
4 years, 8 months ago (2016-04-11 23:42:48 UTC) #15
dcheng
On 2016/04/11 23:42:48, dmurph wrote: > On 2016/04/11 at 08:11:19, dcheng wrote: > > On ...
4 years, 8 months ago (2016-04-11 23:48:57 UTC) #16
dmurph
https://codereview.chromium.org/1876653003/diff/80001/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp File third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp (right): https://codereview.chromium.org/1876653003/diff/80001/third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp#newcode122 third_party/WebKit/Source/core/clipboard/DataObjectItem.cpp:122: return Blob::create(BlobDataHandle::create(blobInfo.uuid(), blobInfo.type(), blobInfo.size())); Hmmm.. Well if you went ...
4 years, 8 months ago (2016-04-12 00:10:23 UTC) #17
kinuko
On 2016/04/11 23:26:33, dcheng wrote: > https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc > File content/browser/renderer_host/clipboard_message_filter.cc (right): > > https://codereview.chromium.org/1876653003/diff/60001/content/browser/renderer_host/clipboard_message_filter.cc#newcode220 > ...
4 years, 8 months ago (2016-04-12 05:27:28 UTC) #18
dmurph
Daniel, I think it's fair to say that this should work w/ the 1 minute ...
4 years, 8 months ago (2016-04-19 17:49:23 UTC) #19
dcheng
On 2016/04/19 at 17:49:23, dmurph wrote: > Daniel, I think it's fair to say that ...
4 years, 8 months ago (2016-04-19 17:51:49 UTC) #20
kinuko
On 2016/04/19 17:51:49, dcheng wrote: > On 2016/04/19 at 17:49:23, dmurph wrote: > > Daniel, ...
4 years, 8 months ago (2016-04-20 06:00:15 UTC) #21
kinuko
On 2016/04/20 06:00:15, kinuko wrote: > On 2016/04/19 17:51:49, dcheng wrote: > > On 2016/04/19 ...
4 years, 8 months ago (2016-04-20 06:06:16 UTC) #22
dcheng
Added the TODO. I also removed a DCHECK_CURRENTLY_ON() that no longer makes sense, since we ...
4 years, 8 months ago (2016-04-20 19:26:25 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1876653003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1876653003/100001
4 years, 8 months ago (2016-04-20 19:27:03 UTC) #26
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 8 months ago (2016-04-20 21:36:04 UTC) #28
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:26:44 UTC) #30
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/d5854aa09923d4700ae07b8da0d858e1da88e43c
Cr-Commit-Position: refs/heads/master@{#388583}

Powered by Google App Engine
This is Rietveld 408576698