| Differences between
and this patch
- a/Source/WebKit/ChangeLog +63 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2022-04-06  Zan Dobersek  <zdobersek@igalia.com>
2
3
        [Unix] Adopt UnixFileDescriptor in IPC::Attachment
4
        https://bugs.webkit.org/show_bug.cgi?id=238801
5
6
        Reviewed by Carlos Garcia Campos.
7
8
        Adopt WTF::UnixFileDescriptor for usage in IPC::Attachment, in place of
9
        a raw integer value. This simplifies move operations and destruction of
10
        this value.
11
12
        The two relevant constructors are changed to expect a UnixFileDescriptor
13
        rvalue, and they're also made explicit. The file descriptor object is
14
        accessible through both a const and a non-const getter, which allows the
15
        user to read or release the file descriptor contained there. There's
16
        also a release method that returns the contained UnixFileDescriptor.
17
18
        The releaseFileDescriptor() and fileDescriptor() methods, previously
19
        releasing or returning the contained integer value of the descriptor.
20
        Call sites for these methods as well as the old-form constructors are
21
        adjusted to the new variants.
22
23
        * Platform/IPC/Attachment.h:
24
        (IPC::Attachment::isNull const):
25
        (IPC::Attachment::fd const):
26
        (IPC::Attachment::release):
27
        (IPC::Attachment::releaseFileDescriptor): Deleted.
28
        (IPC::Attachment::fileDescriptor const): Deleted.
29
        * Platform/IPC/unix/AttachmentUnix.cpp:
30
        (IPC::Attachment::Attachment):
31
        (IPC::Attachment::operator=):
32
        (IPC::Attachment::~Attachment): Deleted.
33
        * Platform/IPC/unix/ConnectionUnix.cpp:
34
        (IPC::Connection::processMessage):
35
        (IPC::Connection::sendOutputMessage):
36
        (IPC::Connection::createConnectionIdentifierPair):
37
        * Platform/unix/SharedMemoryUnix.cpp:
38
        (WebKit::SharedMemory::Handle::isNull const):
39
        (WebKit::SharedMemory::map):
40
        (WebKit::SharedMemory::createHandle):
41
        * Shared/WebCoreArgumentCoders.cpp:
42
        (IPC::ArgumentCoder<UnixFileDescriptor>::encode):
43
        (IPC::ArgumentCoder<UnixFileDescriptor>::decode):
44
        * Shared/glib/UserMessage.cpp:
45
        (WebKit::UserMessage::encode const):
46
        (WebKit::UserMessage::decode):
47
        * UIProcess/API/wpe/PageClientImpl.cpp:
48
        (WebKit::PageClientImpl::hostFileDescriptor):
49
        * UIProcess/glib/WebProcessPoolGLib.cpp:
50
        (WebKit::WebProcessPool::platformInitializeWebProcess):
51
        * WebProcess/GPU/GPUProcessConnectionInfo.h:
52
        (WebKit::GPUProcessConnectionInfo::identifier const):
53
        (WebKit::GPUProcessConnectionInfo::releaseIdentifier):
54
        * WebProcess/Inspector/WebInspector.cpp:
55
        (WebKit::WebInspector::setFrontendConnection):
56
        * WebProcess/Network/NetworkProcessConnectionInfo.h:
57
        (WebKit::NetworkProcessConnectionInfo::identifier const):
58
        (WebKit::NetworkProcessConnectionInfo::releaseIdentifier):
59
        * WebProcess/WebPage/WebPage.h:
60
        (WebKit::WebPage::hostFileDescriptor const):
61
        * WebProcess/glib/WebProcessGLib.cpp:
62
        (WebKit::WebProcess::platformInitializeWebProcess):
63
1
2022-04-06  Youenn Fablet  <youenn@apple.com>
64
2022-04-06  Youenn Fablet  <youenn@apple.com>
2
65
3
        Remove Notification::m_relatedNotificationIdentifier
