Changeset 224351 in webkit


Ignore:
Timestamp:
Nov 2, 2017 1:18:31 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[WinCairo] Add IPC files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=177919

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-11-02
Reviewed by Alex Christensen.

  • Platform/IPC/Attachment.cpp:
  • Platform/IPC/Attachment.h:

(IPC::Attachment::Attachment):
(IPC::Attachment::handle):

  • Platform/IPC/Connection.h:

(IPC::Connection::identifierIsNull):
(IPC::Connection::sendWithReply):

  • Platform/IPC/win/AttachmentWin.cpp: Added.

(IPC::Attachment::encode const):
(IPC::getDuplicatedHandle):
(IPC::Attachment::decode):

  • Platform/IPC/win/ConnectionWin.cpp: Added.

(IPC::Connection::createServerAndClientIdentifiers):
(IPC::Connection::platformInitialize):
(IPC::Connection::platformInvalidate):
(IPC::Connection::readEventHandler):
(IPC::Connection::writeEventHandler):
(IPC::Connection::open):
(IPC::Connection::platformCanSendOutgoingMessages const):
(IPC::Connection::sendOutgoingMessage):
(IPC::Connection::willSendSyncMessage):
(IPC::Connection::didReceiveSyncReply):

  • PlatformWin.cmake:
