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

Issue 15261005: Allow multiple base::MessagePumpForUI instances to be created simultanenously on Windows. (Closed)

Created:
7 years, 7 months ago by alexeypa (please no reviews)
Modified:
7 years, 7 months ago
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, sadrul, timurrrr+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, dcheng, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, rmsousa+watch_chromium.org, weitaosu+watch_chromium.org, alexeypa+watch_chromium.org, erikwright+watch_chromium.org, glider+watch_chromium.org, sergeyu+watch_chromium.org, bruening+watch_chromium.org
Visibility:
Public.

Description

Allow multiple base::MessagePumpForUI instances to be created simultanenously on Windows. The current implementation of base::MessagePumpForUI on Windows registers a window class with a predefined name in order to create a message-only window. The window class is unregistered when base::MessagePumpForUI is deleted. This causes issues when two or more instances of base::MessagePumpForUI are created/destroyed simultanenously on different threads. For instance once thread can unregister the window class right before the other thread is trying to create a window using this class. The CL addresses this problem by switching MessageWindow to implement a message-only window. It also moves MessageWindow from remoting/host/win to base/win along with the corresponding unit test. MessageWindow registers a uniquely named window class per MessageWindow instance making sure that different MessageWindow objects do not share any resources. In the future this can be optimized further by registering a common window class shared by all MessageWindow objects in a thread-safe manner (by using LazyInstance for example). BUG=241939 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201955

Patch Set 1 #

Patch Set 2 : Fixed the component build. #

Total comments: 8

Patch Set 3 : CR feedback #

Total comments: 4

Patch Set 4 : CR feedback #

Patch Set 5 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -369 lines) Patch
M base/base.gyp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M base/base.gypi View 1 2 3 4 3 chunks +6 lines, -4 lines 0 comments Download
M base/message_pump_win.h View 1 2 3 4 chunks +13 lines, -11 lines 0 comments Download
M base/message_pump_win.cc View 1 2 3 11 chunks +23 lines, -37 lines 0 comments Download
A + base/win/message_window.h View 1 2 3 chunks +8 lines, -8 lines 0 comments Download
A + base/win/message_window.cc View 1 2 4 chunks +4 lines, -11 lines 0 comments Download
A + base/win/message_window_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M remoting/host/clipboard_win.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M remoting/host/local_input_monitor_win.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M remoting/host/win/host_service.h View 3 chunks +3 lines, -3 lines 0 comments Download
M remoting/host/win/host_service.cc View 1 chunk +1 line, -1 line 0 comments Download
D remoting/host/win/message_window.h View 1 chunk +0 lines, -67 lines 0 comments Download
D remoting/host/win/message_window.cc View 1 chunk +0 lines, -118 lines 0 comments Download
D remoting/host/win/message_window_unittest.cc View 1 chunk +0 lines, -61 lines 0 comments Download
M remoting/remoting.gyp View 1 2 3 4 2 chunks +0 lines, -3 lines 0 comments Download
M tools/valgrind/tsan/suppressions.txt View 1 2 3 4 1 chunk +0 lines, -31 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
alexeypa (please no reviews)
PTAL. base/* - darin@ remoting/* and the rest - wez@
7 years, 7 months ago (2013-05-21 21:56:44 UTC) #1
Wez
remoting/ LGTM
7 years, 7 months ago (2013-05-21 22:57:54 UTC) #2
darin (slow to review)
https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc File base/message_pump_win.cc (left): https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc#oldcode275 base/message_pump_win.cc:275: wc.lpszClassName = kWndClass; wouldn't it be a simpler change ...
7 years, 7 months ago (2013-05-22 22:53:23 UTC) #3
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc File base/message_pump_win.cc (left): https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc#oldcode275 base/message_pump_win.cc:275: wc.lpszClassName = kWndClass; On 2013/05/22 22:53:24, darin wrote: > ...
7 years, 7 months ago (2013-05-22 23:04:48 UTC) #4
darin (slow to review)
OK, makes sense. https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc#newcode109 base/message_pump_win.cc:109: reinterpret_cast<WPARAM>(this), 0); it looks like it ...
7 years, 7 months ago (2013-05-23 00:07:13 UTC) #5
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://chromiumcodereview.appspot.com/15261005/diff/8001/base/message_pump_win.cc#newcode109 base/message_pump_win.cc:109: reinterpret_cast<WPARAM>(this), 0); On 2013/05/23 00:07:14, darin wrote: > it ...
7 years, 7 months ago (2013-05-23 17:45:53 UTC) #6
darin (slow to review)
On 2013/05/23 17:45:53, alexeypa wrote: > https://chromiumcodereview.appspot.com/15261005/diff/8001/base/win/message_window.cc#newcode22 > base/win/message_window.cc:22: class_name_ = > base::StringPrintf(kClassNameFormat, this); > ...
7 years, 7 months ago (2013-05-23 18:14:45 UTC) #7
darin (slow to review)
LGTM w/ nits: https://chromiumcodereview.appspot.com/15261005/diff/25001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://chromiumcodereview.appspot.com/15261005/diff/25001/base/message_pump_win.cc#newcode100 base/message_pump_win.cc:100: CHECK(window_->Create(this)) << "Couldn't create a message-only ...
7 years, 7 months ago (2013-05-23 18:20:51 UTC) #8
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/15261005/diff/25001/base/message_pump_win.cc File base/message_pump_win.cc (right): https://chromiumcodereview.appspot.com/15261005/diff/25001/base/message_pump_win.cc#newcode100 base/message_pump_win.cc:100: CHECK(window_->Create(this)) << "Couldn't create a message-only window."; On 2013/05/23 ...
7 years, 7 months ago (2013-05-23 19:02:29 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15261005/37001
7 years, 7 months ago (2013-05-23 19:06:37 UTC) #10
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 7 months ago (2013-05-23 19:20:00 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/15261005/37001
7 years, 7 months ago (2013-05-23 19:26:40 UTC) #12
commit-bot: I haz the power
7 years, 7 months ago (2013-05-24 01:34:53 UTC) #13
Message was sent while issue was closed.
Change committed as 201955

Powered by Google App Engine
This is Rietveld 408576698