66
        Remove Notification::m_relatedNotificationIdentifier
- a/Source/WebKit/Platform/IPC/Attachment.h -5 / +9 lines
Lines 40-45 a/Source/WebKit/Platform/IPC/Attachment.h_sec1
40
#if USE(UNIX_DOMAIN_SOCKETS)
40
#if USE(UNIX_DOMAIN_SOCKETS)
41
#include <variant>
41
#include <variant>
42
#include <wtf/Function.h>
42
#include <wtf/Function.h>
43
#include <wtf/unix/UnixFileDescriptor.h>
43
#endif
44
#endif
44
45
45
namespace IPC {
46
namespace IPC {
Lines 63-72 public: a/Source/WebKit/Platform/IPC/Attachment.h_sec2
63
    };
64
    };
64
65
65
#if USE(UNIX_DOMAIN_SOCKETS)
66
#if USE(UNIX_DOMAIN_SOCKETS)
67
    explicit Attachment(UnixFileDescriptor&&, size_t);
68
    explicit Attachment(UnixFileDescriptor&&);
69
66
    Attachment(Attachment&&);
70
    Attachment(Attachment&&);
67
    Attachment& operator=(Attachment&&);
71
    Attachment& operator=(Attachment&&);
68
    Attachment(int fileDescriptor, size_t);
69
    Attachment(int fileDescriptor);
70
    ~Attachment();
72
    ~Attachment();
71
73
72
    using SocketDescriptor = int;
74
    using SocketDescriptor = int;
Lines 84-93 public: a/Source/WebKit/Platform/IPC/Attachment.h_sec3
84
    Type type() const { return m_type; }
86
    Type type() const { return m_type; }
85
87
86
#if USE(UNIX_DOMAIN_SOCKETS)
88
#if USE(UNIX_DOMAIN_SOCKETS)
89
    bool isNull() const { return !m_fd; }
87
    size_t size() const { return m_size; }
90
    size_t size() const { return m_size; }
88
91
89
    int releaseFileDescriptor() { int temp = m_fileDescriptor; m_fileDescriptor = -1; return temp; }
92
    const UnixFileDescriptor& fd() const { return m_fd; }
90
    int fileDescriptor() const { return m_fileDescriptor; }
93
    UnixFileDescriptor release() { return std::exchange(m_fd, UnixFileDescriptor { }); }
94
91
    const CustomWriter& customWriter() const { return m_customWriter; }
95
    const CustomWriter& customWriter() const { return m_customWriter; }
92
#elif OS(DARWIN)
96
#elif OS(DARWIN)
93
    void release();
97
    void release();
Lines 106-112 private: a/Source/WebKit/Platform/IPC/Attachment.h_sec4
106
    Type m_type;
110
    Type m_type;
107
111
108
#if USE(UNIX_DOMAIN_SOCKETS)
112
#if USE(UNIX_DOMAIN_SOCKETS)
109
    int m_fileDescriptor { -1 };
113
    UnixFileDescriptor m_fd;
110
    size_t m_size;
114
    size_t m_size;
111
    CustomWriter m_customWriter;
115
    CustomWriter m_customWriter;
