summaryrefslogtreecommitdiffstats
path: root/ui/base/test/test_clipboard_unittest.cc
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-11-19 23:16:49 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-20 07:17:08 +0000
commit112adc89f9665f2fd37c1882e1619d183dbbcea0 (patch)
treee9405efba87b9f6da0a49cac9f9e546e261341d6 /ui/base/test/test_clipboard_unittest.cc
parent9196d87fcce71cbc79c5c0bb660dc6b0a9d0c670 (diff)
downloadchromium_src-112adc89f9665f2fd37c1882e1619d183dbbcea0.zip
chromium_src-112adc89f9665f2fd37c1882e1619d183dbbcea0.tar.gz
chromium_src-112adc89f9665f2fd37c1882e1619d183dbbcea0.tar.bz2
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 Review URL: https://codereview.chromium.org/740763003 Cr-Commit-Position: refs/heads/master@{#304988}
Diffstat (limited to 'ui/base/test/test_clipboard_unittest.cc')
-rw-r--r--ui/base/test/test_clipboard_unittest.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/base/test/test_clipboard_unittest.cc b/ui/base/test/test_clipboard_unittest.cc
index e2f7a3b..8d3a436 100644
--- a/ui/base/test/test_clipboard_unittest.cc
+++ b/ui/base/test/test_clipboard_unittest.cc
@@ -9,10 +9,7 @@
namespace ui {
struct TestClipboardTraits {
- static Clipboard* Create() {
- TestClipboard::UseForCurrentThread();
- return Clipboard::GetForCurrentThread();
- }
+ static Clipboard* Create() { return TestClipboard::CreateForCurrentThread(); }
static void Destroy(Clipboard* clipboard) {
ASSERT_EQ(Clipboard::GetForCurrentThread(), clipboard);