Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Issue 12096114: Extract locking behaviour from ProcessSingleton. (Closed)

Created:
7 years, 10 months ago by erikwright (departed)
Modified:
7 years, 8 months ago
Reviewers:
gab, Nico, robertshield
CC:
chromium-reviews, cbentzel+watch_chromium.org, grt+watch_chromium.org, amit, sail+watch_chromium.org, robertshield, darin-cc_chromium.org
Visibility:
Public.

Description

Extract locking behaviour from ProcessSingleton. This refactoring continues the division of the behaviour of ProcessSingleton into two parts: * The protocol for establishing a server process and communicating between the client and server. * How the server processes command-line invocations. Very small behavioural change: * If an error occurs while parsing the command-line received via COPY_DATA, the modal dialog (if any) is no longer flashed and raised to foreground. The motivation for this change is that I wish to introduce some more sophisticated behaviour when queuing messages during startup. See the follow-up CL (in-progress) at https://codereview.chromium.org/12674028/ . BUG=170726, 170734, 225693 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195264

Patch Set 1 #

Patch Set 2 : WIP #

Patch Set 3 : Refactoring notification callbacks. #

Patch Set 4 : Remove needless code shuffling. #

Patch Set 5 : split #

Patch Set 6 : Fix Android. #

Patch Set 7 : missed merge. #

Total comments: 25

Patch Set 8 : Sync base CL. #

Patch Set 9 : Review comments. #

Patch Set 10 : Wrapping. #

Patch Set 11 : Fix non-windows compile. #

Total comments: 23

Patch Set 12 : merge. #

Patch Set 13 : More review comments. #

Patch Set 14 : Comment clarification. #

Total comments: 2

Patch Set 15 : Encapsulate ProcessSingleton composition. #

Patch Set 16 : Fix up a unit test too. #

Patch Set 17 : Really add files / rename unittest. #

Patch Set 18 : Rename test suite. #

Total comments: 3

Patch Set 19 : Make it pass on non-Win. #

Patch Set 20 : Make it pass on Android. #

