[webkit-changes] [WebKit/WebKit] 75e50b: [Unix] Make UnixFileDescriptor copyable

Žan Doberšek noreply at github.com
Tue Jan 31 00:37:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 75e50bc51ff72253bfc747349cc8414e0c76c1cd
      https://github.com/WebKit/WebKit/commit/75e50bc51ff72253bfc747349cc8414e0c76c1cd
  Author: Žan Doberšek <zdobersek at igalia.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    M Source/WTF/wtf/unix/UnixFileDescriptor.h

  Log Message:
  -----------
  [Unix] Make UnixFileDescriptor copyable
https://bugs.webkit.org/show_bug.cgi?id=251358

Reviewed by Michael Catanzaro.

Make UnixFileDescriptor copyable for now, matching similar types on other
platforms and enabling common behavior around classes that work with those
types.

The destructor is modified to invalidate any valid file descriptor value,
enabling correct procedure when a UnixFileDescriptor with an invalid fd value
is copied into a UnixFileDescriptor with a valid fd value.

It's still not great since copying these objects can lead to unnecessary
file descriptor churn, but that can be managed until there's some consensus
around how to operate with objects of these types (e.g. if move-only trait is
feasible across the board).

* Source/WTF/wtf/unix/UnixFileDescriptor.h:
(WTF::UnixFileDescriptor::UnixFileDescriptor):
(WTF::UnixFileDescriptor::operator=):

Canonical link: https://commits.webkit.org/259610@main




More information about the webkit-changes mailing list