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

Issue 740763003: Reland rewrite clipboard write IPC handling to be easier to understand. (Closed)

Created:
6 years, 1 month ago by dcheng
Modified:
6 years, 1 month ago
CC:
dcheng, cbentzel+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, mkwst+moarreviews-renderer_chromium.org, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Reland rewrite clipboard write IPC handling to be easier to understand. The original implementation sent clipboard data to be written over IPC as a map of clipboard formats to 'parameters' for that format. The parameters were just vectors of byte vectors. Needless to say, this logic was complicated, fragile, and prone to bugs. In the browser process, this resulted in the IPC validation logic being scattered between ClipboardMessageFilter and Clipboard::DispatchObject. The rewrite adds an IPC message for each flavor of data that the renderer is allowed to write to the clipboard. On the browser side, the logic is simply delegated to ScopedClipboardWriter. Since the clipboard object map is no longer under the control of an untrusted process, this allows the removal of a lot of validation logic. Unfortunately, bitmap handling is still a bit complicated because it's sent over shared memory, but all the validation logic has been moved into ClipboardMessageFilter. BUG=319285 TBR=avi@chromium.org,jamesr@chromium.org,wfh@chromium.org Committed: https://crrev.com/112adc89f9665f2fd37c1882e1619d183dbbcea0 Cr-Commit-Position: refs/heads/master@{#304988}

Patch Set 1 #

Patch Set 2 : Fix crash when calling WriteFoo() with empty params #

Patch Set 3 : Formatted #

Unified diffs Side-by-side diffs Delta from patch set Stats (+737 lines, -895 lines) Patch
M chrome/chrome_common.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/net/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M components/bookmarks/browser/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter.h View 4 chunks +29 lines, -6 lines 0 comments Download
M content/browser/renderer_host/clipboard_message_filter.cc View 1 2 6 chunks +103 lines, -94 lines 0 comments Download
A content/browser/renderer_host/clipboard_message_filter_unittest.cc View 1 chunk +132 lines, -0 lines 0 comments Download
M content/common/clipboard_messages.h View 3 chunks +31 lines, -9 lines 0 comments Download
M content/content_renderer.gypi View 2 chunks +2 lines, -4 lines 0 comments Download
M content/content_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
D content/renderer/clipboard_client.h View 1 chunk +0 lines, -81 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 2 chunks +3 lines, -3 lines 0 comments Download
D content/renderer/renderer_clipboard_client.h View 1 chunk +0 lines, -43 lines 0 comments Download
D content/renderer/renderer_clipboard_client.cc View 1 chunk +0 lines, -180 lines 0 comments Download
A content/renderer/renderer_clipboard_delegate.h View 1 chunk +66 lines, -0 lines 0 comments Download
A content/renderer/renderer_clipboard_delegate.cc View 1 chunk +165 lines, -0 lines 0 comments Download
D content/renderer/scoped_clipboard_writer_glue.h View 1 chunk +0 lines, -30 lines 0 comments Download
D content/renderer/scoped_clipboard_writer_glue.cc View 1 chunk +0 lines, -36 lines 0 comments Download
M content/renderer/webclipboard_impl.h View 2 chunks +3 lines, -4 lines 0 comments Download
M content/renderer/webclipboard_impl.cc View 1 2 11 chunks +46 lines, -59 lines 0 comments Download
M ui/base/clipboard/clipboard.h View 5 chunks +39 lines, -60 lines 0 comments Download
M ui/base/clipboard/clipboard.cc View 1 2 4 chunks +12 lines, -99 lines 0 comments Download
M ui/base/clipboard/clipboard_test_template.h View 1 4 chunks +66 lines, -176 lines 0 comments Download
M ui/base/clipboard/clipboard_util_win.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/base/clipboard/scoped_clipboard_writer.h View 3 chunks +6 lines, -2 lines 0 comments Download
M ui/base/clipboard/scoped_clipboard_writer.cc View 1 2 chunks +17 lines, -0 lines 0 comments Download
M ui/base/test/test_clipboard.h View 1 chunk +4 lines, -1 line 0 comments Download
M ui/base/test/test_clipboard.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M ui/base/test/test_clipboard_unittest.cc View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M ui/base/ui_base.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
dcheng
PS1 to PS2 has the diffs to fix the crash. The problem is some callsites ...
6 years, 1 month ago (2014-11-20 00:06:11 UTC) #2
sky
LGTM
6 years, 1 month ago (2014-11-20 05:04:22 UTC) #3
dcheng
TBRing previous reviewers as bits outside ui/ have not changed.
6 years, 1 month ago (2014-11-20 05:12:00 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/740763003/40001
6 years, 1 month ago (2014-11-20 05:13:10 UTC) #9
Avi (use Gerrit)
On 2014/11/20 05:12:00, dcheng wrote: > TBRing previous reviewers as bits outside ui/ have not ...
6 years, 1 month ago (2014-11-20 05:17:16 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
6 years, 1 month ago (2014-11-20 07:16:59 UTC) #11
commit-bot: I haz the power
6 years, 1 month ago (2014-11-20 07:17:37 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/112adc89f9665f2fd37c1882e1619d183dbbcea0
Cr-Commit-Position: refs/heads/master@{#304988}

Powered by Google App Engine
This is Rietveld 408576698