112
#elif OS(DARWIN)
116
#elif OS(DARWIN)
- a/Source/WebKit/Platform/IPC/unix/AttachmentUnix.cpp -14 / +7 lines
Lines 31-64 a/Source/WebKit/Platform/IPC/unix/AttachmentUnix.cpp_sec1
31
31
32
namespace IPC {
32
namespace IPC {
33
33
34
Attachment::Attachment(int fileDescriptor, size_t size)
34
Attachment::Attachment(UnixFileDescriptor&& fd, size_t size)
35
    : m_type(MappedMemoryType)
35
    : m_type(MappedMemoryType)
36
    , m_fileDescriptor(fileDescriptor)
36
    , m_fd(WTFMove(fd))
37
    , m_size(size)
37
    , m_size(size)
38
{
38
{
39
}
39
}
40
40
41
Attachment::Attachment(int fileDescriptor)
41
Attachment::Attachment(UnixFileDescriptor&& fd)
42
    : m_type(SocketType)
42
    : m_type(SocketType)
43
    , m_fileDescriptor(fileDescriptor)
43
    , m_fd(WTFMove(fd))
44
    , m_size(0)
44
    , m_size(0)
45
{
45
{
46
}
46
}
47
47
48
Attachment::Attachment(Attachment&& attachment)
48
Attachment::Attachment(Attachment&& attachment)
49
    : m_type(attachment.m_type)
49
    : m_type(attachment.m_type)
50
    , m_fileDescriptor(attachment.m_fileDescriptor)
50
    , m_fd(WTFMove(attachment.m_fd))
51
    , m_size(attachment.m_size)
51
    , m_size(attachment.m_size)
52
    , m_customWriter(WTFMove(attachment.m_customWriter))
52
    , m_customWriter(WTFMove(attachment.m_customWriter))
53
{
53
{
54
    attachment.m_type = Uninitialized;
54
    attachment.m_type = Uninitialized;
55
    attachment.m_fileDescriptor = -1;
56
    attachment.m_size = 0;
55
    attachment.m_size = 0;
57
}
56
}
58
57
59
Attachment::Attachment(CustomWriter&& writer)
58
Attachment::Attachment(CustomWriter&& writer)
60
    : m_type(CustomWriterType)
59
    : m_type(CustomWriterType)
61
    , m_fileDescriptor(-1)
62
    , m_size(0)
60
    , m_size(0)
63
    , m_customWriter(WTFMove(writer))
61
    , m_customWriter(WTFMove(writer))
64
{
62
{
Lines 68-75 Attachment& Attachment::operator=(Attachment&& attachment) a/Source/WebKit/Platform/IPC/unix/AttachmentUnix.cpp_sec2
68
{
66
{
69
    m_type = attachment.m_type;
67
    m_type = attachment.m_type;
70
    attachment.m_type = Uninitialized;
68
    attachment.m_type = Uninitialized;
71
    m_fileDescriptor = attachment.m_fileDescriptor;
69
    m_fd = WTFMove(attachment.m_fd);
72
    attachment.m_fileDescriptor = -1;
73
    m_size = attachment.m_size;
70
    m_size = attachment.m_size;
74
    attachment.m_size = 0;
71
    attachment.m_size = 0;
75
    m_customWriter = WTFMove(attachment.m_customWriter);
72
    m_customWriter = WTFMove(attachment.m_customWriter);
Lines 77-86 Attachment& Attachment::operator=(Attachment&& attachment) a/Source/WebKit/Platform/IPC/unix/AttachmentUnix.cpp_sec3
77
    return *this;
74
    return *this;
78
}
75
}
79
76
80
Attachment::~Attachment()
77
Attachment::~Attachment() = default;
81
{
82
    if (m_fileDescriptor != -1)
83
        closeWithRetry(m_fileDescriptor);
84
}
85
78
86
} // namespace IPC
79
} // namespace IPC
- a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp -7 / +7 lines
Lines 204-215 bool Connection::processMessage() a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp_sec1
204
        case Attachment::MappedMemoryType:
204
        case Attachment::MappedMemoryType:
205
            if (!attachmentInfo[i].isNull())
205
            if (!attachmentInfo[i].isNull())
206
                fd = m_fileDescriptors[fdIndex++];
206
                fd = m_fileDescriptors[fdIndex++];
207
            attachments[attachmentCount - i - 1] = Attachment(fd, attachmentInfo[i].size());
207
            attachments[attachmentCount - i - 1] = Attachment(UnixFileDescriptor(fd, UnixFileDescriptor::Adopt), attachmentInfo[i].size());
208
            break;
208
            break;
209
        case Attachment::SocketType:
209
        case Attachment::SocketType:
210
            if (!attachmentInfo[i].isNull())
210
            if (!attachmentInfo[i].isNull())
211
                fd = m_fileDescriptors[fdIndex++];
211
                fd = m_fileDescriptors[fdIndex++];
212
            attachments[attachmentCount - i - 1] = Attachment(fd);
212
            attachments[attachmentCount - i - 1] = Attachment(UnixFileDescriptor(fd, UnixFileDescriptor::Adopt));
213
            break;
213
            break;
214
        case Attachment::CustomWriterType:
214
        case Attachment::CustomWriterType:
215
            attachments[attachmentCount - i - 1] = Attachment(Attachment::CustomWriter(m_socketDescriptor));
215
            attachments[attachmentCount - i - 1] = Attachment(Attachment::CustomWriter(m_socketDescriptor));
Lines 230-236 bool Connection::processMessage() a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp_sec2
230
        }
230
        }
