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

Issue 2843113002: make base::SharedMemoryHandle a class on POSIX. (Closed)

Created:
3 years, 8 months ago by erikchen
Modified:
3 years, 7 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make base::SharedMemoryHandle a class on POSIX. This CL is *mostly* a refactor with no behavioral changes. SharedMemoryHandle is already a struct on Windows and macOS. Making it a struct on all platforms allows the introduction of a GUID field. This CL includes two small fixes: Previously, the implementation of SharedMemory on POSIX was inconsistent on the definition of a valid handle. Sometimes it would check fd > 0, sometimes it would check fd >= 0, and sometimes it would check fd != -1. This CL standardizes on fd >= 0. The previous implementation of SharedMemory on NaCl would leak a fd if it failed to copy the fd in ShareToProcessCommon. BUG=713763 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2843113002 Cr-Commit-Position: refs/heads/master@{#468035} Committed: https://chromium.googlesource.com/chromium/src/+/22a813bccaeb05fc47689b540701e6d590fa7648

Patch Set 1 #

Patch Set 2 : add file. #

Patch Set 3 : Many fixes for Linux. #

Patch Set 4 : Fixes for Android. #

Patch Set 5 : More minor fixes. #

Patch Set 6 : Fixes for ChromeOS. #

Total comments: 22

Patch Set 7 : Comments from thakis. #

Total comments: 2

Patch Set 8 : Comments from rockot. #

Patch Set 9 : Comments from thakis. #

Patch Set 10 : minor rename #

Patch Set 11 : Fix test error. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -150 lines) Patch
M base/BUILD.gn View 1 2 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M base/memory/discardable_shared_memory.cc View 1 2 3 2 chunks +8 lines, -6 lines 0 comments Download
M base/memory/shared_memory.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M base/memory/shared_memory_android.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -5 lines 0 comments Download
M base/memory/shared_memory_handle.h View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -1 line 2 comments Download
A base/memory/shared_memory_handle_posix.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +69 lines, -0 lines 2 comments Download
M base/memory/shared_memory_nacl.cc View 1 2 3 4 5 6 7 8 7 chunks +21 lines, -35 lines 0 comments Download
M base/memory/shared_memory_posix.cc View 1 2 3 4 5 6 7 8 14 chunks +37 lines, -37 lines 0 comments Download
M base/memory/shared_memory_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M base/metrics/field_trial.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/gpu/arc_gpu_video_decode_accelerator.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M components/exo/wayland/clients/client_base.cc View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M components/exo/wayland/server.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M components/printing/renderer/print_web_view_helper_linux.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/sandbox_ipc_linux.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/child/blob_storage/blob_transport_controller_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_message_utils.h View 1 2 3 4 3 chunks +1 line, -6 lines 0 comments Download
M ipc/ipc_message_utils.cc View 1 2 3 4 5 6 7 8 4 chunks +64 lines, -5 lines 0 comments Download
M media/base/video_frame.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M media/gpu/ipc/client/gpu_jpeg_decode_accelerator_host.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -3 lines 0 comments Download
M mojo/edk/embedder/platform_shared_buffer.cc View 1 2 7 chunks +15 lines, -15 lines 0 comments Download
M mojo/edk/system/platform_wrapper_unittest.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M mojo/public/cpp/system/platform_handle.cc View 1 2 3 4 2 chunks +2 lines, -9 lines 0 comments Download
M ui/gfx/mojo/buffer_types_struct_traits.cc View 1 2 2 chunks +3 lines, -7 lines 0 comments Download
M ui/ozone/platform/wayland/wayland_surface_factory.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 73 (54 generated)
erikchen
mark: Please review.
3 years, 8 months ago (2017-04-27 03:28:36 UTC) #16
Mark Mentovai
I won’t be able to review this quickly. It may not happen until Monday.
3 years, 8 months ago (2017-04-27 04:06:50 UTC) #19
erikchen
thakis: Please review.
3 years, 7 months ago (2017-04-27 15:54:32 UTC) #23
Nico
I can look before Monday, but I'll be more confused than Mark. Generally this looks ...
3 years, 7 months ago (2017-04-27 16:24:44 UTC) #24
erikchen
Thanks thakis, PTAL. Many of the issues come from the super weird/broken semantics for SharedMemoryhandle ...
3 years, 7 months ago (2017-04-27 17:08:11 UTC) #25
erikchen
rockot: Please review ipc* and *mojo*. Note that I left you a TODO in shared_memory_handle.h. ...
3 years, 7 months ago (2017-04-27 17:09:27 UTC) #27
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/2843113002/diff/120001/ipc/ipc_message_utils.cc File ipc/ipc_message_utils.cc (right): https://codereview.chromium.org/2843113002/diff/120001/ipc/ipc_message_utils.cc#newcode817 ipc/ipc_message_utils.cc:817: // TODO(morrita): Seems like this should return false. ...
3 years, 7 months ago (2017-04-27 17:35:02 UTC) #32
Nico
Lgtm https://codereview.chromium.org/2843113002/diff/100001/base/memory/shared_memory_handle.h File base/memory/shared_memory_handle.h (right): https://codereview.chromium.org/2843113002/diff/100001/base/memory/shared_memory_handle.h#newcode63 base/memory/shared_memory_handle.h:63: FileDescriptor file_descriptor; On 2017/04/27 17:08:10, erikchen wrote: > ...
3 years, 7 months ago (2017-04-27 17:38:50 UTC) #33
erikchen
https://codereview.chromium.org/2843113002/diff/100001/base/memory/shared_memory_handle.h File base/memory/shared_memory_handle.h (right): https://codereview.chromium.org/2843113002/diff/100001/base/memory/shared_memory_handle.h#newcode63 base/memory/shared_memory_handle.h:63: FileDescriptor file_descriptor; On 2017/04/27 17:38:50, Nico wrote: > On ...
3 years, 7 months ago (2017-04-27 18:13:42 UTC) #34
erikchen
brettw: Please stamp chrome/, components/, content/, media/ and ui/. This CL is a refactor - ...
3 years, 7 months ago (2017-04-27 18:15:15 UTC) #38
Nico
I already cover chrome/ and ui/ On Apr 27, 2017 2:15 PM, <erikchen@chromium.org> wrote: > ...
3 years, 7 months ago (2017-04-27 18:20:23 UTC) #39
brettw
lgtm
3 years, 7 months ago (2017-04-27 22:59:21 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2843113002/170001
3 years, 7 months ago (2017-04-28 01:46:20 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/422785)
3 years, 7 months ago (2017-04-28 01:58:30 UTC) #55
erikchen
rsesek: Looking for a SECURITY_OWNER review for ui/gfx/mojo/buffer_types_struct_traits.cc. Apparently rockot@ is an OWNER of ipc/ ...
3 years, 7 months ago (2017-04-28 04:09:41 UTC) #57
Robert Sesek
LGTM https://codereview.chromium.org/2843113002/diff/190001/base/memory/shared_memory_handle.h File base/memory/shared_memory_handle.h (right): https://codereview.chromium.org/2843113002/diff/190001/base/memory/shared_memory_handle.h#newcode52 base/memory/shared_memory_handle.h:52: // Takes ownership of the OS resource. What ...
3 years, 7 months ago (2017-04-28 16:19:13 UTC) #66
erikchen
https://codereview.chromium.org/2843113002/diff/190001/base/memory/shared_memory_handle.h File base/memory/shared_memory_handle.h (right): https://codereview.chromium.org/2843113002/diff/190001/base/memory/shared_memory_handle.h#newcode52 base/memory/shared_memory_handle.h:52: // Takes ownership of the OS resource. On 2017/04/28 ...
3 years, 7 months ago (2017-04-28 17:03:39 UTC) #67
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2843113002/190001
3 years, 7 months ago (2017-04-28 17:04:41 UTC) #70
commit-bot: I haz the power
3 years, 7 months ago (2017-04-28 17:11:08 UTC) #73
Message was sent while issue was closed.
Committed patchset #11 (id:190001) as
https://chromium.googlesource.com/chromium/src/+/22a813bccaeb05fc47689b540701...

Powered by Google App Engine
This is Rietveld 408576698