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

Issue 2846293002: Make PlatformFileForTransit its own class on Windows. (Closed)

Created:
3 years, 7 months ago by erikchen
Modified:
3 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make PlatformFileForTransit its own class on Windows. This CL is *mostly* a refactor with no intended behavior change. Previously, PlatformFileForTransit had the same semantics as SharedMemoryHandle, so it was typedef-ed to SharedMemoryHandle. However, the semantics for SharedMemoryHandle are changing, so it's no longer appropriate to do so. This CL includes a small fix to ppb_nacl_private_impl.cc, which previously leaked a HANDLE on Windows, but not on an fd on POSIX. The leak was introduced by "Make PlatformFileForTransit a class on Windows." [commit: 19e5f6905203ecd6adbbc4bfe57e086eb61028c6]. Prior to that CL: On Windows, NaCl would duplicate the handle into the destination process [closing the original handle in the process], and then pass the result as a raw int. On POSIX, NaCl would duplicate the handle using Chrome IPC, using base::FileDescriptor.auto_close = true, which would cause the IPC subsystem to close the handle. After that CL: On Windows, NaCl would let Chrome IPC transport the handle, but failed to call PlatformFileForTransit::SetOwnershipPassesToIPC(true) [the equivalent of base::FileDescriptor.auto_close]. This caused a leak of the handle in the browser process. In this CL: PlatformFileForTransit is now its own class, with no auto_close parameter because the IPC subsystem always closes the handle in the source process. BUG=713763 Review-Url: https://codereview.chromium.org/2846293002 Cr-Commit-Position: refs/heads/master@{#468213} Committed: https://chromium.googlesource.com/chromium/src/+/d804e105f1e27e1ffafb7ac454d445188d6f602c

Patch Set 1 #

Patch Set 2 : fix nacl #

Patch Set 3 : Use nullptr instead of INVALID_HANDLE_VALUE. #

Total comments: 10

Patch Set 4 : Comments from mseaborn. #

Patch Set 5 : Change message serialization to write nothing if the handle isn't valid. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -14 lines) Patch
M components/nacl/renderer/ppb_nacl_private_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M ipc/ipc_message_utils.h View 2 chunks +17 lines, -0 lines 0 comments Download
M ipc/ipc_message_utils.cc View 1 2 3 4 2 chunks +43 lines, -0 lines 0 comments Download
M ipc/ipc_platform_file.h View 1 2 3 1 chunk +23 lines, -8 lines 0 comments Download
M ipc/ipc_platform_file.cc View 1 2 3 2 chunks +27 lines, -4 lines 0 comments Download

Messages

Total messages: 30 (20 generated)
erikchen
rockot: Please review.
3 years, 7 months ago (2017-04-28 17:47:44 UTC) #5
erikchen
rockot: Please review.
3 years, 7 months ago (2017-04-28 17:47:45 UTC) #6
erikchen
mseaborn: Please review components/nacl
3 years, 7 months ago (2017-04-28 20:42:32 UTC) #13
Ken Rockot(use gerrit already)
ipc lgtm
3 years, 7 months ago (2017-04-28 20:45:52 UTC) #14
Mark Seaborn
https://codereview.chromium.org/2846293002/diff/40001/components/nacl/renderer/ppb_nacl_private_impl.cc File components/nacl/renderer/ppb_nacl_private_impl.cc (left): https://codereview.chromium.org/2846293002/diff/40001/components/nacl/renderer/ppb_nacl_private_impl.cc#oldcode464 components/nacl/renderer/ppb_nacl_private_impl.cc:464: nexe_for_transit = IPC::PlatformFileForTransit(nexe_file_info->handle, You said "This CL includes a ...
3 years, 7 months ago (2017-04-28 22:45:21 UTC) #15
erikchen
mseaborn: PTAL https://codereview.chromium.org/2846293002/diff/40001/components/nacl/renderer/ppb_nacl_private_impl.cc File components/nacl/renderer/ppb_nacl_private_impl.cc (left): https://codereview.chromium.org/2846293002/diff/40001/components/nacl/renderer/ppb_nacl_private_impl.cc#oldcode464 components/nacl/renderer/ppb_nacl_private_impl.cc:464: nexe_for_transit = IPC::PlatformFileForTransit(nexe_file_info->handle, On 2017/04/28 22:45:21, Mark ...
3 years, 7 months ago (2017-04-28 23:24:37 UTC) #19
Mark Seaborn
LGTM, thanks
3 years, 7 months ago (2017-04-28 23:34:23 UTC) #20
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/2846293002/60001
3 years, 7 months ago (2017-04-28 23:46:57 UTC) #24
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/2846293002/80001
3 years, 7 months ago (2017-04-29 01:08:00 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-04-29 02:24:53 UTC) #30
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/d804e105f1e27e1ffafb7ac454d4...

Powered by Google App Engine
This is Rietveld 408576698