231
231
232
        WebKit::SharedMemory::Handle handle;
232
        WebKit::SharedMemory::Handle handle;
233
        handle.adoptAttachment(IPC::Attachment(m_fileDescriptors[attachmentFileDescriptorCount - 1], attachmentInfo[attachmentCount].size()));
233
        handle.adoptAttachment(Attachment(UnixFileDescriptor(m_fileDescriptors[attachmentFileDescriptorCount - 1], UnixFileDescriptor::Adopt), attachmentInfo[attachmentCount].size()));
234
234
235
        oolMessageBody = WebKit::SharedMemory::map(handle, WebKit::SharedMemory::Protection::ReadOnly);
235
        oolMessageBody = WebKit::SharedMemory::map(handle, WebKit::SharedMemory::Protection::ReadOnly);
236
        if (!oolMessageBody) {
236
        if (!oolMessageBody) {
Lines 489-495 bool Connection::sendOutputMessage(UnixMessage& outputMessage) a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp_sec3
489
489
490
        size_t attachmentFDBufferLength = std::count_if(attachments.begin(), attachments.end(),
490
        size_t attachmentFDBufferLength = std::count_if(attachments.begin(), attachments.end(),
491
            [](const Attachment& attachment) {
491
            [](const Attachment& attachment) {
492
                return attachment.fileDescriptor() != -1;
492
                return !attachment.isNull();
493
            });
493
            });
494
494
495
        if (attachmentFDBufferLength) {
495
        if (attachmentFDBufferLength) {
Lines 517-525 bool Connection::sendOutputMessage(UnixMessage& outputMessage) a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp_sec4
517
                attachmentInfo[i].setSize(attachments[i].size());
517
                attachmentInfo[i].setSize(attachments[i].size());
518
                FALLTHROUGH;
518
                FALLTHROUGH;
519
            case Attachment::SocketType:
519
            case Attachment::SocketType:
520
                if (attachments[i].fileDescriptor() != -1) {
520
                if (!attachments[i].isNull()) {
521
                    ASSERT(fdPtr);
521
                    ASSERT(fdPtr);
522
                    fdPtr[fdIndex++] = attachments[i].fileDescriptor();
522
                    fdPtr[fdIndex++] = attachments[i].fd().value();
523
                } else
523
                } else
524
                    attachmentInfo[i].setNull();
524
                    attachmentInfo[i].setNull();
525
                break;
525
                break;
Lines 638-643 void Connection::didReceiveSyncReply(OptionSet<SendSyncOption>) a/Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp_sec5
638
std::optional<Connection::ConnectionIdentifierPair> Connection::createConnectionIdentifierPair()
638
std::optional<Connection::ConnectionIdentifierPair> Connection::createConnectionIdentifierPair()
639
{
639
{
640
    Connection::SocketPair socketPair = Connection::createPlatformConnection();
640
    Connection::SocketPair socketPair = Connection::createPlatformConnection();
641
    return ConnectionIdentifierPair { socketPair.server, Attachment { socketPair.client } };
641
    return ConnectionIdentifierPair { socketPair.server, Attachment { UnixFileDescriptor { socketPair.client, UnixFileDescriptor::Adopt } } };
642
}
642
}
643
} // namespace IPC
643
} // namespace IPC
- a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp -7 / +7 lines
Lines 75-81 void SharedMemory::Handle::clear() a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp_sec1
75
75
76
bool SharedMemory::Handle::isNull() const
76
bool SharedMemory::Handle::isNull() const
77
{
77
{
78
    return m_attachment.fileDescriptor() == -1;
78
    return m_attachment.isNull();
79
}
79
}
80
80
81
void SharedMemory::IPCHandle::encode(IPC::Encoder& encoder) const
81
void SharedMemory::IPCHandle::encode(IPC::Encoder& encoder) const
Lines 200-208 RefPtr<SharedMemory> SharedMemory::map(const Handle& handle, Protection protecti a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp_sec2
200
{
200
{
201
    ASSERT(!handle.isNull());
201
    ASSERT(!handle.isNull());
202
202
203
    int fd = handle.m_attachment.releaseFileDescriptor();
203
    UnixFileDescriptor fd = handle.m_attachment.release();
204
    void* data = mmap(0, handle.m_attachment.size(), accessModeMMap(protection), MAP_SHARED, fd, 0);
204
    void* data = mmap(0, handle.m_attachment.size(), accessModeMMap(protection), MAP_SHARED, fd.value(), 0);
205
    closeWithRetry(fd);
205
    fd = { };
206
    if (data == MAP_FAILED)
206
    if (data == MAP_FAILED)
207
        return nullptr;
207
        return nullptr;
208
208
Lines 240-251 bool SharedMemory::createHandle(Handle& handle, Protection) a/Source/WebKit/Platform/unix/SharedMemoryUnix.cpp_sec3
240
    // FIXME: Handle the case where the passed Protection is ReadOnly.
240
    // FIXME: Handle the case where the passed Protection is ReadOnly.
241
    // See https://bugs.webkit.org/show_bug.cgi?id=131542.
241
    // See https://bugs.webkit.org/show_bug.cgi?id=131542.
242
242
243
    int duplicatedHandle = dupCloseOnExec(m_fileDescriptor.value());
243
    UnixFileDescriptor duplicate { m_fileDescriptor.value(), UnixFileDescriptor::Duplicate };
244
    if (duplicatedHandle == -1) {
244
    if (!duplicate) {
245
        ASSERT_NOT_REACHED();
245
        ASSERT_NOT_REACHED();
246
        return false;
246
        return false;
247
    }
247
    }
248
    handle.m_attachment = IPC::Attachment(duplicatedHandle, m_size);
248
    handle.m_attachment = IPC::Attachment(WTFMove(duplicate), m_size);
249
    return true;
249
    return true;
250
}
250
}
251
251
- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp -4 / +3 lines
Lines 3295-3307 std::optional<TextRecognitionDataDetector> ArgumentCoder<TextRecognitionDataDete a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp_sec1
3295
3295
3296
void ArgumentCoder<UnixFileDescriptor>::encode(Encoder& encoder, const UnixFileDescriptor& fd)
3296
void ArgumentCoder<UnixFileDescriptor>::encode(Encoder& encoder, const UnixFileDescriptor& fd)
3297
{
3297
{
3298
    auto duplicate = fd.duplicate();
3298
    encoder.addAttachment(Attachment(fd.duplicate()));
3299
    encoder.addAttachment(Attachment(duplicate.release()));
3300
}
3299
}
3301
3300
3302
void ArgumentCoder<UnixFileDescriptor>::encode(Encoder& encoder, UnixFileDescriptor&& fd)
3301
void ArgumentCoder<UnixFileDescriptor>::encode(Encoder& encoder, UnixFileDescriptor&& fd)
3303
{
3302
{
3304
    encoder.addAttachment(Attachment(fd.release()));
3303
    encoder.addAttachment(Attachment(WTFMove(fd)));
3305
}
3304
}
3306
3305
3307
std::optional<UnixFileDescriptor> ArgumentCoder<UnixFileDescriptor>::decode(Decoder& decoder)
3306
std::optional<UnixFileDescriptor> ArgumentCoder<UnixFileDescriptor>::decode(Decoder& decoder)
Lines 3309-3315 std::optional<UnixFileDescriptor> ArgumentCoder<UnixFileDescriptor>::decode(Deco a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp_sec2
3309
    auto attachment = decoder.takeLastAttachment();
3308
    auto attachment = decoder.takeLastAttachment();
3310
    if (!attachment)
3309
    if (!attachment)
3311
        return std::nullopt;
3310
        return std::nullopt;
3312
    return std::optional<UnixFileDescriptor> { std::in_place, attachment->releaseFileDescriptor(), UnixFileDescriptor::Adopt };
3311
    return std::optional<UnixFileDescriptor> { std::in_place, attachment->release() };
3313
}
3312
}
3314
3313
3315
#endif
3314
#endif
- a/Source/WebKit/Shared/glib/UserMessage.cpp -2 / +2 lines
Lines 51-57 void UserMessage::encode(IPC::Encoder& encoder) const a/Source/WebKit/Shared/glib/UserMessage.cpp_sec1
51
    if (fileDescriptors) {
51
    if (fileDescriptors) {
52
        int length = g_unix_fd_list_get_length(fileDescriptors.get());
52
        int length = g_unix_fd_list_get_length(fileDescriptors.get());
53
        for (int i = 0; i < length; ++i)
53
        for (int i = 0; i < length; ++i)
54
            attachments.append(IPC::Attachment(g_unix_fd_list_get(fileDescriptors.get(), i, nullptr)));
54
            attachments.append(IPC::Attachment(UnixFileDescriptor(g_unix_fd_list_get(fileDescriptors.get(), i, nullptr), UnixFileDescriptor::Adopt)));
55
    }
55
    }
56
    encoder << attachments;
56
    encoder << attachments;
57
}
57
}
Lines 91-97 std::optional<UserMessage> UserMessage::decode(IPC::Decoder& decoder) a/Source/WebKit/Shared/glib/UserMessage.cpp_sec2
91
    if (!attachments->isEmpty()) {
91
    if (!attachments->isEmpty()) {
92
        result.fileDescriptors = adoptGRef(g_unix_fd_list_new());
92
        result.fileDescriptors = adoptGRef(g_unix_fd_list_new());
93
        for (auto& attachment : *attachments) {
93
        for (auto& attachment : *attachments) {
94
            if (g_unix_fd_list_append(result.fileDescriptors.get(), attachment.releaseFileDescriptor(), nullptr) == -1)
94
            if (g_unix_fd_list_append(result.fileDescriptors.get(), attachment.release().release(), nullptr) == -1)
95
                return std::nullopt;
95
                return std::nullopt;
96
        }
96
        }
97
    }
97
    }
