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

Issue 218883008: Use process_singleton_linux on Mac. (Closed)

Created:
6 years, 8 months ago by jackhou1
Modified:
6 years, 7 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Use process_singleton_linux on Mac. The current process singleton implementation on Linux does what we want for Mac. I.e. it creates a unix domain socket in a temporary directory and a symlink to it in the user data dir. The motivation for this in Linux is to support having the user data dir on a networked filesystem. On Mac, it circumvents the path length limit of unix domain sockets (104 characters). A similar solution is used to allow app shims to connect to Chrome. BUG=148465, 353047, 367612 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267512

Patch Set 1 #

Patch Set 2 : Fix compile on android #

Total comments: 13

Patch Set 3 : Sync and rebase #

Patch Set 4 : Address comments (mostly) #

Total comments: 13

Patch Set 5 : Sync and rebase #

Patch Set 6 : Address comments #

Patch Set 7 : CreateUniqueTempDir is fine. DCHECK socket path length. #

Total comments: 17

Patch Set 8 : Address comments #

Total comments: 1

Patch Set 9 : Sync and rebase #

Patch Set 10 : Handle old SingletonLock #

Total comments: 18

Patch Set 11 : Sync and rebase #

Patch Set 12 : Address comments #

Total comments: 9

Patch Set 13 : Address comments #

Total comments: 4

Patch Set 14 : Address comments #

