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

Issue 9419036: Change all platforms except Windows to access the clipboard solely from the UI thread (Closed)

Created:
8 years, 10 months ago by raymes
Modified:
8 years, 10 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, dcheng
Visibility:
Public.

Description

Clipboard access is not threadsafe in general. Previously clipboard reads were occuring on the IO thread while writes were on the UI thread, leading to a race condition in the clipboard code. This fixes that issue by placing all clipboard accesses on the UI thread and adding thread checks to ensure that all accesses occur from the same thread. Windows is an exception to this rule where clipboard reads need to occur on the IO thread to avoid deadlocks with NPAPI plugins. This is ok because the windows clipboard is threadsafe. BUG=114648 TEST=Tested clipboard by hand on linux. Ran trybots (all passed except flakiness on linux_chromeos). Ran new PPAPI test that was triggering the crash (http://codereview.chromium.org/9212066/) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122916 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=123088

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Total comments: 5

Patch Set 5 : . #

Total comments: 2

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -6 lines) Patch
M content/browser/renderer_host/clipboard_message_filter.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/clipboard_message_filter.cc View 1 2 3 4 5 6 7 4 chunks +25 lines, -4 lines 0 comments Download
M ui/base/clipboard/clipboard.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M ui/base/clipboard/clipboard_aurax11.cc View 1 2 3 4 5 6 7 5 chunks +13 lines, -0 lines 0 comments Download
M ui/base/clipboard/clipboard_gtk.cc View 1 2 3 4 5 6 7 11 chunks +13 lines, -0 lines 0 comments Download
M ui/base/clipboard/clipboard_mac.mm View 1 2 3 4 5 6 7 11 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
raymes
8 years, 10 months ago (2012-02-17 19:35:20 UTC) #1
dcheng
Should this change apply to the Clipboard::Write* methods as well? https://chromiumcodereview.appspot.com/9419036/diff/2002/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): https://chromiumcodereview.appspot.com/9419036/diff/2002/content/browser/renderer_host/clipboard_message_filter.cc#newcode53 ...
8 years, 10 months ago (2012-02-17 19:43:21 UTC) #2
raymes
https://chromiumcodereview.appspot.com/9419036/diff/2002/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): https://chromiumcodereview.appspot.com/9419036/diff/2002/content/browser/renderer_host/clipboard_message_filter.cc#newcode53 content/browser/renderer_host/clipboard_message_filter.cc:53: *thread = BrowserThread::UI; On 2012/02/17 19:43:22, dcheng wrote: > ...
8 years, 10 months ago (2012-02-17 23:14:03 UTC) #3
jam
content lgtm http://codereview.chromium.org/9419036/diff/8002/content/browser/renderer_host/clipboard_message_filter.cc File content/browser/renderer_host/clipboard_message_filter.cc (right): http://codereview.chromium.org/9419036/diff/8002/content/browser/renderer_host/clipboard_message_filter.cc#newcode44 content/browser/renderer_host/clipboard_message_filter.cc:44: // thread-safe, so all clipboard calls should ...
8 years, 10 months ago (2012-02-18 02:13:11 UTC) #4
raymes
https://chromiumcodereview.appspot.com/9419036/diff/2002/ui/base/clipboard/clipboard.h File ui/base/clipboard/clipboard.h (right): https://chromiumcodereview.appspot.com/9419036/diff/2002/ui/base/clipboard/clipboard.h#newcode256 ui/base/clipboard/clipboard.h:256: void ReadFiles(std::vector<FilePath>* files) const; I removed this change as ...
8 years, 10 months ago (2012-02-21 18:00:43 UTC) #5
dcheng
lgtm
8 years, 10 months ago (2012-02-21 19:13:53 UTC) #6
Ben Goodger (Google)
lgtm
8 years, 10 months ago (2012-02-21 22:05:21 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/9419036/9001
8 years, 10 months ago (2012-02-21 22:07:23 UTC) #8
commit-bot: I haz the power
Change committed as 122916
8 years, 10 months ago (2012-02-21 23:50:15 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/9419036/11005
8 years, 10 months ago (2012-02-22 17:21:01 UTC) #10
commit-bot: I haz the power
Can't apply patch for file ui/base/clipboard/clipboard_aurax11.cc. While running patch -p1 --forward --force; patching file ui/base/clipboard/clipboard_aurax11.cc ...
8 years, 10 months ago (2012-02-22 17:21:03 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/9419036/15001
8 years, 10 months ago (2012-02-22 18:10:40 UTC) #12
commit-bot: I haz the power
8 years, 10 months ago (2012-02-22 19:54:04 UTC) #13
Change committed as 123088

Powered by Google App Engine
This is Rietveld 408576698