Location:
trunk/Source/WebKit
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r224346 r224351  
     12017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
     2
     3        [WinCairo] Add IPC files for wincairo webkit
     4        https://bugs.webkit.org/show_bug.cgi?id=177919
     5
     6        Reviewed by Alex Christensen.
     7
     8        * Platform/IPC/Attachment.cpp:
     9        * Platform/IPC/Attachment.h:
     10        (IPC::Attachment::Attachment):
     11        (IPC::Attachment::handle):
     12        * Platform/IPC/Connection.h:
     13        (IPC::Connection::identifierIsNull):
     14        (IPC::Connection::sendWithReply):
     15        * Platform/IPC/win/AttachmentWin.cpp: Added.
     16        (IPC::Attachment::encode const):
     17        (IPC::getDuplicatedHandle):
     18        (IPC::Attachment::decode):
     19        * Platform/IPC/win/ConnectionWin.cpp: Added.
     20        (IPC::Connection::createServerAndClientIdentifiers):
     21        (IPC::Connection::platformInitialize):
     22        (IPC::Connection::platformInvalidate):
     23        (IPC::Connection::readEventHandler):
     24        (IPC::Connection::writeEventHandler):
     25        (IPC::Connection::open):
     26        (IPC::Connection::platformCanSendOutgoingMessages const):
     27        (IPC::Connection::sendOutgoingMessage):
     28        (IPC::Connection::willSendSyncMessage):
     29        (IPC::Connection::didReceiveSyncReply):
     30        * PlatformWin.cmake:
     31
    1322017-11-02  Megan Gardner  <megan_gardner@apple.com>
    233
  • trunk/Source/WebKit/Platform/IPC/Attachment.cpp

    r204668 r224351  
    5151#endif
    5252
     53#if !OS(WINDOWS)
    5354void Attachment::encode(Encoder& encoder) const
    5455{
     
    6263    return true;
    6364}
     65#endif
    6466
    6567} // namespace IPC
  • trunk/Source/WebKit/Platform/IPC/Attachment.h

    r204668 r224351  
    11/*
    22 * Copyright (C) 2010 Apple Inc. All rights reserved.
     3 * Copyright (C) 2017 Sony Interactive Entertainment Inc.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2425 */
    2526
    26 #ifndef Attachment_h
    27 #define Attachment_h
     27# pragma once
    2828
    2929#if OS(DARWIN) && !USE(UNIX_DOMAIN_SOCKETS)
     
    5959#elif OS(DARWIN)
    6060    Attachment(mach_port_name_t, mach_msg_type_name_t disposition);
     61#elif OS(WINDOWS)
     62    Attachment(HANDLE handle)
     63        : m_handle(handle)
     64    { }
    6165#endif
    6266
     
    7478    mach_port_name_t port() const { return m_port; }
    7579    mach_msg_type_name_t disposition() const { return m_disposition; }
     80#elif OS(WINDOWS)
     81    HANDLE handle() { return m_handle; }
    7682#endif
    7783
     
    8894    mach_port_name_t m_port;
    8995    mach_msg_type_name_t m_disposition;
     96#elif OS(WINDOWS)
     97    HANDLE m_handle;
    9098#endif
    9199};
    92100
    93101} // namespace IPC
    94 
    95 #endif // Attachment_h
  • trunk/Source/WebKit/Platform/IPC/Connection.h

    r219050 r224351  
    33 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
    44 * Portions Copyright (c) 2010 Motorola Mobility, Inc.  All rights reserved.
     5 * Copyright (C) 2017 Sony Interactive Entertainment Inc.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    136137    bool getAuditToken(audit_token_t&);
    137138    pid_t remoteProcessID() const;
     139#elif OS(WINDOWS)
     140    typedef HANDLE Identifier;
     141    static bool createServerAndClientIdentifiers(Identifier& serverIdentifier, Identifier& clientIdentifier);
     142    static bool identifierIsNull(Identifier identifier) { return !identifier; }
    138143#endif
    139144
     
    145150
    146151    void setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(bool);
    147     void setShouldExitOnSyncMessageSendFailure(bool shouldExitOnSyncMessageSendFailure);
     152    void setShouldExitOnSyncMessageSendFailure(bool);
    148153
    149154    // The set callback will be called on the connection work queue when the connection is closed,
     
    153158    // handling the message on the client thread first.
    154159    typedef void (*DidCloseOnConnectionWorkQueueCallback)(Connection*);
    155     void setDidCloseOnConnectionWorkQueueCallback(DidCloseOnConnectionWorkQueueCallback callback);
     160    void setDidCloseOnConnectionWorkQueueCallback(DidCloseOnConnectionWorkQueueCallback);
    156161
    157162    void addWorkQueueMessageReceiver(StringReference messageReceiverName, WorkQueue&, WorkQueueMessageReceiver*);
     
    165170
    166171    template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { });
    167     template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler);
     172    template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler);
    168173    template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { });
    169174    template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { });
    170175
    171176    bool sendMessage(std::unique_ptr<Encoder>, OptionSet<SendOption> sendOptions);
    172     void sendMessageWithReply(uint64_t requestID, std::unique_ptr<Encoder>, FunctionDispatcher& replyDispatcher, Function<void (std::unique_ptr<Decoder>)>&& replyHandler);
     177    void sendMessageWithReply(uint64_t requestID, std::unique_ptr<Encoder>, FunctionDispatcher& replyDispatcher, Function<void(std::unique_ptr<Decoder>)>&& replyHandler);
    173178    std::unique_ptr<Encoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID);
    174179    std::unique_ptr<Decoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder>, Seconds timeout, OptionSet<SendSyncOption> sendSyncOptions);
     
    195200#endif
    196201
    197     uint64_t installIncomingSyncMessageCallback(WTF::Function<void ()>&&);
     202    uint64_t installIncomingSyncMessageCallback(WTF::Function<void()>&&);
    198203    void uninstallIncomingSyncMessageCallback(uint64_t);
    199204    bool hasIncomingSyncMessage();
     
    293298
    294299    Lock m_incomingSyncMessageCallbackMutex;
    295     HashMap<uint64_t, WTF::Function<void ()>> m_incomingSyncMessageCallbacks;
     300    HashMap<uint64_t, WTF::Function<void()>> m_incomingSyncMessageCallbacks;
    296301    RefPtr<WorkQueue> m_incomingSyncMessageCallbackQueue;
    297302    uint64_t m_nextIncomingSyncMessageCallbackID { 0 };
     
    331336
    332337    OSObjectPtr<xpc_connection_t> m_xpcConnection;
     338#elif OS(WINDOWS)
     339    // Called on the connection queue.
     340    void readEventHandler();
     341    void writeEventHandler();
     342
     343    Vector<uint8_t> m_readBuffer;
     344    OVERLAPPED m_readState;
     345    std::unique_ptr<Encoder> m_pendingWriteEncoder;
     346    OVERLAPPED m_writeState;
     347    HANDLE m_connectionPipe;
    333348#endif
    334349};
     
    346361
    347362template<typename T>
    348 void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler)
     363void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void(std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler)
    349364{
    350365    uint64_t requestID = 0;
  • trunk/Source/WebKit/PlatformWin.cmake

    r223966 r224351  
    2525
    2626    Shared/curl/WebCoreArgumentCodersCurl.cpp
     27
     28    Platform/IPC/win/AttachmentWin.cpp
     29    Platform/IPC/win/ConnectionWin.cpp
    2730
    2831    StorageProcess/win/StorageProcessMainWin.cpp
Note: See TracChangeset for help on using the changeset viewer.