Patch Set 15 : Sync and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -1733 lines) Patch
M base/process/process_handle.h View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M base/process/process_handle_mac.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/app/chromium_strings.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/app/google_chrome_strings.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/process_singleton.h View 6 chunks +5 lines, -15 lines 0 comments Download
D chrome/browser/process_singleton_linux.cc View 1 2 1 chunk +0 lines, -986 lines 0 comments Download
D chrome/browser/process_singleton_linux_unittest.cc View 1 chunk +0 lines, -393 lines 0 comments Download
D chrome/browser/process_singleton_mac.cc View 1 chunk +0 lines, -117 lines 0 comments Download
D chrome/browser/process_singleton_mac_unittest.cc View 1 chunk +0 lines, -161 lines 0 comments Download
A + chrome/browser/process_singleton_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +74 lines, -7 lines 0 comments Download
A + chrome/browser/process_singleton_posix_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 19 chunks +76 lines, -43 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 45 (0 generated)
jackhou1
6 years, 8 months ago (2014-04-08 04:13:16 UTC) #1
tapted
After addressing comments, I'd maybe loop in mark@chromium (and/or shess@) -- this is a pretty ...
6 years, 8 months ago (2014-04-08 17:56:44 UTC) #2
jackhou1
https://codereview.chromium.org/218883008/diff/40001/base/process/process_handle_mac.cc File base/process/process_handle_mac.cc (right): https://codereview.chromium.org/218883008/diff/40001/base/process/process_handle_mac.cc#newcode7 base/process/process_handle_mac.cc:7: #include <errno.h> On 2014/04/08 17:56:44, tapted wrote: > nit: ...
6 years, 8 months ago (2014-04-14 04:12:10 UTC) #3
jackhou1
mark, shess, would you mind taking a look at this CL too? Is this a ...
6 years, 8 months ago (2014-04-14 04:29:14 UTC) #4
Scott Hess - ex-Googler
On 2014/04/14 04:29:14, jackhou1 wrote: > mark, shess, would you mind taking a look at ...
6 years, 8 months ago (2014-04-14 16:50:28 UTC) #5
Scott Hess - ex-Googler
AFAICT, the _posix stuff is exactly what I had tried, so mainly make sure you ...
6 years, 8 months ago (2014-04-14 19:21:32 UTC) #6
jackhou1
> > One issue tapted raised is what happens if the hostname changes, and then ...
6 years, 8 months ago (2014-04-17 07:55:54 UTC) #7
jackhou1
mattm, I think you reviewed a lot of process_singleton_linux, could you take a look at ...
6 years, 8 months ago (2014-04-17 08:00:55 UTC) #8
jackhou1
> > AFAICT, the _posix stuff is exactly what I had tried, so mainly make ...
6 years, 8 months ago (2014-04-17 08:14:16 UTC) #9
tapted
https://codereview.chromium.org/218883008/diff/140001/base/process/process_handle.h File base/process/process_handle.h (right): https://codereview.chromium.org/218883008/diff/140001/base/process/process_handle.h#newcode84 base/process/process_handle.h:84: #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD) || defined(OS_MACOSX) maybe ...
6 years, 8 months ago (2014-04-17 08:36:14 UTC) #10
mattm
https://codereview.chromium.org/218883008/diff/40001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/40001/chrome/browser/process_singleton_posix.cc#newcode315 chrome/browser/process_singleton_posix.cc:315: return ShowProcessSingletonDialog(error, relaunch_button_text); On 2014/04/14 04:12:10, jackhou1 wrote: > ...
6 years, 8 months ago (2014-04-17 21:44:53 UTC) #11
Scott Hess - ex-Googler
When I patch this in and run it in a Chromium which had already run, ...
6 years, 8 months ago (2014-04-18 20:51:33 UTC) #12
jackhou1
> When I patch this in and run it in a Chromium which had already ...
6 years, 8 months ago (2014-04-24 02:34:54 UTC) #13
jackhou1
Thanks for all the comments. PTAL
6 years, 8 months ago (2014-04-24 02:35:38 UTC) #14
Scott Hess - ex-Googler
minor comments, I'll try to respond quickly for next review so you can get it ...
6 years, 8 months ago (2014-04-24 21:54:42 UTC) #15
mattm
https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc#newcode447 chrome/browser/process_singleton_posix.cc:447: rc = rename(temp_lock_path.value().c_str(), lock_path.value().c_str()); Is all of this even ...
6 years, 8 months ago (2014-04-24 22:58:51 UTC) #16
Scott Hess - ex-Googler
https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc#newcode447 chrome/browser/process_singleton_posix.cc:447: rc = rename(temp_lock_path.value().c_str(), lock_path.value().c_str()); On 2014/04/24 22:58:51, mattm wrote: ...
6 years, 8 months ago (2014-04-25 15:26:54 UTC) #17
mattm
Right, I could have been more clear. I meant just the part about creating a ...
6 years, 8 months ago (2014-04-25 18:27:27 UTC) #18
jackhou1
https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc#newcode415 chrome/browser/process_singleton_posix.cc:415: O_RDWR | O_CREAT | O_SYMLINK, 0644)); On 2014/04/24 21:54:43, ...
6 years, 8 months ago (2014-04-28 05:20:16 UTC) #19
Scott Hess - ex-Googler
https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/200001/chrome/browser/process_singleton_posix.cc#newcode436 chrome/browser/process_singleton_posix.cc:436: if (!temp_lock_dir.CreateUniqueTempDirUnderPath(lock_path.DirName())) { On 2014/04/28 05:20:16, jackhou1 wrote: > ...
6 years, 7 months ago (2014-04-28 17:41:38 UTC) #20
mattm
https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc#newcode942 chrome/browser/process_singleton_posix.cc:942: } hm, this might be cleaner like: if (errno ...
6 years, 7 months ago (2014-04-28 22:18:59 UTC) #21
Scott Hess - ex-Googler
https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc#newcode942 chrome/browser/process_singleton_posix.cc:942: } On 2014/04/28 22:19:00, mattm wrote: > hm, this ...
6 years, 7 months ago (2014-04-28 22:28:12 UTC) #22
jackhou1
https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/230001/chrome/browser/process_singleton_posix.cc#newcode942 chrome/browser/process_singleton_posix.cc:942: } On 2014/04/28 22:28:13, shess wrote: > On 2014/04/28 ...
6 years, 7 months ago (2014-04-29 01:51:31 UTC) #23
mattm
lgtm
6 years, 7 months ago (2014-04-29 02:48:00 UTC) #24
Scott Hess - ex-Googler
LGTM! Besides, I'm getting complaint fatigue. I need to work on my stamina, maybe.
6 years, 7 months ago (2014-04-29 18:00:46 UTC) #25
jackhou1
Thanks everyone for your patience with a long CL!
6 years, 7 months ago (2014-04-29 23:52:43 UTC) #26
jackhou1
thakis, please review for OWNERS rsesek, please review for SECURITY
6 years, 7 months ago (2014-04-29 23:53:50 UTC) #27
Robert Sesek
LGTM https://codereview.chromium.org/218883008/diff/250001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/250001/chrome/browser/process_singleton_posix.cc#newcode307 chrome/browser/process_singleton_posix.cc:307: LOG(ERROR) << base::SysWideToNativeMB(base::UTF16ToWide(error)).c_str(); string16 should be able to ...
6 years, 7 months ago (2014-04-30 15:01:42 UTC) #28
Nico
lgtm
6 years, 7 months ago (2014-04-30 18:39:04 UTC) #29
jackhou1
https://codereview.chromium.org/218883008/diff/250001/chrome/browser/process_singleton_posix.cc File chrome/browser/process_singleton_posix.cc (right): https://codereview.chromium.org/218883008/diff/250001/chrome/browser/process_singleton_posix.cc#newcode307 chrome/browser/process_singleton_posix.cc:307: LOG(ERROR) << base::SysWideToNativeMB(base::UTF16ToWide(error)).c_str(); On 2014/04/30 15:01:43, rsesek wrote: > ...
6 years, 7 months ago (2014-05-01 01:21:11 UTC) #30
jackhou1
The CQ bit was checked by jackhou@chromium.org
6 years, 7 months ago (2014-05-01 02:39:57 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jackhou@chromium.org/218883008/290001
6 years, 7 months ago (2014-05-01 02:40:20 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-01 03:48:45 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium
6 years, 7 months ago (2014-05-01 03:48:46 UTC) #34
jackhou1
The CQ bit was checked by jackhou@chromium.org
6 years, 7 months ago (2014-05-01 05:17:22 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jackhou@chromium.org/218883008/290001
6 years, 7 months ago (2014-05-01 05:20:46 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-01 06:41:35 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium
6 years, 7 months ago (2014-05-01 06:41:35 UTC) #38
jackhou1
The CQ bit was checked by jackhou@chromium.org
6 years, 7 months ago (2014-05-01 06:50:01 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jackhou@chromium.org/218883008/290001
6 years, 7 months ago (2014-05-01 06:50:23 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-01 07:51:09 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium
6 years, 7 months ago (2014-05-01 07:51:10 UTC) #42
jackhou1
The CQ bit was checked by jackhou@chromium.org
6 years, 7 months ago (2014-05-01 08:03:12 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jackhou@chromium.org/218883008/290001
6 years, 7 months ago (2014-05-01 08:03:37 UTC) #44
commit-bot: I haz the power
6 years, 7 months ago (2014-05-01 10:50:12 UTC) #45
Message was sent while issue was closed.
Change committed as 267512

Powered by Google App Engine
This is Rietveld 408576698