DescriptionMake 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. #
Messages
Total messages: 30 (20 generated)
|