- a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp -1 / +1 lines
Lines 59-65 struct wpe_view_backend* PageClientImpl::viewBackend() a/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp_sec1
59
59
60
IPC::Attachment PageClientImpl::hostFileDescriptor()
60
IPC::Attachment PageClientImpl::hostFileDescriptor()
61
{
61
{
62
    return wpe_view_backend_get_renderer_host_fd(m_view.backend());
62
    return IPC::Attachment(UnixFileDescriptor(wpe_view_backend_get_renderer_host_fd(m_view.backend()), UnixFileDescriptor::Adopt));
63
}
63
}
64
64
65
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
65
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(WebProcessProxy& process)
- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp -2 / +2 lines
Lines 78-84 void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp_sec1
78
    parameters.isServiceWorkerProcess = process.isRunningServiceWorkers();
78
    parameters.isServiceWorkerProcess = process.isRunningServiceWorkers();
79
79
80
    if (!parameters.isServiceWorkerProcess) {
80
    if (!parameters.isServiceWorkerProcess) {
81
        parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
81
        parameters.hostClientFileDescriptor = IPC::Attachment(UnixFileDescriptor(wpe_renderer_host_create_client(), UnixFileDescriptor::Adopt));
82
        parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(String { wpe_loader_get_loaded_implementation_library_name() });
82
        parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(String { wpe_loader_get_loaded_implementation_library_name() });
83
    }
83
    }
