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

Issue 258543006: Change UnixDomainSocket::RecvMsg to return ScopedVector<base::ScopedFD> (Closed)

Created:
6 years, 8 months ago by mdempsky
Modified:
6 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, agl, jln+watch_chromium.org
Visibility:
Public.

Description

Change UnixDomainSocket::RecvMsg to return ScopedVector<base::ScopedFD> This is slightly suboptimal because ScopedVector forces each ScopedFD to be individually heap allocated, but it's the simplest solution until C++11 is available. BUG=360274 NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267350

Patch Set 1 #

Patch Set 2 : Eliminate unnecessary raw descriptor #

Patch Set 3 : Cleanup SendRecvMsg implementation a little bit #

Patch Set 4 : Sync to HEAD and resolve conflicts #

Patch Set 5 : Fix #include directives for IWYU #

Total comments: 15

Patch Set 6 : Respond to awong/brettw feedback #

Patch Set 7 : Add DCHECK(fds->empty()) per awong@ feedback #

Patch Set 8 : Static CreateSocketPair() helper per awong@ feedback #

Total comments: 2

Patch Set 9 : Move CreateSocketPair() to top of file #

Patch Set 10 : Sync and resolve conflicts #

Total comments: 2

Patch Set 11 : Remove fds->{empty,reserve}() per brettw@ feedback #

Total comments: 7

Patch Set 12 : Fix sandbox_linux_unittests too #

Patch Set 13 : Change close(fd) to PCHECK(0 == IGNORE_EINTR(close(fd))) per jln@ feedback #

