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

Issue 11099053: Refactor ProcessSingleton to allow a Desktop process to activate Metro Chrome cleanly. (Closed)

Created:
8 years, 2 months ago by gab
Modified:
7 years, 9 months ago
CC:
chromium-reviews, chrome-win8-eng_google.com, Jói
Visibility:
Public.

Description

Refactor ProcessSingleton to allow a Desktop process to activate Metro Chrome instead of grabbing the singleton (while making sure it simply RDVs if there already is an existing Chrome). Use a Windows event to let the Metro process notify the Desktop process once it grabbed the singleton (no more Sleep()). The idea is the following: 0) Any process always tries to rendez-vous before anything else. 1) A Metro process can always try to grab the singleton. 2) A Desktop process might wait if: a) The metro activation event exists b) The metro activation event doesn't exist, but ShouldActivate() returns true - In which case it creates the metro activation event and activates Metro Chrome (which will notify this process via the event once it grabbed the singleton; at which point this process should rendez-vous with it). All of this is done while holding a global mutex (only releasing it while waiting and re-acquiring it before continuing when notified). The process singleton acquiring logic has also been moved from the constructor to Create(). Design = http://crbug.com/159869#c17 BUG=155585, 159869 TEST=Process singleton works as before (and better in tricky corner cases -- see http://crbug.com/159869) on Win8. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=171105

Patch Set 1 #

Patch Set 2 : Do check and activate in ProcessSingleton::NotifyProcess() instead #

Total comments: 12

Patch Set 3 : grt comments #

Patch Set 4 : New method #

Patch Set 5 : merge up to r167683 #

Total comments: 29

Patch Set 6 : apply comments in place #

Total comments: 8

Patch Set 7 : merge #

Patch Set 8 : move constructor logic to Create() and modify NotifyOtherProcessOrCreate() #

Patch Set 9 : change comment #

Total comments: 7

Patch Set 10 : @robert: comment tweak #

Total comments: 6

Patch Set 11 : merge up to r170805 #

Patch Set 12 : addressed grt's comments #

Patch Set 13 : merge up to r170957 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -120 lines) Patch
M chrome/browser/process_singleton.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +9 lines, -13 lines 0 comments Download
M chrome/browser/process_singleton_win.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +178 lines, -107 lines 3 comments Download

Messages

