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

Issue 12386010: Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. (Closed)

Created:
7 years, 9 months ago by jeremya
Modified:
7 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, sail+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Visibility:
Public.

Description

Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate when a client connects. The delegate is expected to craft an IPC::Channel from the handle it is given. Previously committed: - https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 - https://src.chromium.org/viewvc/chrome?view=rev&revision=187233 - https://src.chromium.org/viewvc/chrome?view=rev&revision=187554 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187772

Patch Set 1 #

Patch Set 2 : Add comments for unix_domain_socket_util #

Total comments: 1

Patch Set 3 : Cleanups, comments, Close() #

Patch Set 4 : Use base::FilePath instead of std::string in ChannelFactory's constructor. #

Total comments: 34

Patch Set 5 : Don't close the FD immediately after making it. #

Patch Set 6 : comments #

Total comments: 28

Patch Set 7 : Add a test. #

Patch Set 8 : comments #

Patch Set 9 : GetClientEuid --> GetPeerEuid; verify on client #

Patch Set 10 : Don't log ENOENT in pre-bind() unlink(2) #

Patch Set 11 : Fix GetPeerEuid usage on client. #

Total comments: 6

Patch Set 12 : comments #

Total comments: 58

Patch Set 13 : comments #

Total comments: 26

Patch Set 14 : comments #

Patch Set 15 : fix compile #

Patch Set 16 : fix trybots #2 #

Patch Set 17 : IPC_EXPORT #

Patch Set 18 : fix trybots #3 #

Patch Set 19 : fix android trybots #

Total comments: 10

Patch Set 20 : jeremy's comments #

Patch Set 21 : rebase #

Patch Set 22 : fix ipc_tests on linux_chromeos #

Patch Set 23 : rebase #

Patch Set 24 : Remove client-side verification #

