|
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}
Total comments: 2
Total comments: 7
Total comments: 1
|
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
|
Total messages: 30 (8 generated)
|