Patch Set 21 : Restrict chrome_process_singleton_unittest to WIN for now. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+441 lines, -306 lines) Patch
M chrome/browser/chrome_browser_main.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +6 lines, -9 lines 0 comments Download
A chrome/browser/chrome_process_singleton.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +78 lines, -0 lines 0 comments Download
A chrome/browser/chrome_process_singleton.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +48 lines, -0 lines 0 comments Download
A + chrome/browser/chrome_process_singleton_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +37 lines, -33 lines 1 comment Download
M chrome/browser/first_run/first_run.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/first_run/first_run.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +1 line, -11 lines 0 comments Download
M chrome/browser/first_run/try_chrome_dialog_view.h View 2 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/first_run/try_chrome_dialog_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/process_singleton.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +0 lines, -35 lines 0 comments Download
D chrome/browser/process_singleton.cc View 1 chunk +0 lines, -24 lines 0 comments Download
M chrome/browser/process_singleton_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +1 line, -13 lines 0 comments Download
M chrome/browser/process_singleton_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -3 lines 0 comments Download
A chrome/browser/process_singleton_modal_dialog_lock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +64 lines, -0 lines 1 comment Download
A chrome/browser/process_singleton_modal_dialog_lock.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/browser/process_singleton_startup_lock.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +57 lines, -0 lines 0 comments Download
A chrome/browser/process_singleton_startup_lock.cc View 1 2 3 4 5 6 7 8 9 1 chunk +53 lines, -0 lines 0 comments Download
M chrome/browser/process_singleton_win.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +1 line, -28 lines 0 comments Download
M chrome/browser/process_singleton_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -127 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +7 lines, -1 line 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +1 line, -1 line 0 comments Download
M chrome_frame/test/net/fake_external_tab.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +1 line, -4 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
erikwright (departed)
robert, gab: PTAL. It's notable that removing all of this functionality from ProcessSingleton did not ...
7 years, 9 months ago (2013-03-27 02:21:40 UTC) #1
robertshield
Change looks good. Would it be possible to add a test to validate the behaviour ...
7 years, 9 months ago (2013-03-27 14:51:37 UTC) #2
gab
This is honestly the best piece of C++ code I have ever reviewed, extremely well ...
7 years, 9 months ago (2013-03-27 18:03:26 UTC) #3
erikwright (departed)
https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.h File chrome/browser/process_singleton_lock.h (right): https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.h#newcode24 chrome/browser/process_singleton_lock.h:24: class ProcessSingletonLock : public base::NonThreadSafe { On 2013/03/27 18:03:26, ...
7 years, 9 months ago (2013-03-27 18:28:43 UTC) #4
gab
https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.h File chrome/browser/process_singleton_lock.h (right): https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.h#newcode24 chrome/browser/process_singleton_lock.h:24: class ProcessSingletonLock : public base::NonThreadSafe { On 2013/03/27 18:28:44, ...
7 years, 9 months ago (2013-03-27 18:33:20 UTC) #5
gab
Oh, also, can you write part#/3 in each CL's description; it will be easier for ...
7 years, 9 months ago (2013-03-27 19:49:08 UTC) #6
erikwright (departed)
thakis: PTAL. https://codereview.chromium.org/12096114/diff/27001/chrome/browser/first_run/try_chrome_dialog_view.cc File chrome/browser/first_run/try_chrome_dialog_view.cc (right): https://codereview.chromium.org/12096114/diff/27001/chrome/browser/first_run/try_chrome_dialog_view.cc#newcode302 chrome/browser/first_run/try_chrome_dialog_view.cc:302: MessageLoop::current()->Run(); On 2013/03/27 18:03:26, gab wrote: > ...
7 years, 9 months ago (2013-03-28 03:16:34 UTC) #7
Nico
I only skimmed. I'll take a real look tomorrow morning. https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc#newcode1355 ...
7 years, 9 months ago (2013-03-28 04:50:09 UTC) #8
gab
Additional comments on new patch set. https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc#newcode1355 chrome/browser/chrome_browser_main.cc:1355: DCHECK(startup_lock_.locked()); On 2013/03/28 ...
7 years, 9 months ago (2013-03-28 13:45:53 UTC) #9
erikwright (departed)
thakis, gab, robertshield: PTAL. https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12096114/diff/66001/chrome/browser/chrome_browser_main.cc#newcode1355 chrome/browser/chrome_browser_main.cc:1355: DCHECK(startup_lock_.locked()); On 2013/03/28 13:45:53, gab ...
7 years, 8 months ago (2013-04-04 01:39:50 UTC) #10
gab
re-lgtm w/ comments below. https://codereview.chromium.org/12096114/diff/66001/chrome/browser/process_singleton_modal_dialog_lock.cc File chrome/browser/process_singleton_modal_dialog_lock.cc (right): https://codereview.chromium.org/12096114/diff/66001/chrome/browser/process_singleton_modal_dialog_lock.cc#newcode60 chrome/browser/process_singleton_modal_dialog_lock.cc:60: set_foreground_window_handler_.Run(active_dialog_); On 2013/04/04 01:39:51, erikwright ...
7 years, 8 months ago (2013-04-04 02:31:45 UTC) #11
grt (UTC plus 2)
drive-by, y'all https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.cc File chrome/browser/process_singleton_lock.cc (right): https://codereview.chromium.org/12096114/diff/27001/chrome/browser/process_singleton_lock.cc#newcode18 chrome/browser/process_singleton_lock.cc:18: ProcessSingletonLock::AsNotificationCallback() { On 2013/03/28 03:16:34, erikwright wrote: ...
7 years, 8 months ago (2013-04-04 15:17:18 UTC) #12
erikwright (departed)
thakis: Ping. gab: PTAL. https://codereview.chromium.org/12096114/diff/66001/chrome/browser/process_singleton_modal_dialog_lock.cc File chrome/browser/process_singleton_modal_dialog_lock.cc (right): https://codereview.chromium.org/12096114/diff/66001/chrome/browser/process_singleton_modal_dialog_lock.cc#newcode60 chrome/browser/process_singleton_modal_dialog_lock.cc:60: set_foreground_window_handler_.Run(active_dialog_); On 2013/04/04 02:31:45, gab ...
7 years, 8 months ago (2013-04-07 02:27:28 UTC) #13
gab
https://codereview.chromium.org/12096114/diff/99001/chrome/browser/process_singleton_modal_dialog_lock.h File chrome/browser/process_singleton_modal_dialog_lock.h (right): https://codereview.chromium.org/12096114/diff/99001/chrome/browser/process_singleton_modal_dialog_lock.h#newcode22 chrome/browser/process_singleton_modal_dialog_lock.h:22: // dialogs are displayed or dismissed. s/when dialogs/when such ...
7 years, 8 months ago (2013-04-09 14:34:29 UTC) #14
Nico
Sorry for the delay. https://codereview.chromium.org/12096114/diff/99001/chrome/browser/chrome_browser_main.h File chrome/browser/chrome_browser_main.h (right): https://codereview.chromium.org/12096114/diff/99001/chrome/browser/chrome_browser_main.h#newcode174 chrome/browser/chrome_browser_main.h:174: scoped_ptr<ProcessSingleton> process_singleton_; I started reviewing ...
7 years, 8 months ago (2013-04-17 21:04:24 UTC) #15
erikwright (departed)
On 2013/04/17 21:04:24, Nico wrote: > Sorry for the delay. > > https://codereview.chromium.org/12096114/diff/99001/chrome/browser/chrome_browser_main.h > File ...
7 years, 8 months ago (2013-04-18 16:14:11 UTC) #16
Nico
I find this much easier to understand now, thanks. I'm still confused though: The CL ...
7 years, 8 months ago (2013-04-18 18:12:13 UTC) #17
erikwright (departed)
On 2013/04/18 18:12:13, Nico wrote: > I find this much easier to understand now, thanks. ...
7 years, 8 months ago (2013-04-18 18:15:52 UTC) #18
Nico
Ok, then lgtm, thanks for explaining. +1 on trying to find better names, but that ...
7 years, 8 months ago (2013-04-18 18:19:01 UTC) #19
erikwright (departed)
On 2013/04/18 18:19:01, Nico wrote: > Ok, then lgtm, thanks for explaining. > > +1 ...
7 years, 8 months ago (2013-04-18 18:23:54 UTC) #20
gab
still lgtm, drive-by on latest changes https://codereview.chromium.org/12096114/diff/149001/chrome/browser/chrome_process_singleton_win_unittest.cc File chrome/browser/chrome_process_singleton_win_unittest.cc (right): https://codereview.chromium.org/12096114/diff/149001/chrome/browser/chrome_process_singleton_win_unittest.cc#newcode67 chrome/browser/chrome_process_singleton_win_unittest.cc:67: ps2.Unlock(); ps2 shouldn't ...
7 years, 8 months ago (2013-04-19 15:11:49 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/12096114/149001
7 years, 8 months ago (2013-04-19 17:43:23 UTC) #22
commit-bot: I haz the power
7 years, 8 months ago (2013-04-19 20:33:57 UTC) #23
Message was sent while issue was closed.
Change committed as 195264

Powered by Google App Engine
This is Rietveld 408576698