Patch Set 25 : un-revert fix to tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+631 lines, -185 lines) Patch
M ipc/ipc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +6 lines, -0 lines 0 comments Download
M ipc/ipc.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +13 lines, -1 line 0 comments Download
M ipc/ipc_channel.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
A ipc/ipc_channel_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +57 lines, -0 lines 0 comments Download
A ipc/ipc_channel_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +88 lines, -0 lines 0 comments Download
M ipc/ipc_channel_posix.h View 1 2 3 4 5 6 7 8 2 chunks +1 line, -7 lines 0 comments Download
M ipc/ipc_channel_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +13 lines, -170 lines 0 comments Download
M ipc/ipc_channel_posix_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -2 lines 0 comments Download
M ipc/ipc_channel_proxy.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_channel_proxy.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
A ipc/unix_domain_socket_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +64 lines, -0 lines 0 comments Download
A ipc/unix_domain_socket_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +202 lines, -0 lines 0 comments Download
A ipc/unix_domain_socket_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +179 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
jeremya
https://codereview.chromium.org/12386010/diff/2001/ipc/ipc.gypi File ipc/ipc.gypi (right): https://codereview.chromium.org/12386010/diff/2001/ipc/ipc.gypi#newcode63 ipc/ipc.gypi:63: 'unix_domain_socket_util.h', I'm not entirely sure how to make sure ...
7 years, 9 months ago (2013-02-28 02:27:16 UTC) #1
Mark Mentovai
https://codereview.chromium.org/12386010/diff/3008/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/3008/ipc/ipc_channel_factory.cc#newcode28 ipc/ipc_channel_factory.cc:28: LOG(WARNING) << "Unable to create pipe named \"" << ...
7 years, 9 months ago (2013-02-28 04:57:56 UTC) #2
jeremya
Tests coming soon to a codereview near you. https://codereview.chromium.org/12386010/diff/3008/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/3008/ipc/ipc_channel_factory.cc#newcode28 ipc/ipc_channel_factory.cc:28: LOG(WARNING) ...
7 years, 9 months ago (2013-02-28 05:58:17 UTC) #3
palmer
https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc#newcode37 ipc/ipc_channel_factory.cc:37: if (!CreateServerUnixDomainSocket(path_, &listen_pipe_)) Maybe just return CreateServerUnixDomainSocket(path_, &listen_pipe_); ? ...
7 years, 9 months ago (2013-02-28 23:48:28 UTC) #4
Mark Mentovai
Still awaiting some tests. https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.h File ipc/ipc_channel_factory.h (right): https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.h#newcode53 ipc/ipc_channel_factory.h:53: } } // namespace IPC ...
7 years, 9 months ago (2013-03-01 03:19:17 UTC) #5
jeremya
Test added. Haven't yet responded to chris's comments though On Fri, Mar 1, 2013 at ...
7 years, 9 months ago (2013-03-01 03:32:57 UTC) #6
jeremya
https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc#newcode37 ipc/ipc_channel_factory.cc:37: if (!CreateServerUnixDomainSocket(path_, &listen_pipe_)) On 2013/02/28 23:48:28, Chris P. wrote: ...
7 years, 9 months ago (2013-03-01 03:49:25 UTC) #7
palmer
https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc#newcode72 ipc/ipc_channel_factory.cc:72: if (client_euid != geteuid()) { > Currently only the ...
7 years, 9 months ago (2013-03-01 19:14:30 UTC) #8
jeremya
https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/10001/ipc/ipc_channel_factory.cc#newcode72 ipc/ipc_channel_factory.cc:72: if (client_euid != geteuid()) { On 2013/03/01 19:14:30, Chris ...
7 years, 9 months ago (2013-03-03 21:39:03 UTC) #9
palmer
Please fix the unlink/PLOG thing before committing, but LGTM modulo two minor documentation nits. https://codereview.chromium.org/12386010/diff/11003/ipc/ipc_channel_factory.cc ...
7 years, 9 months ago (2013-03-05 00:12:31 UTC) #10
jeremya
https://codereview.chromium.org/12386010/diff/11003/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/11003/ipc/ipc_channel_factory.cc#newcode83 ipc/ipc_channel_factory.cc:83: unlink(path_.value().c_str()); On 2013/03/05 00:12:31, Chris P. wrote: > I'd ...
7 years, 9 months ago (2013-03-05 03:27:19 UTC) #11
jeremya
https://codereview.chromium.org/12386010/diff/2003/ipc/unix_domain_socket_util.cc File ipc/unix_domain_socket_util.cc (right): https://codereview.chromium.org/12386010/diff/2003/ipc/unix_domain_socket_util.cc#newcode81 ipc/unix_domain_socket_util.cc:81: if (!file_util::CreateDirectory(pipe_dir)) { Hm, problem: IPC channels normally want ...
7 years, 9 months ago (2013-03-05 03:52:44 UTC) #12
Mark Mentovai
Don’t let the volume of comments disappoint you, that’s more a factor of the size ...
7 years, 9 months ago (2013-03-05 20:08:02 UTC) #13
palmer
https://codereview.chromium.org/12386010/diff/2003/ipc/ipc_channel_factory.h File ipc/ipc_channel_factory.h (right): https://codereview.chromium.org/12386010/diff/2003/ipc/ipc_channel_factory.h#newcode15 ipc/ipc_channel_factory.h:15: // created when a client connects to its delegate. ...
7 years, 9 months ago (2013-03-06 00:59:21 UTC) #14
jeremya
https://codereview.chromium.org/12386010/diff/2003/ipc/ipc_channel.h File ipc/ipc_channel.h (right): https://codereview.chromium.org/12386010/diff/2003/ipc/ipc_channel.h#newcode170 ipc/ipc_channel.h:170: // which case the supplied client_euid is updated with ...
7 years, 9 months ago (2013-03-06 05:03:18 UTC) #15
Mark Mentovai
I consider this LGTM-worthy now. Depending on how much changes after this round, you may ...
7 years, 9 months ago (2013-03-06 19:34:03 UTC) #16
jeremya
All done! :) Thanks for all your help! https://codereview.chromium.org/12386010/diff/28001/ipc/ipc_channel_factory.cc File ipc/ipc_channel_factory.cc (right): https://codereview.chromium.org/12386010/diff/28001/ipc/ipc_channel_factory.cc#newcode55 ipc/ipc_channel_factory.cc:55: if ...
7 years, 9 months ago (2013-03-06 21:46:01 UTC) #17
Mark Mentovai
The tryservers hate it, but I like it. LGTM once you figure that out.
7 years, 9 months ago (2013-03-06 23:07:54 UTC) #18
jeremy
LGTM with a few very minor nits. Hats off for doing this! https://codereview.chromium.org/12386010/diff/60001/ipc/ipc.gypi File ipc/ipc.gypi ...
7 years, 9 months ago (2013-03-07 09:42:35 UTC) #19
jeremya
https://codereview.chromium.org/12386010/diff/60001/ipc/ipc.gypi File ipc/ipc.gypi (right): https://codereview.chromium.org/12386010/diff/60001/ipc/ipc.gypi#newcode76 ipc/ipc.gypi:76: 'ipc_channel_factory.cc', On 2013/03/07 09:42:35, jeremy wrote: > Alphabetical ordering ...
7 years, 9 months ago (2013-03-08 01:42:40 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jeremya@chromium.org/12386010/67001
7 years, 9 months ago (2013-03-08 01:48:59 UTC) #21
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=17610
7 years, 9 months ago (2013-03-08 05:38:05 UTC) #22
jeremya
Committed patchset #21 manually as r186912 (presubmit successful).
7 years, 9 months ago (2013-03-08 07:25:04 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jeremya@chromium.org/12386010/94001
7 years, 9 months ago (2013-03-11 00:45:15 UTC) #24
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=107123
7 years, 9 months ago (2013-03-11 02:41:34 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jeremya@chromium.org/12386010/94001
7 years, 9 months ago (2013-03-11 02:46:38 UTC) #26
commit-bot: I haz the power
Change committed as 187233
7 years, 9 months ago (2013-03-11 04:17:18 UTC) #27
jeremya
This got reverted again -- second time because VMTest failed some automation stuff. I suspect ...
7 years, 9 months ago (2013-03-11 11:31:17 UTC) #28
Mark Mentovai
That sounds reasonable to me but you should also get palmer’s approval.
7 years, 9 months ago (2013-03-11 16:06:47 UTC) #29
palmer
I don't understand what would cause the client EUID to != the server EUID. That ...
7 years, 9 months ago (2013-03-11 22:02:35 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jeremya@chromium.org/12386010/110002
7 years, 9 months ago (2013-03-12 07:01:30 UTC) #31
commit-bot: I haz the power
Change committed as 187554
7 years, 9 months ago (2013-03-12 10:12:18 UTC) #32
falken
On 2013/03/12 10:12:18, I haz the power (commit-bot) wrote: > Change committed as 187554 Sorry ...
7 years, 9 months ago (2013-03-13 03:42:15 UTC) #33
jeremya
7 years, 9 months ago (2013-03-13 04:23:29 UTC) #34
Message was sent while issue was closed.
Committed patchset #25 manually as r187772 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698