Total messages: 27 (0 generated)
gab
This works for the uninstall case, but now when I launch from command-line, with pref=Metro, ...
8 years, 2 months ago (2012-10-10 22:26:29 UTC) #1
ananta
On 2012/10/10 22:26:29, gab wrote: > This works for the uninstall case, but now when ...
8 years, 2 months ago (2012-10-10 22:31:56 UTC) #2
gab
On 2012/10/10 22:31:56, ananta wrote: > On 2012/10/10 22:26:29, gab wrote: > > This works ...
8 years, 2 months ago (2012-10-11 02:00:20 UTC) #3
grt (UTC plus 2)
does it work if you move the immersive launch into ProcessSingleton::NotifyOtherProcessOrCreate and have that func ...
8 years, 2 months ago (2012-10-11 02:53:29 UTC) #4
gab
Moved activation check in ProcessSingleton::NotifyProcess(). All currently known activation bugs are still there, but the ...
8 years, 2 months ago (2012-10-12 03:07:12 UTC) #5
grt (UTC plus 2)
http://codereview.chromium.org/11099053/diff/5002/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): http://codereview.chromium.org/11099053/diff/5002/chrome/browser/process_singleton.h#newcode175 chrome/browser/process_singleton.h:175: // constructing this process singleton the please put the ...
8 years, 2 months ago (2012-10-12 12:49:08 UTC) #6
gab
Addressed comments, but because of a bug in setup.exe (causing me to test the wrong ...
8 years, 2 months ago (2012-10-12 18:52:28 UTC) #7
ananta
This patch won't work as written. The remote_window_ member contains the HWND of the running ...
8 years, 2 months ago (2012-10-12 18:57:45 UTC) #8
gab
Folks, PTAL, the new flow chart is up on the white boards in Montreal for ...
8 years, 1 month ago (2012-11-14 05:01:44 UTC) #9
gab
FYI, I also noticed while doing this that we use the same window class, mutex, ...
8 years, 1 month ago (2012-11-14 16:09:54 UTC) #10
gab
Note: I posted an image representing the new flow at http://crbug.com/159869#c17. (see other messages above ...
8 years, 1 month ago (2012-11-14 23:38:23 UTC) #11
ananta
http://codereview.chromium.org/11099053/diff/21001/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): http://codereview.chromium.org/11099053/diff/21001/chrome/browser/process_singleton_win.cc#newcode289 chrome/browser/process_singleton_win.cc:289: // As of Win8, it is possible that a ...
8 years, 1 month ago (2012-11-15 21:41:56 UTC) #12
robertshield
looking good, a question and a nit http://codereview.chromium.org/11099053/diff/21001/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): http://codereview.chromium.org/11099053/diff/21001/chrome/browser/process_singleton_win.cc#newcode292 chrome/browser/process_singleton_win.cc:292: if (!remote_window_ ...
8 years, 1 month ago (2012-11-16 01:51:25 UTC) #13
grt (UTC plus 2)
round one. are there any codepaths that instantiate the singleton but don't call NotifyOtherProcess{,OrCreate}? if ...
8 years, 1 month ago (2012-11-16 03:04:41 UTC) #14
gab
Addressed comments and moved "grabbing the singleton" from the constructor to Create(); it doesn't make ...
8 years ago (2012-12-03 16:53:22 UTC) #15
robertshield
https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h#newcode73 chrome/browser/process_singleton.h:73: // specfic was the linux implementation slightly tweaked. nit: ...
8 years ago (2012-12-03 19:41:00 UTC) #16
gab
See replies below. https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h#newcode73 chrome/browser/process_singleton.h:73: // specfic was the linux implementation ...
8 years ago (2012-12-03 19:46:22 UTC) #17
robertshield
lgtm https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h File chrome/browser/process_singleton.h (right): https://codereview.chromium.org/11099053/diff/29004/chrome/browser/process_singleton.h#newcode73 chrome/browser/process_singleton.h:73: // specfic was the linux implementation slightly tweaked. ...
8 years ago (2012-12-03 19:57:19 UTC) #18
grt (UTC plus 2)
https://codereview.chromium.org/11099053/diff/27002/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): https://codereview.chromium.org/11099053/diff/27002/chrome/browser/process_singleton_win.cc#newcode52 chrome/browser/process_singleton_win.cc:52: // scope. As documented, it's clearer to NOT request ...
8 years ago (2012-12-03 21:02:03 UTC) #19
gab
Thanks, done. PTAL, Gab https://codereview.chromium.org/11099053/diff/27002/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): https://codereview.chromium.org/11099053/diff/27002/chrome/browser/process_singleton_win.cc#newcode52 chrome/browser/process_singleton_win.cc:52: // scope. As documented, it's ...
8 years ago (2012-12-03 21:38:27 UTC) #20
grt (UTC plus 2)
lgtm
8 years ago (2012-12-04 15:09:34 UTC) #21
ananta
LGTM % nit https://codereview.chromium.org/11099053/diff/28011/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): https://codereview.chromium.org/11099053/diff/28011/chrome/browser/process_singleton_win.cc#newcode457 chrome/browser/process_singleton_win.cc:457: base::win::ScopedHandle only_me(CreateMutex(NULL, FALSE, kMutexName)); I think ...
8 years ago (2012-12-04 19:11:54 UTC) #22
gab
Thanks, +brettw for OWNER approval. FYI, I removed one of your old TODO that seemed ...
8 years ago (2012-12-04 19:44:18 UTC) #23
grt (UTC plus 2)
https://codereview.chromium.org/11099053/diff/28011/chrome/browser/process_singleton_win.cc File chrome/browser/process_singleton_win.cc (right): https://codereview.chromium.org/11099053/diff/28011/chrome/browser/process_singleton_win.cc#newcode457 chrome/browser/process_singleton_win.cc:457: base::win::ScopedHandle only_me(CreateMutex(NULL, FALSE, kMutexName)); On 2012/12/04 19:44:18, gab wrote: ...
8 years ago (2012-12-04 19:55:23 UTC) #24
brettw
owners lgtm rubberstamp
8 years ago (2012-12-04 20:50:18 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/11099053/28011
8 years ago (2012-12-04 21:03:17 UTC) #26
commit-bot: I haz the power
8 years ago (2012-12-05 01:00:25 UTC) #27
Message was sent while issue was closed.
Change committed as 171105

Powered by Google App Engine
This is Rietveld 408576698