Patch Set 14 : Sync and resolve conflicts with r266735 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -160 lines) Patch
M base/posix/unix_domain_socket_linux.h View 1 2 3 4 chunks +5 lines, -3 lines 0 comments Download
M base/posix/unix_domain_socket_linux.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +40 lines, -26 lines 0 comments Download
M base/posix/unix_domain_socket_linux_unittest.cc View 1 2 3 4 5 chunks +10 lines, -11 lines 0 comments Download
M components/nacl/loader/nacl_helper_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +36 lines, -28 lines 0 comments Download
M components/nacl/zygote/nacl_fork_delegate_linux.cc View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/sandbox_ipc_linux.h View 1 2 3 2 chunks +10 lines, -9 lines 0 comments Download
M content/browser/renderer_host/sandbox_ipc_linux.cc View 1 2 3 4 13 chunks +57 lines, -51 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -1 line 0 comments Download
M content/zygote/zygote_linux.h View 3 chunks +4 lines, -3 lines 0 comments Download
M content/zygote/zygote_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +15 lines, -15 lines 0 comments Download
M sandbox/linux/services/broker_process.cc View 1 2 3 4 3 chunks +5 lines, -9 lines 0 comments Download
M sandbox/linux/services/unix_domain_socket_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
mdempsky
After getting over my distaste of heap allocating individual 'int' objects, using ScopedVector<base::ScopedFD> doesn't seem ...
6 years, 8 months ago (2014-04-24 23:53:27 UTC) #1
mdempsky
On 2014/04/24 23:53:27, mdempsky wrote: > The file I'm most unsure about stylistically is render_sandbox_host_linux.cc, ...
6 years, 8 months ago (2014-04-25 00:34:23 UTC) #2
mdempsky
brettw/awong: Ping? Would either of you mind reviewing for overall style and then approving for ...
6 years, 7 months ago (2014-04-28 18:32:11 UTC) #3
awong
I can look at style, but doing a correctness review is slightly beyond me. Is ...
6 years, 7 months ago (2014-04-28 18:48:16 UTC) #4
brettw
https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc#newcode177 base/posix/unix_domain_socket_linux.cc:177: base::ScopedFD send_sock(raw_socks[1]); On 2014/04/28 18:48:16, awong wrote: > Why ...
6 years, 7 months ago (2014-04-28 19:53:43 UTC) #5
mdempsky
On 2014/04/28 18:48:16, awong wrote: > I can look at style, but doing a correctness ...
6 years, 7 months ago (2014-04-28 20:16:58 UTC) #6
awong
https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc#newcode138 base/posix/unix_domain_socket_linux.cc:138: fds->reserve(wire_fds_len); On 2014/04/28 20:16:58, mdempsky wrote: > On 2014/04/28 ...
6 years, 7 months ago (2014-04-28 20:25:17 UTC) #7
mdempsky
https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/80001/base/posix/unix_domain_socket_linux.cc#newcode138 base/posix/unix_domain_socket_linux.cc:138: fds->reserve(wire_fds_len); On 2014/04/28 20:25:18, awong wrote: > Can we ...
6 years, 7 months ago (2014-04-28 21:11:53 UTC) #8
awong
LGTM from my side with 1 nits and 1 random comment. Passing off to jln ...
6 years, 7 months ago (2014-04-28 21:22:28 UTC) #9
mdempsky
https://codereview.chromium.org/258543006/diff/130001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/130001/base/posix/unix_domain_socket_linux.cc#newcode166 base/posix/unix_domain_socket_linux.cc:166: static bool CreateSocketPair(base::ScopedFD* one, base::ScopedFD* two) { On 2014/04/28 ...
6 years, 7 months ago (2014-04-28 21:24:43 UTC) #10
brettw
lgtm https://codereview.chromium.org/258543006/diff/170001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/170001/base/posix/unix_domain_socket_linux.cc#newcode150 base/posix/unix_domain_socket_linux.cc:150: DCHECK(fds->empty()); Weighing in on this, I think we ...
6 years, 7 months ago (2014-04-28 21:57:01 UTC) #11
mdempsky
https://codereview.chromium.org/258543006/diff/170001/base/posix/unix_domain_socket_linux.cc File base/posix/unix_domain_socket_linux.cc (right): https://codereview.chromium.org/258543006/diff/170001/base/posix/unix_domain_socket_linux.cc#newcode150 base/posix/unix_domain_socket_linux.cc:150: DCHECK(fds->empty()); On 2014/04/28 21:57:02, brettw wrote: > Weighing in ...
6 years, 7 months ago (2014-04-28 22:01:52 UTC) #12
brettw
base lgtm
6 years, 7 months ago (2014-04-28 22:20:06 UTC) #13
mdempsky
awong/brettw: Thanks for the review! jln: Please review content/ and sandbox/ for OWNERS approval. Also, ...
6 years, 7 months ago (2014-04-28 23:12:43 UTC) #14
jln (very slow on Chromium)
Looks good in general, but I think there is a small leak in NaCl. https://chromiumcodereview.appspot.com/258543006/diff/190001/components/nacl/loader/nacl_helper_linux.cc ...
6 years, 7 months ago (2014-04-28 23:48:55 UTC) #15
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/258543006/diff/190001/components/nacl/loader/nacl_helper_linux.cc File components/nacl/loader/nacl_helper_linux.cc (right): https://chromiumcodereview.appspot.com/258543006/diff/190001/components/nacl/loader/nacl_helper_linux.cc#newcode199 components/nacl/loader/nacl_helper_linux.cc:199: child_fds.clear(); I had missed this one, so there is ...
6 years, 7 months ago (2014-04-28 23:57:19 UTC) #16
mdempsky
https://codereview.chromium.org/258543006/diff/190001/components/nacl/loader/nacl_helper_linux.cc File components/nacl/loader/nacl_helper_linux.cc (right): https://codereview.chromium.org/258543006/diff/190001/components/nacl/loader/nacl_helper_linux.cc#newcode196 components/nacl/loader/nacl_helper_linux.cc:196: On 2014/04/28 23:48:55, jln wrote: > Please reset() these ...
6 years, 7 months ago (2014-04-29 00:10:33 UTC) #17
jln (very slow on Chromium)
lgtm, thanks for this nice cleanup!
6 years, 7 months ago (2014-04-29 00:16:52 UTC) #18
Mark Seaborn
LGTM for components/nacl
6 years, 7 months ago (2014-04-30 18:55:44 UTC) #19
mdempsky
The CQ bit was checked by mdempsky@chromium.org
6 years, 7 months ago (2014-04-30 19:03:37 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mdempsky@chromium.org/258543006/250001
6 years, 7 months ago (2014-04-30 19:04:26 UTC) #21
mdempsky
The CQ bit was unchecked by mdempsky@chromium.org
6 years, 7 months ago (2014-04-30 21:53:51 UTC) #22
mdempsky
The CQ bit was checked by mdempsky@chromium.org
6 years, 7 months ago (2014-04-30 21:53:57 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mdempsky@chromium.org/258543006/250001
6 years, 7 months ago (2014-04-30 21:55:30 UTC) #24
commit-bot: I haz the power
6 years, 7 months ago (2014-04-30 21:57:12 UTC) #25
Message was sent while issue was closed.
Change committed as 267350

Powered by Google App Engine
This is Rietveld 408576698