84
#endif
84
#endif
Lines 88-94 void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp_sec2
88
#if USE(WPE_RENDERER)
88
#if USE(WPE_RENDERER)
89
        wpe_loader_init("libWPEBackend-fdo-1.0.so.1");
89
        wpe_loader_init("libWPEBackend-fdo-1.0.so.1");
90
        if (AcceleratedBackingStoreWayland::checkRequirements()) {
90
        if (AcceleratedBackingStoreWayland::checkRequirements()) {
91
            parameters.hostClientFileDescriptor = wpe_renderer_host_create_client();
91
            parameters.hostClientFileDescriptor = IPC::Attachment(UnixFileDescriptor(wpe_renderer_host_create_client(), UnixFileDescriptor::Adopt));
92
            parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(String { wpe_loader_get_loaded_implementation_library_name() });
92
            parameters.implementationLibraryName = FileSystem::fileSystemRepresentation(String { wpe_loader_get_loaded_implementation_library_name() });
93
        }
93
        }
94
#elif USE(EGL)
94
#elif USE(EGL)
- a/Source/WebKit/WebProcess/GPU/GPUProcessConnectionInfo.h -2 / +2 lines
Lines 41-47 struct GPUProcessConnectionInfo { a/Source/WebKit/WebProcess/GPU/GPUProcessConnectionInfo.h_sec1
41
    IPC::Connection::Identifier identifier() const
41
    IPC::Connection::Identifier identifier() const
42
    {
42
    {
43
#if USE(UNIX_DOMAIN_SOCKETS)
43
#if USE(UNIX_DOMAIN_SOCKETS)
44
        return IPC::Connection::Identifier(connection.fileDescriptor());
44
        return IPC::Connection::Identifier(connection.fd().value());
45
#elif OS(DARWIN)
45
#elif OS(DARWIN)
46
        return IPC::Connection::Identifier(connection.port());
46
        return IPC::Connection::Identifier(connection.port());
47
#elif OS(WINDOWS)
47
#elif OS(WINDOWS)
Lines 55-61 struct GPUProcessConnectionInfo { a/Source/WebKit/WebProcess/GPU/GPUProcessConnectionInfo.h_sec2
55
    IPC::Connection::Identifier releaseIdentifier()
55
    IPC::Connection::Identifier releaseIdentifier()
56
    {
56
    {
57
#if USE(UNIX_DOMAIN_SOCKETS)
57
#if USE(UNIX_DOMAIN_SOCKETS)
58
        auto returnValue = IPC::Connection::Identifier(connection.releaseFileDescriptor());
58
        auto returnValue = IPC::Connection::Identifier(connection.release().release());
59
#else
59
#else
60
        auto returnValue = identifier();
60
        auto returnValue = identifier();
61
#endif
61
#endif
- a/Source/WebKit/WebProcess/Inspector/WebInspector.cpp -1 / +1 lines
Lines 85-91 void WebInspector::setFrontendConnection(IPC::Attachment encodedConnectionIdenti a/Source/WebKit/WebProcess/Inspector/WebInspector.cpp_sec1
85
    }
85
    }
86
86
87
#if USE(UNIX_DOMAIN_SOCKETS)
87
#if USE(UNIX_DOMAIN_SOCKETS)
88
    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.releaseFileDescriptor());
88
    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.release().release());
89
#elif OS(DARWIN)
89
#elif OS(DARWIN)
90
    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
90
    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
91
#elif OS(WINDOWS)
91
#elif OS(WINDOWS)
- a/Source/WebKit/WebProcess/Network/NetworkProcessConnectionInfo.h -2 / +2 lines
Lines 40-46 struct NetworkProcessConnectionInfo { a/Source/WebKit/WebProcess/Network/NetworkProcessConnectionInfo.h_sec1
40
    IPC::Connection::Identifier identifier() const
40
    IPC::Connection::Identifier identifier() const
41
    {
41
    {
42
#if USE(UNIX_DOMAIN_SOCKETS)
42
#if USE(UNIX_DOMAIN_SOCKETS)
43
        return IPC::Connection::Identifier(connection.fileDescriptor());
43
        return IPC::Connection::Identifier(connection.fd().value());
44
#elif OS(DARWIN)
44
#elif OS(DARWIN)
45
        return IPC::Connection::Identifier(connection.port());
45
        return IPC::Connection::Identifier(connection.port());
46
#elif OS(WINDOWS)
46
#elif OS(WINDOWS)
Lines 54-60 struct NetworkProcessConnectionInfo { a/Source/WebKit/WebProcess/Network/NetworkProcessConnectionInfo.h_sec2
54
    IPC::Connection::Identifier releaseIdentifier()
54
    IPC::Connection::Identifier releaseIdentifier()
55
    {
55
    {
56
#if USE(UNIX_DOMAIN_SOCKETS)
56
#if USE(UNIX_DOMAIN_SOCKETS)
57
        auto returnValue = IPC::Connection::Identifier(connection.releaseFileDescriptor());
57
        auto returnValue = IPC::Connection::Identifier(connection.release().release());
58
#else
58
#else
59
        auto returnValue = identifier();
59
        auto returnValue = identifier();
60
#endif
60
#endif
- a/Source/WebKit/WebProcess/WebPage/WebPage.h -1 / +1 lines
Lines 1339-1345 public: a/Source/WebKit/WebProcess/WebPage/WebPage.h_sec1
1339
#endif
1339
#endif
1340
1340
1341
#if USE(WPE_RENDERER)
1341
#if USE(WPE_RENDERER)
1342
    int hostFileDescriptor() const { return m_hostFileDescriptor.fileDescriptor(); }
1342
    int hostFileDescriptor() const { return m_hostFileDescriptor.fd().value(); }
1343
#endif
1343
#endif
1344
1344
1345
    void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
1345
    void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers);
- a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp -2 / +2 lines
Lines 114-120 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& para a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp_sec1
114
            wpe_loader_init(parameters.implementationLibraryName.data());
114
            wpe_loader_init(parameters.implementationLibraryName.data());
115
115
116
        RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()));
116
        RELEASE_ASSERT(is<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()));
117
        downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.releaseFileDescriptor());
117
        downcast<PlatformDisplayLibWPE>(PlatformDisplay::sharedDisplay()).initialize(parameters.hostClientFileDescriptor.release().release());
118
    }
118
    }
119
#endif
119
#endif
120
120
Lines 122-128 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& para a/Source/WebKit/WebProcess/glib/WebProcessGLib.cpp_sec2
122
    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland) {
122
    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland) {
123
#if USE(WPE_RENDERER)
123
#if USE(WPE_RENDERER)
124
        if (!parameters.isServiceWorkerProcess) {
124
        if (!parameters.isServiceWorkerProcess) {
125
            auto hostClientFileDescriptor = parameters.hostClientFileDescriptor.releaseFileDescriptor();
125
            auto hostClientFileDescriptor = parameters.hostClientFileDescriptor.release().release();
126
            if (hostClientFileDescriptor != -1) {
126
            if (hostClientFileDescriptor != -1) {
127
                wpe_loader_init(parameters.implementationLibraryName.data());
127
                wpe_loader_init(parameters.implementationLibraryName.data());
128
                m_wpeDisplay = WebCore::PlatformDisplayLibWPE::create();
128
                m_wpeDisplay = WebCore::PlatformDisplayLibWPE::create();

Return to Bug 238801