⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282115 in webkit


Ignore:
Timestamp:
Sep 7, 2021, 4:32:28 PM (5 years ago)
Author:
Cameron McCormack
Message:

Add an IPCMessages channel to log all IPC messages
​https://bugs.webkit.org/show_bug.cgi?id=229664
<rdar://problem/82511640>

Reviewed by Alex Christensen.

Source/WebCore:

Add a way to get the type of process we're in as a string, for
logging.

  • platform/RuntimeApplicationChecks.cpp:

(WebCore::processType):
(WebCore::processTypeDescription):

  • platform/RuntimeApplicationChecks.h:

Source/WebKit:

This adds a new IPCMessages log channel, to which all IPC message names,
arguments, and return values are logged. To avoid performance impacts
when not logging, these are only enabled in debug builds.

ValueOrDefault is used when writing out each message argument to (1)
avoid having to add operator<<(TextStream&) defintions for all
argument types right now, and (2) to alleviate the need to add such a
definition when adding new IPC messages. The string "..." is output
for types with no operator<< defined.

The remote and local process IDs are included in the log message. The
remote process ID is only readily accessible on OS(DARWIN), as we can
grab it from the XPC connection. But not all IPC::Connections are
created for XPC connections. For example, the Web -> GPU process
connection is created by the UI process on behalf of the Web process,
and the IPC::Connection::Identifier does not have an XPC service
handle in it. So for now, we omit the remote process ID. (We'd need
to thread it through messages like CreateGPUConnectionToWebProcess
to have it available.)

Since we need the IPC::Connection object for logging now, all of the
handleMessage* functions take a connection, and the messages.py code
generator is updated accordingly.

  • Platform/IPC/HandleMessage.h:

(IPC::textStreamForLogging):
(IPC::logMessageImpl):
(IPC::logMessage):
(IPC::logReply):
(IPC::handleMessage):
(IPC::handleMessageWantsConnection):
(IPC::handleMessageSynchronous):
(IPC::handleMessageSynchronousWantsConnection):
(IPC::handleMessageAsync):
(IPC::handleMessageAsyncWantsConnection):

  • Platform/Logging.h:
  • Scripts/webkit/messages.py:

(async_message_statement):
(sync_message_statement):

  • Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp:

(WebKit::TestWithCVPixelBuffer::didReceiveMessage):
(WebKit::TestWithCVPixelBuffer::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp:

(WebKit::TestWithIfMessage::didReceiveMessage):

  • Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp:

(WebKit::TestWithImageData::didReceiveMessage):
(WebKit::TestWithImageData::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp:

(WebKit::TestWithLegacyReceiver::didReceiveTestWithLegacyReceiverMessage):
(WebKit::TestWithLegacyReceiver::didReceiveSyncTestWithLegacyReceiverMessage):

  • Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp:

(WebKit::TestWithSemaphore::didReceiveMessage):
(WebKit::TestWithSemaphore::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp:

(WebKit::TestWithStreamBuffer::didReceiveMessage):

  • Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp:

(WebKit::TestWithStream::didReceiveStreamMessage):

  • Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp:

(WebKit::TestWithSuperclass::didReceiveMessage):

  • Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp:

(WebKit::TestWithoutAttributes::didReceiveMessage):
(WebKit::TestWithoutAttributes::didReceiveSyncMessage):

  • UIProcess/ProvisionalPageProxy.cpp:

(WebKit::ProvisionalPageProxy::didReceiveMessage):

Source/WTF:

Two changes to TextStream in this patch.

The first is a new argument to the constructor to allow limiting
the number of elements in a container when appending it to a
TextStream. This is intended to be used when the output is for
human consumption and could potentially be uselessly large.

The second is a value adapter ValueOrEllipsis. This allows appending
a value to a TextStream even if it doesn't have an
operator<<(TextStream&) defined. If it doesn't, then the fallback
value "..." is used instead.

An implementation detail of ValueOrEllipsis is a new type trait
supports_text_stream_insertion, which detects at compile time whether
a given type can be appended to a TextStream. It works by using
"expression SFINAE" and partial template specialization.

The base, unspecialized version of the template inherits from
std::false_type, and is selected for all types by default.

A partial specialization that uses decltype() to check whether a
TextStream() << value expression would compile inherits from
std::true_type.

Sadly, C++ SFINAE has a limitation that means template definitions
that would be instantiated inside the decltype() are not checked
to ensure they would compile. This would mean container types whose
elements are types that don't have an operator<< defined would still
report true from supports_text_stream_insertion. We work around this
by having more specific partial specializations for all of the container
types we have operator<< definitions for, which defer to the
supports_text_stream_insertion value for the element type(s).

If an operator<< is added for a new container type without a
corresponding supports_text_stream_insertion specialization, and that
type is used with ValueOrEllipsis, it will cause a compile error.

The supports_text_stream_insertion template takes six template
arguments, which looks odd, but is needed because all specializations
must have the same number (and kind) of template arguments. The six
include five type template arguments (which is how many HashMap has)
plus a size_t value template argument (for Vector's inlineCapacity
argument).

  • wtf/text/TextStream.h:

(WTF::TextStream::TextStream):
(WTF::TextStream::containerSizeLimit const):
(WTF::operator<<):
(WTF::ValueOrEllipsis::ValueOrEllipsis):

Location:
trunk/Source
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r282105 r282115  
     12021-09-07  Cameron McCormack  <heycam@apple.com>
     2
     3        Add an IPCMessages channel to log all IPC messages
     4        https://bugs.webkit.org/show_bug.cgi?id=229664
     5        <rdar://problem/82511640>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Two changes to TextStream in this patch.
     10
     11        The first is a new argument to the constructor to allow limiting
     12        the number of elements in a container when appending it to a
     13        TextStream. This is intended to be used when the output is for
     14        human consumption and could potentially be uselessly large.
     15
     16        The second is a value adapter ValueOrEllipsis. This allows appending
     17        a value to a TextStream even if it doesn't have an
     18        operator<<(TextStream&) defined. If it doesn't, then the fallback
     19        value "..." is used instead.
     20
     21        An implementation detail of ValueOrEllipsis is a new type trait
     22        supports_text_stream_insertion, which detects at compile time whether
     23        a given type can be appended to a TextStream. It works by using
     24        "expression SFINAE" and partial template specialization.
     25
     26        The base, unspecialized version of the template inherits from
     27        std::false_type, and is selected for all types by default.
     28
     29        A partial specialization that uses decltype() to check whether a
     30        `TextStream() << value` expression would compile inherits from
     31        std::true_type.
     32
     33        Sadly, C++ SFINAE has a limitation that means template definitions
     34        that would be instantiated inside the decltype() are not checked
     35        to ensure they would compile. This would mean container types whose
     36        elements are types that don't have an operator<< defined would still
     37        report true from supports_text_stream_insertion. We work around this
     38        by having more specific partial specializations for all of the container
     39        types we have operator<< definitions for, which defer to the
     40        supports_text_stream_insertion value for the element type(s).
     41
     42        If an operator<< is added for a new container type without a
     43        corresponding supports_text_stream_insertion specialization, and that
     44        type is used with ValueOrEllipsis, it will cause a compile error.
     45
     46        The supports_text_stream_insertion template takes six template
     47        arguments, which looks odd, but is needed because all specializations
     48        must have the same number (and kind) of template arguments. The six
     49        include five type template arguments (which is how many HashMap has)
     50        plus a size_t value template argument (for Vector's inlineCapacity
     51        argument).
     52
     53        * wtf/text/TextStream.h:
     54        (WTF::TextStream::TextStream):
     55        (WTF::TextStream::containerSizeLimit const):
     56        (WTF::operator<<):
     57        (WTF::ValueOrEllipsis::ValueOrEllipsis):
     58
    1592021-09-07  Chris Dumez  <cdumez@apple.com>
    260
  • trunk/Source/WTF/wtf/text/TextStream.h

    r280651 r282115  
    5454
    5555    enum class LineMode { SingleLine, MultipleLine };
    56     TextStream(LineMode lineMode = LineMode::MultipleLine, OptionSet<Formatting> formattingFlags = { })
     56    TextStream(LineMode lineMode = LineMode::MultipleLine, OptionSet<Formatting> formattingFlags = { }, unsigned containerSizeLimit = 0)
    5757        : m_formattingFlags(formattingFlags)
    5858        , m_multiLineMode(lineMode == LineMode::MultipleLine)
     59        , m_containerSizeLimit(containerSizeLimit)
    5960    {
    6061    }
    … …  
    112113
    113114    WTF_EXPORT_PRIVATE void writeIndent();
     115
     116    unsigned containerSizeLimit() const { return m_containerSizeLimit; }
    114117
    115118    // Stream manipulators.
    … …  
    175178    OptionSet<Formatting> m_formattingFlags;
    176179    bool m_multiLineMode { true };
     180    unsigned m_containerSizeLimit { 0 };
    177181};
    178182
    … …  
    224228    ts << "[";
    225229
    226     unsigned size = vector.size();
    227     for (unsigned i = 0; i < size; ++i) {
    228         ts << vector[i];
    229         if (i < size - 1)
     230    unsigned count = 0;
     231    for (const auto& value : vector) {
     232        if (count)
    230233            ts << ", ";
    231     }
     234        ts << value;
     235        if (++count == ts.containerSizeLimit())
     236            break;
     237    }
     238
     239    if (count != vector.size())
     240        ts << ", ...";
    232241
    233242    return ts << "]";
    … …  
    263272    ts << "{";
    264273
    265     bool first = true;
     274    unsigned count = 0;
    266275    for (const auto& keyValuePair : map) {
     276        if (count)
     277            ts << ", ";
    267278        ts << keyValuePair.key << ": " << keyValuePair.value;
    268         if (!first)
    269             ts << ", ";
    270         first = false;
    271     }
     279        if (++count == ts.containerSizeLimit())
     280            break;
     281    }
     282
     283    if (count != map.size())
     284        ts << ", ...";
    272285
    273286    return ts << "}";
    … …  
    279292    ts << "[";
    280293
    281     bool first = true;
     294    unsigned count = 0;
    282295    for (const auto& item : set) {
     296        if (count)
     297            ts << ", ";
    283298        ts << item;
    284         if (!first)
    285             ts << ", ";
    286         first = false;
    287     }
     299        if (++count == ts.containerSizeLimit())
     300            break;
     301    }
     302
     303    if (count != set.size())
     304        ts << ", ...";
    288305
    289306    return ts << "]";
    … …  
    304321}
    305322
     323template<typename, typename = void, typename = void, typename = void, typename = void, size_t = 0>
     324struct supports_text_stream_insertion : std::false_type { };
     325
     326template<typename T>
     327struct supports_text_stream_insertion<T, std::void_t<decltype(std::declval<TextStream&>() << std::declval<T>())>> : std::true_type { };
     328
     329template<typename ItemType, size_t inlineCapacity>
     330struct supports_text_stream_insertion<Vector<ItemType, inlineCapacity>> : supports_text_stream_insertion<ItemType> { };
     331
     332template<typename ValueArg, typename HashArg, typename TraitsArg>
     333struct supports_text_stream_insertion<HashSet<ValueArg, HashArg, TraitsArg>> : supports_text_stream_insertion<ValueArg> { };
     334
     335template<typename KeyArg, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
     336struct supports_text_stream_insertion<HashMap<KeyArg, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>> : std::conjunction<supports_text_stream_insertion<KeyArg>, supports_text_stream_insertion<MappedArg>> { };
     337
     338template<typename T, typename Traits>
     339struct supports_text_stream_insertion<Markable<T, Traits>> : supports_text_stream_insertion<T> { };
     340
     341template<typename T>
     342struct supports_text_stream_insertion<OptionSet<T>> : supports_text_stream_insertion<T> { };
     343
     344template<typename T>
     345struct supports_text_stream_insertion<std::optional<T>> : supports_text_stream_insertion<T> { };
     346
     347template<typename T>
     348struct supports_text_stream_insertion<WeakPtr<T>> : supports_text_stream_insertion<T> { };
     349
     350template<typename T>
     351struct supports_text_stream_insertion<RefPtr<T>> : supports_text_stream_insertion<T> { };
     352
     353template<typename T>
     354struct supports_text_stream_insertion<Ref<T>> : supports_text_stream_insertion<T> { };
     355
     356template<typename T>
     357struct ValueOrEllipsis {
     358    explicit ValueOrEllipsis(const T& value)
     359        : value(value)
     360    { }
     361    const T& value;
     362};
     363
     364template<typename T>
     365TextStream& operator<<(TextStream& ts, ValueOrEllipsis<T> item)
     366{
     367    if constexpr (supports_text_stream_insertion<T>::value)
     368        ts << item.value;
     369    else
     370        ts << "...";
     371    return ts;
     372}
     373
    306374// Deprecated. Use TextStream::writeIndent() instead.
    307375WTF_EXPORT_PRIVATE void writeIndent(TextStream&, int indent);
    … …  
    310378
    311379using WTF::TextStream;
     380using WTF::ValueOrEllipsis;
    312381using WTF::ValueOrNull;
    313382using WTF::indent;
  • trunk/Source/WebCore/ChangeLog

    r282105 r282115  
     12021-09-07  Cameron McCormack  <heycam@apple.com>
     2
     3        Add an IPCMessages channel to log all IPC messages
     4        https://bugs.webkit.org/show_bug.cgi?id=229664
     5        <rdar://problem/82511640>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add a way to get the type of process we're in as a string, for
     10        logging.
     11
     12        * platform/RuntimeApplicationChecks.cpp:
     13        (WebCore::processType):
     14        (WebCore::processTypeDescription):
     15        * platform/RuntimeApplicationChecks.h:
     16
    1172021-09-07  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp

    r278340 r282115  
    8484}
    8585
     86std::optional<AuxiliaryProcessType> processType()
     87{
     88    return auxiliaryProcessType();
     89}
     90
     91const char* processTypeDescription(std::optional<AuxiliaryProcessType> type)
     92{
     93    if (!type)
     94        return "UI";
     95
     96    switch (*type) {
     97    case AuxiliaryProcessType::WebContent:
     98        return "Web";
     99    case AuxiliaryProcessType::Network:
     100        return "Network";
     101    case AuxiliaryProcessType::Plugin:
     102        return "Plugin";
     103#if ENABLE(GPU_PROCESS)
     104    case AuxiliaryProcessType::GPU:
     105        return "GPU";
     106#endif
     107#if ENABLE(WEB_AUTHN)
     108    case AuxiliaryProcessType::WebAuthn:
     109        return "WebAuthn";
     110#endif
     111    }
     112    return "Unknown";
     113}
     114
    86115} // namespace WebCore
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r275405 r282115  
    2626#pragma once
    2727
     28#include <optional>
    2829#include <wtf/Forward.h>
    2930
    … …  
    4748WEBCORE_EXPORT void setAuxiliaryProcessType(AuxiliaryProcessType);
    4849WEBCORE_EXPORT bool checkAuxiliaryProcessType(AuxiliaryProcessType);
     50WEBCORE_EXPORT std::optional<AuxiliaryProcessType> processType();
     51WEBCORE_EXPORT const char* processTypeDescription(std::optional<AuxiliaryProcessType>);
    4952
    5053bool isInAuxiliaryProcess();
  • trunk/Source/WebKit/ChangeLog

    r282114 r282115  
     12021-09-07  Cameron McCormack  <heycam@apple.com>
     2
     3        Add an IPCMessages channel to log all IPC messages
     4        https://bugs.webkit.org/show_bug.cgi?id=229664
     5        <rdar://problem/82511640>
     6
     7        Reviewed by Alex Christensen.
     8
     9        This adds a new IPCMessages log channel, to which all IPC message names,
     10        arguments, and return values are logged. To avoid performance impacts
     11        when not logging, these are only enabled in debug builds.
     12
     13        ValueOrDefault is used when writing out each message argument to (1)
     14        avoid having to add operator<<(TextStream&) defintions for all
     15        argument types right now, and (2) to alleviate the need to add such a
     16        definition when adding new IPC messages. The string "..." is output
     17        for types with no operator<< defined.
     18
     19        The remote and local process IDs are included in the log message. The
     20        remote process ID is only readily accessible on OS(DARWIN), as we can
     21        grab it from the XPC connection. But not all IPC::Connections are
     22        created for XPC connections. For example, the Web -> GPU process
     23        connection is created by the UI process on behalf of the Web process,
     24        and the IPC::Connection::Identifier does not have an XPC service
     25        handle in it. So for now, we omit the remote process ID. (We'd need
     26        to thread it through messages like CreateGPUConnectionToWebProcess
     27        to have it available.)
     28
     29        Since we need the IPC::Connection object for logging now, all of the
     30        handleMessage* functions take a connection, and the messages.py code
     31        generator is updated accordingly.
     32
     33        * Platform/IPC/HandleMessage.h:
     34        (IPC::textStreamForLogging):
     35        (IPC::logMessageImpl):
     36        (IPC::logMessage):
     37        (IPC::logReply):
     38        (IPC::handleMessage):
     39        (IPC::handleMessageWantsConnection):
     40        (IPC::handleMessageSynchronous):
     41        (IPC::handleMessageSynchronousWantsConnection):
     42        (IPC::handleMessageAsync):
     43        (IPC::handleMessageAsyncWantsConnection):
     44        * Platform/Logging.h:
     45        * Scripts/webkit/messages.py:
     46        (async_message_statement):
     47        (sync_message_statement):
     48        * Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp:
     49        (WebKit::TestWithCVPixelBuffer::didReceiveMessage):
     50        (WebKit::TestWithCVPixelBuffer::didReceiveSyncMessage):
     51        * Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp:
     52        (WebKit::TestWithIfMessage::didReceiveMessage):
     53        * Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp:
     54        (WebKit::TestWithImageData::didReceiveMessage):
     55        (WebKit::TestWithImageData::didReceiveSyncMessage):
     56        * Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp:
     57        (WebKit::TestWithLegacyReceiver::didReceiveTestWithLegacyReceiverMessage):
     58        (WebKit::TestWithLegacyReceiver::didReceiveSyncTestWithLegacyReceiverMessage):
     59        * Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp:
     60        (WebKit::TestWithSemaphore::didReceiveMessage):
     61        (WebKit::TestWithSemaphore::didReceiveSyncMessage):
     62        * Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp:
     63        (WebKit::TestWithStreamBuffer::didReceiveMessage):
     64        * Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp:
     65        (WebKit::TestWithStream::didReceiveStreamMessage):
     66        * Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp:
     67        (WebKit::TestWithSuperclass::didReceiveMessage):
     68        * Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp:
     69        (WebKit::TestWithoutAttributes::didReceiveMessage):
     70        (WebKit::TestWithoutAttributes::didReceiveSyncMessage):
     71        * UIProcess/ProvisionalPageProxy.cpp:
     72        (WebKit::ProvisionalPageProxy::didReceiveMessage):
     73
    1742021-09-07  Per Arne  <pvollan@apple.com>
    275
  • trunk/Source/WebKit/Platform/IPC/HandleMessage.h

    r281737 r282115  
    2828#include "ArgumentCoders.h"
    2929#include "DataReference.h"
     30#include "Logging.h"
     31#include "MessageArgumentDescriptions.h"
     32#include "MessageNames.h"
    3033#include "StreamServerConnection.h"
     34#include <WebCore/RuntimeApplicationChecks.h>
    3135#include <wtf/CompletionHandler.h>
     36#include <wtf/ProcessID.h>
    3237#include <wtf/StdLibExtras.h>
    3338
    … …  
    3540
    3641class Connection;
     42
     43// IPC message logging. Only enabled in DEBUG builds.
     44//
     45// Message argument values appear as "..." if no operator<<(TextStream&) is
     46// implemented for them.
     47
     48constexpr unsigned loggingContainerSizeLimit = 200;
     49
     50#if !LOG_DISABLED
     51enum class ForReply : bool { No, Yes };
     52
     53inline TextStream textStreamForLogging(const Connection& connection, MessageName messageName, ForReply forReply)
     54{
     55    TextStream stream(TextStream::LineMode::SingleLine, { }, loggingContainerSizeLimit);
     56    stream << '[';
     57#if OS(DARWIN)
     58    // The remote process ID is not available when the connection was not made
     59    // for an XPC service, e.g. for the Web -> GPU process connection.
     60    if (connection.remoteProcessID())
     61        stream << connection.remoteProcessID() << ' ';
     62#else
     63    UNUSED_PARAM(connection);
     64#endif
     65    auto arrow = forReply == ForReply::Yes ? "<- " : "-> ";
     66    stream << arrow << WebCore::processTypeDescription(WebCore::processType()) << ' ' << getCurrentProcessID() << "] " << description(messageName);
     67    if (forReply == ForReply::Yes)
     68        stream << " Reply";
     69    return stream;
     70}
     71#endif
     72
     73template<typename ArgsTuple, size_t... ArgsIndex>
     74void logMessageImpl(const Connection& connection, MessageName messageName, const ArgsTuple& args, std::index_sequence<ArgsIndex...>)
     75{
     76#if !LOG_DISABLED
     77    auto stream = textStreamForLogging(connection, messageName, ForReply::No);
     78
     79    if (auto argumentDescriptions = messageArgumentDescriptions(messageName))
     80        (stream.dumpProperty((*argumentDescriptions)[ArgsIndex].name, ValueOrEllipsis(std::get<ArgsIndex>(args))), ...);
     81
     82    LOG(IPCMessages, "%s", stream.release().utf8().data());
     83#else
     84    UNUSED_PARAM(connection);
     85    UNUSED_PARAM(messageName);
     86    UNUSED_PARAM(args);
     87#endif
     88}
     89
     90template<typename ArgsTuple, typename ArgsIndices = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
     91void logMessage(const Connection& connection, MessageName messageName, const ArgsTuple& args)
     92{
     93    logMessageImpl(connection, messageName, args, ArgsIndices());
     94}
     95
     96template<typename... T>
     97void logReply(const Connection& connection, MessageName messageName, const T&... args)
     98{
     99#if !LOG_DISABLED
     100    if (!sizeof...(T))
     101        return;
     102
     103    auto stream = textStreamForLogging(connection, messageName, ForReply::Yes);
     104
     105    unsigned argIndex = 0;
     106    if (auto argumentDescriptions = messageReplyArgumentDescriptions(messageName))
     107        (stream.dumpProperty((*argumentDescriptions)[argIndex++].name, ValueOrEllipsis(args)), ...);
     108
     109    LOG(IPCMessages, "%s", stream.release().utf8().data());
     110#else
     111    UNUSED_PARAM(connection);
     112    UNUSED_PARAM(messageName);
     113    (UNUSED_PARAM(args), ...);
     114#endif
     115}
    37116
    38117// Dispatch functions with no reply arguments.
    … …  
    110189
    111190template<typename T, typename C, typename MF>
    112 void handleMessage(Decoder& decoder, C* object, MF function)
    113 {
    114     std::optional<typename CodingType<typename T::Arguments>::Type> arguments;
    115     decoder >> arguments;
    116     if (UNLIKELY(!arguments))
    117         return;
    118 
     191void handleMessage(Connection& connection, Decoder& decoder, C* object, MF function)
     192{
     193    std::optional<typename CodingType<typename T::Arguments>::Type> arguments;
     194    decoder >> arguments;
     195    if (UNLIKELY(!arguments))
     196        return;
     197
     198    logMessage(connection, T::name(), *arguments);
    119199    callMemberFunction(WTFMove(*arguments), object, function);
    120200}
    121201
    122202template<typename T, typename C, typename MF>
    123 void handleMessage(Connection& connection, Decoder& decoder, C* object, MF function)
    124 {
    125     std::optional<typename CodingType<typename T::Arguments>::Type> arguments;
    126     decoder >> arguments;
    127     if (UNLIKELY(!arguments))
    128         return;
     203void handleMessageWantsConnection(Connection& connection, Decoder& decoder, C* object, MF function)
     204{
     205    std::optional<typename CodingType<typename T::Arguments>::Type> arguments;
     206    decoder >> arguments;
     207    if (UNLIKELY(!arguments))
     208        return;
     209
     210    logMessage(connection, T::name(), *arguments);
    129211    callMemberFunction(connection, WTFMove(*arguments), object, function);
    130212}
    … …  
    139221
    140222    typename T::DelayedReply completionHandler = [replyEncoder = WTFMove(replyEncoder), connection = makeRef(connection)] (auto&&... args) mutable {
     223        logReply(connection, T::name(), args...);
    141224        T::send(WTFMove(replyEncoder), WTFMove(connection), args...);
    142225    };
     226    logMessage(connection, T::name(), *arguments);
    143227    callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function);
    144228    return true;
    … …  
    154238   
    155239    typename T::DelayedReply completionHandler = [replyEncoder = WTFMove(replyEncoder), connection = makeRef(connection)] (auto&&... args) mutable {
     240        logReply(connection, T::name(), args...);
    156241        T::send(WTFMove(replyEncoder), WTFMove(connection), args...);
    157242    };
     243    logMessage(connection, T::name(), *arguments);
    158244    callMemberFunction(connection, WTFMove(*arguments), WTFMove(completionHandler), object, function);
    159245    return true;
    … …  
    173259
    174260    typename T::DelayedReply completionHandler = [syncRequestID, connection = makeRef(connection)] (auto&&... args) mutable {
     261        logReply(connection->connection(), T::name(), args...);
    175262        connection->sendSyncReply<T>(syncRequestID, args...);
    176263    };
     264    logMessage(connection.connection(), T::name(), *arguments);
    177265    callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function);
    178266}
    … …  
    193281    typename T::AsyncReply completionHandler = { [listenerID = *listenerID, connection = makeRef(connection)] (auto&&... args) mutable {
    194282        auto encoder = makeUniqueRef<Encoder>(T::asyncMessageReplyName(), listenerID);
     283        logReply(connection, T::name(), args...);
    195284        T::send(WTFMove(encoder), WTFMove(connection), args...);
    196285    }, T::callbackThread };
     286    logMessage(connection, T::name(), *arguments);
    197287    callMemberFunction(WTFMove(*arguments), WTFMove(completionHandler), object, function);
    198288}
    … …  
    213303    typename T::AsyncReply completionHandler = { [listenerID = *listenerID, connection = makeRef(connection)] (auto&&... args) mutable {
    214304        auto encoder = makeUniqueRef<Encoder>(T::asyncMessageReplyName(), listenerID);
     305        logReply(connection, T::name(), args...);
    215306        T::send(WTFMove(encoder), WTFMove(connection), args...);
    216307    }, T::callbackThread };
     308    logMessage(connection, T::name(), *arguments);
    217309    callMemberFunction(connection, WTFMove(*arguments), WTFMove(completionHandler), object, function);
    218310}
  • trunk/Source/WebKit/Platform/Logging.h

    r280811 r282115  
    5757    M(Gamepad) \
    5858    M(IPC) \
     59    M(IPCMessages) \
    5960    M(ITPDebug) \
    6061    M(IconDatabase) \
  • trunk/Source/WebKit/Scripts/webkit/messages.py

    r282048 r282115  
    568568    if message.has_attribute(ASYNC_ATTRIBUTE):
    569569        dispatch_function += 'Async'
    570         dispatch_function_args.insert(0, 'connection')
    571570
    572571    if message.has_attribute(WANTS_CONNECTION_ATTRIBUTE):
    573         if message.has_attribute(ASYNC_ATTRIBUTE):
    574             dispatch_function += 'WantsConnection'
    575         else:
    576             dispatch_function_args.insert(0, 'connection')
     572        dispatch_function += 'WantsConnection'
     573
     574    connection = 'connection'
     575    if receiver.has_attribute(STREAM_ATTRIBUTE):
     576        connection = 'connection.connection()'
    577577
    578578    result = []
    579579    result.append('    if (decoder.messageName() == Messages::%s::%s::name())\n' % (receiver.name, message.name))
    580     result.append('        return IPC::%s<Messages::%s::%s>(%s);\n' % (dispatch_function, receiver.name, message.name, ', '.join(dispatch_function_args)))
     580    result.append('        return IPC::%s<Messages::%s::%s>(%s, %s);\n' % (dispatch_function, receiver.name, message.name, connection, ', '.join(dispatch_function_args)))
    581581    return surround_in_condition(''.join(result), message.condition)
    582582
    … …  
    586586    if message.has_attribute(SYNCHRONOUS_ATTRIBUTE):
    587587        dispatch_function += 'Synchronous'
    588         if message.has_attribute(WANTS_CONNECTION_ATTRIBUTE):
    589             dispatch_function += 'WantsConnection'
    590588    if message.has_attribute(ASYNC_ATTRIBUTE):
    591589        dispatch_function += 'Async'
    592 
    593     wants_connection = message.has_attribute(SYNCHRONOUS_ATTRIBUTE) or message.has_attribute(WANTS_CONNECTION_ATTRIBUTE)
     590    if message.has_attribute(WANTS_CONNECTION_ATTRIBUTE):
     591        dispatch_function += 'WantsConnection'
     592
    594593    maybe_reply_encoder = ", *replyEncoder"
    595594    if receiver.has_attribute(STREAM_ATTRIBUTE):
    … …  
    600599    result = []
    601600    result.append('    if (decoder.messageName() == Messages::%s::%s::name())\n' % (receiver.name, message.name))
    602     result.append('        return IPC::%s<Messages::%s::%s>(%sdecoder%s, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if wants_connection else '', maybe_reply_encoder, handler_function(receiver, message)))
     601    result.append('        return IPC::%s<Messages::%s::%s>(connection, decoder%s, this, &%s);\n' % (dispatch_function, receiver.name, message.name, maybe_reply_encoder, handler_function(receiver, message)))
    603602    return surround_in_condition(''.join(result), message.condition)
    604603
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp

    r279221 r282115  
    4343#if USE(AVFOUNDATION)
    4444    if (decoder.messageName() == Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::name())
    45         return IPC::handleMessage<Messages::TestWithCVPixelBuffer::SendCVPixelBuffer>(decoder, this, &TestWithCVPixelBuffer::sendCVPixelBuffer);
     45        return IPC::handleMessage<Messages::TestWithCVPixelBuffer::SendCVPixelBuffer>(connection, decoder, this, &TestWithCVPixelBuffer::sendCVPixelBuffer);
    4646#endif
    4747    UNUSED_PARAM(connection);
    … …  
    5959#if USE(AVFOUNDATION)
    6060    if (decoder.messageName() == Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::name())
    61         return IPC::handleMessage<Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer>(decoder, *replyEncoder, this, &TestWithCVPixelBuffer::receiveCVPixelBuffer);
     61        return IPC::handleMessage<Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer>(connection, decoder, *replyEncoder, this, &TestWithCVPixelBuffer::receiveCVPixelBuffer);
    6262#endif
    6363    UNUSED_PARAM(connection);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp

    r279221 r282115  
    4343#if PLATFORM(COCOA)
    4444    if (decoder.messageName() == Messages::TestWithIfMessage::LoadURL::name())
    45         return IPC::handleMessage<Messages::TestWithIfMessage::LoadURL>(decoder, this, &TestWithIfMessage::loadURL);
     45        return IPC::handleMessage<Messages::TestWithIfMessage::LoadURL>(connection, decoder, this, &TestWithIfMessage::loadURL);
    4646#endif
    4747#if PLATFORM(GTK)
    4848    if (decoder.messageName() == Messages::TestWithIfMessage::LoadURL::name())
    49         return IPC::handleMessage<Messages::TestWithIfMessage::LoadURL>(decoder, this, &TestWithIfMessage::loadURL);
     49        return IPC::handleMessage<Messages::TestWithIfMessage::LoadURL>(connection, decoder, this, &TestWithIfMessage::loadURL);
    5050#endif
    5151    UNUSED_PARAM(connection);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp

    r279221 r282115  
    4040    auto protectedThis = makeRef(*this);
    4141    if (decoder.messageName() == Messages::TestWithImageData::SendImageData::name())
    42         return IPC::handleMessage<Messages::TestWithImageData::SendImageData>(decoder, this, &TestWithImageData::sendImageData);
     42        return IPC::handleMessage<Messages::TestWithImageData::SendImageData>(connection, decoder, this, &TestWithImageData::sendImageData);
    4343    UNUSED_PARAM(connection);
    4444    UNUSED_PARAM(decoder);
    … …  
    5454    auto protectedThis = makeRef(*this);
    5555    if (decoder.messageName() == Messages::TestWithImageData::ReceiveImageData::name())
    56         return IPC::handleMessage<Messages::TestWithImageData::ReceiveImageData>(decoder, *replyEncoder, this, &TestWithImageData::receiveImageData);
     56        return IPC::handleMessage<Messages::TestWithImageData::ReceiveImageData>(connection, decoder, *replyEncoder, this, &TestWithImageData::receiveImageData);
    5757    UNUSED_PARAM(connection);
    5858    UNUSED_PARAM(decoder);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp

    r279221 r282115  
    8585    auto protectedThis = makeRef(*this);
    8686    if (decoder.messageName() == Messages::TestWithLegacyReceiver::LoadURL::name())
    87         return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadURL>(decoder, this, &TestWithLegacyReceiver::loadURL);
     87        return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadURL>(connection, decoder, this, &TestWithLegacyReceiver::loadURL);
    8888#if ENABLE(TOUCH_EVENTS)
    8989    if (decoder.messageName() == Messages::TestWithLegacyReceiver::LoadSomething::name())
    90         return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadSomething>(decoder, this, &TestWithLegacyReceiver::loadSomething);
     90        return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadSomething>(connection, decoder, this, &TestWithLegacyReceiver::loadSomething);
    9191#endif
    9292#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION || SOME_OTHER_MESSAGE_CONDITION))
    9393    if (decoder.messageName() == Messages::TestWithLegacyReceiver::TouchEvent::name())
    94         return IPC::handleMessage<Messages::TestWithLegacyReceiver::TouchEvent>(decoder, this, &TestWithLegacyReceiver::touchEvent);
     94        return IPC::handleMessage<Messages::TestWithLegacyReceiver::TouchEvent>(connection, decoder, this, &TestWithLegacyReceiver::touchEvent);
    9595#endif
    9696#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION && SOME_OTHER_MESSAGE_CONDITION))
    9797    if (decoder.messageName() == Messages::TestWithLegacyReceiver::AddEvent::name())
    98         return IPC::handleMessage<Messages::TestWithLegacyReceiver::AddEvent>(decoder, this, &TestWithLegacyReceiver::addEvent);
     98        return IPC::handleMessage<Messages::TestWithLegacyReceiver::AddEvent>(connection, decoder, this, &TestWithLegacyReceiver::addEvent);
    9999#endif
    100100#if ENABLE(TOUCH_EVENTS)
    101101    if (decoder.messageName() == Messages::TestWithLegacyReceiver::LoadSomethingElse::name())
    102         return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadSomethingElse>(decoder, this, &TestWithLegacyReceiver::loadSomethingElse);
     102        return IPC::handleMessage<Messages::TestWithLegacyReceiver::LoadSomethingElse>(connection, decoder, this, &TestWithLegacyReceiver::loadSomethingElse);
    103103#endif
    104104    if (decoder.messageName() == Messages::TestWithLegacyReceiver::DidReceivePolicyDecision::name())
    105         return IPC::handleMessage<Messages::TestWithLegacyReceiver::DidReceivePolicyDecision>(decoder, this, &TestWithLegacyReceiver::didReceivePolicyDecision);
     105        return IPC::handleMessage<Messages::TestWithLegacyReceiver::DidReceivePolicyDecision>(connection, decoder, this, &TestWithLegacyReceiver::didReceivePolicyDecision);
    106106    if (decoder.messageName() == Messages::TestWithLegacyReceiver::Close::name())
    107         return IPC::handleMessage<Messages::TestWithLegacyReceiver::Close>(decoder, this, &TestWithLegacyReceiver::close);
     107        return IPC::handleMessage<Messages::TestWithLegacyReceiver::Close>(connection, decoder, this, &TestWithLegacyReceiver::close);
    108108    if (decoder.messageName() == Messages::TestWithLegacyReceiver::PreferencesDidChange::name())
    109         return IPC::handleMessage<Messages::TestWithLegacyReceiver::PreferencesDidChange>(decoder, this, &TestWithLegacyReceiver::preferencesDidChange);
     109        return IPC::handleMessage<Messages::TestWithLegacyReceiver::PreferencesDidChange>(connection, decoder, this, &TestWithLegacyReceiver::preferencesDidChange);
    110110    if (decoder.messageName() == Messages::TestWithLegacyReceiver::SendDoubleAndFloat::name())
    111         return IPC::handleMessage<Messages::TestWithLegacyReceiver::SendDoubleAndFloat>(decoder, this, &TestWithLegacyReceiver::sendDoubleAndFloat);
     111        return IPC::handleMessage<Messages::TestWithLegacyReceiver::SendDoubleAndFloat>(connection, decoder, this, &TestWithLegacyReceiver::sendDoubleAndFloat);
    112112    if (decoder.messageName() == Messages::TestWithLegacyReceiver::SendInts::name())
    113         return IPC::handleMessage<Messages::TestWithLegacyReceiver::SendInts>(decoder, this, &TestWithLegacyReceiver::sendInts);
     113        return IPC::handleMessage<Messages::TestWithLegacyReceiver::SendInts>(connection, decoder, this, &TestWithLegacyReceiver::sendInts);
    114114    if (decoder.messageName() == Messages::TestWithLegacyReceiver::TestParameterAttributes::name())
    115         return IPC::handleMessage<Messages::TestWithLegacyReceiver::TestParameterAttributes>(decoder, this, &TestWithLegacyReceiver::testParameterAttributes);
     115        return IPC::handleMessage<Messages::TestWithLegacyReceiver::TestParameterAttributes>(connection, decoder, this, &TestWithLegacyReceiver::testParameterAttributes);
    116116    if (decoder.messageName() == Messages::TestWithLegacyReceiver::TemplateTest::name())
    117         return IPC::handleMessage<Messages::TestWithLegacyReceiver::TemplateTest>(decoder, this, &TestWithLegacyReceiver::templateTest);
     117        return IPC::handleMessage<Messages::TestWithLegacyReceiver::TemplateTest>(connection, decoder, this, &TestWithLegacyReceiver::templateTest);
    118118    if (decoder.messageName() == Messages::TestWithLegacyReceiver::SetVideoLayerID::name())
    119         return IPC::handleMessage<Messages::TestWithLegacyReceiver::SetVideoLayerID>(decoder, this, &TestWithLegacyReceiver::setVideoLayerID);
     119        return IPC::handleMessage<Messages::TestWithLegacyReceiver::SetVideoLayerID>(connection, decoder, this, &TestWithLegacyReceiver::setVideoLayerID);
    120120#if PLATFORM(MAC)
    121121    if (decoder.messageName() == Messages::TestWithLegacyReceiver::DidCreateWebProcessConnection::name())
    122         return IPC::handleMessage<Messages::TestWithLegacyReceiver::DidCreateWebProcessConnection>(decoder, this, &TestWithLegacyReceiver::didCreateWebProcessConnection);
     122        return IPC::handleMessage<Messages::TestWithLegacyReceiver::DidCreateWebProcessConnection>(connection, decoder, this, &TestWithLegacyReceiver::didCreateWebProcessConnection);
    123123#endif
    124124#if ENABLE(DEPRECATED_FEATURE)
    125125    if (decoder.messageName() == Messages::TestWithLegacyReceiver::DeprecatedOperation::name())
    126         return IPC::handleMessage<Messages::TestWithLegacyReceiver::DeprecatedOperation>(decoder, this, &TestWithLegacyReceiver::deprecatedOperation);
     126        return IPC::handleMessage<Messages::TestWithLegacyReceiver::DeprecatedOperation>(connection, decoder, this, &TestWithLegacyReceiver::deprecatedOperation);
    127127#endif
    128128#if ENABLE(EXPERIMENTAL_FEATURE)
    129129    if (decoder.messageName() == Messages::TestWithLegacyReceiver::ExperimentalOperation::name())
    130         return IPC::handleMessage<Messages::TestWithLegacyReceiver::ExperimentalOperation>(decoder, this, &TestWithLegacyReceiver::experimentalOperation);
     130        return IPC::handleMessage<Messages::TestWithLegacyReceiver::ExperimentalOperation>(connection, decoder, this, &TestWithLegacyReceiver::experimentalOperation);
    131131#endif
    132132    UNUSED_PARAM(connection);
    … …  
    143143    auto protectedThis = makeRef(*this);
    144144    if (decoder.messageName() == Messages::TestWithLegacyReceiver::CreatePlugin::name())
    145         return IPC::handleMessage<Messages::TestWithLegacyReceiver::CreatePlugin>(decoder, *replyEncoder, this, &TestWithLegacyReceiver::createPlugin);
     145        return IPC::handleMessage<Messages::TestWithLegacyReceiver::CreatePlugin>(connection, decoder, *replyEncoder, this, &TestWithLegacyReceiver::createPlugin);
    146146    if (decoder.messageName() == Messages::TestWithLegacyReceiver::RunJavaScriptAlert::name())
    147         return IPC::handleMessage<Messages::TestWithLegacyReceiver::RunJavaScriptAlert>(decoder, *replyEncoder, this, &TestWithLegacyReceiver::runJavaScriptAlert);
     147        return IPC::handleMessage<Messages::TestWithLegacyReceiver::RunJavaScriptAlert>(connection, decoder, *replyEncoder, this, &TestWithLegacyReceiver::runJavaScriptAlert);
    148148    if (decoder.messageName() == Messages::TestWithLegacyReceiver::GetPlugins::name())
    149         return IPC::handleMessage<Messages::TestWithLegacyReceiver::GetPlugins>(decoder, *replyEncoder, this, &TestWithLegacyReceiver::getPlugins);
     149        return IPC::handleMessage<Messages::TestWithLegacyReceiver::GetPlugins>(connection, decoder, *replyEncoder, this, &TestWithLegacyReceiver::getPlugins);
    150150    if (decoder.messageName() == Messages::TestWithLegacyReceiver::GetPluginProcessConnection::name())
    151151        return IPC::handleMessageSynchronous<Messages::TestWithLegacyReceiver::GetPluginProcessConnection>(connection, decoder, replyEncoder, this, &TestWithLegacyReceiver::getPluginProcessConnection);
    … …  
    154154#if PLATFORM(MAC)
    155155    if (decoder.messageName() == Messages::TestWithLegacyReceiver::InterpretKeyEvent::name())
    156         return IPC::handleMessage<Messages::TestWithLegacyReceiver::InterpretKeyEvent>(decoder, *replyEncoder, this, &TestWithLegacyReceiver::interpretKeyEvent);
     156        return IPC::handleMessage<Messages::TestWithLegacyReceiver::InterpretKeyEvent>(connection, decoder, *replyEncoder, this, &TestWithLegacyReceiver::interpretKeyEvent);
    157157#endif
    158158    UNUSED_PARAM(connection);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp

    r279221 r282115  
    3737    auto protectedThis = makeRef(*this);
    3838    if (decoder.messageName() == Messages::TestWithSemaphore::SendSemaphore::name())
    39         return IPC::handleMessage<Messages::TestWithSemaphore::SendSemaphore>(decoder, this, &TestWithSemaphore::sendSemaphore);
     39        return IPC::handleMessage<Messages::TestWithSemaphore::SendSemaphore>(connection, decoder, this, &TestWithSemaphore::sendSemaphore);
    4040    UNUSED_PARAM(connection);
    4141    UNUSED_PARAM(decoder);
    … …  
    5151    auto protectedThis = makeRef(*this);
    5252    if (decoder.messageName() == Messages::TestWithSemaphore::ReceiveSemaphore::name())
    53         return IPC::handleMessage<Messages::TestWithSemaphore::ReceiveSemaphore>(decoder, *replyEncoder, this, &TestWithSemaphore::receiveSemaphore);
     53        return IPC::handleMessage<Messages::TestWithSemaphore::ReceiveSemaphore>(connection, decoder, *replyEncoder, this, &TestWithSemaphore::receiveSemaphore);
    5454    UNUSED_PARAM(connection);
    5555    UNUSED_PARAM(decoder);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp

    r279221 r282115  
    3737    auto protectedThis = makeRef(*this);
    3838    if (decoder.messageName() == Messages::TestWithStreamBuffer::SendStreamBuffer::name())
    39         return IPC::handleMessage<Messages::TestWithStreamBuffer::SendStreamBuffer>(decoder, this, &TestWithStreamBuffer::sendStreamBuffer);
     39        return IPC::handleMessage<Messages::TestWithStreamBuffer::SendStreamBuffer>(connection, decoder, this, &TestWithStreamBuffer::sendStreamBuffer);
    4040    UNUSED_PARAM(connection);
    4141    UNUSED_PARAM(decoder);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp

    r279221 r282115  
    4040{
    4141    if (decoder.messageName() == Messages::TestWithStream::SendString::name())
    42         return IPC::handleMessage<Messages::TestWithStream::SendString>(decoder, this, &TestWithStream::sendString);
     42        return IPC::handleMessage<Messages::TestWithStream::SendString>(connection.connection(), decoder, this, &TestWithStream::sendString);
    4343#if PLATFORM(COCOA)
    4444    if (decoder.messageName() == Messages::TestWithStream::SendMachSendRight::name())
    45         return IPC::handleMessage<Messages::TestWithStream::SendMachSendRight>(decoder, this, &TestWithStream::sendMachSendRight);
     45        return IPC::handleMessage<Messages::TestWithStream::SendMachSendRight>(connection.connection(), decoder, this, &TestWithStream::sendMachSendRight);
    4646#endif
    4747    if (decoder.messageName() == Messages::TestWithStream::SendStringSynchronized::name())
    48         return IPC::handleMessage<Messages::TestWithStream::SendStringSynchronized>(decoder, this, &TestWithStream::sendStringSynchronized);
     48        return IPC::handleMessage<Messages::TestWithStream::SendStringSynchronized>(connection, decoder, this, &TestWithStream::sendStringSynchronized);
    4949#if PLATFORM(COCOA)
    5050    if (decoder.messageName() == Messages::TestWithStream::ReceiveMachSendRight::name())
    51         return IPC::handleMessage<Messages::TestWithStream::ReceiveMachSendRight>(decoder, this, &TestWithStream::receiveMachSendRight);
     51        return IPC::handleMessage<Messages::TestWithStream::ReceiveMachSendRight>(connection, decoder, this, &TestWithStream::receiveMachSendRight);
    5252#endif
    5353#if PLATFORM(COCOA)
    5454    if (decoder.messageName() == Messages::TestWithStream::SendAndReceiveMachSendRight::name())
    55         return IPC::handleMessage<Messages::TestWithStream::SendAndReceiveMachSendRight>(decoder, this, &TestWithStream::sendAndReceiveMachSendRight);
     55        return IPC::handleMessage<Messages::TestWithStream::SendAndReceiveMachSendRight>(connection, decoder, this, &TestWithStream::sendAndReceiveMachSendRight);
    5656#endif
    5757    UNUSED_PARAM(decoder);
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessageReceiver.cpp

    r279221 r282115  
    171171    auto protectedThis = makeRef(*this);
    172172    if (decoder.messageName() == Messages::TestWithSuperclass::LoadURL::name())
    173         return IPC::handleMessage<Messages::TestWithSuperclass::LoadURL>(decoder, this, &TestWithSuperclass::loadURL);
     173        return IPC::handleMessage<Messages::TestWithSuperclass::LoadURL>(connection, decoder, this, &TestWithSuperclass::loadURL);
    174174#if ENABLE(TEST_FEATURE)
    175175    if (decoder.messageName() == Messages::TestWithSuperclass::TestAsyncMessage::name())
  • trunk/Source/WebKit/Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp

    r279221 r282115  
    8585    auto protectedThis = makeRef(*this);
    8686    if (decoder.messageName() == Messages::TestWithoutAttributes::LoadURL::name())
    87         return IPC::handleMessage<Messages::TestWithoutAttributes::LoadURL>(decoder, this, &TestWithoutAttributes::loadURL);
     87        return IPC::handleMessage<Messages::TestWithoutAttributes::LoadURL>(connection, decoder, this, &TestWithoutAttributes::loadURL);
    8888#if ENABLE(TOUCH_EVENTS)
    8989    if (decoder.messageName() == Messages::TestWithoutAttributes::LoadSomething::name())
    90         return IPC::handleMessage<Messages::TestWithoutAttributes::LoadSomething>(decoder, this, &TestWithoutAttributes::loadSomething);
     90        return IPC::handleMessage<Messages::TestWithoutAttributes::LoadSomething>(connection, decoder, this, &TestWithoutAttributes::loadSomething);
    9191#endif
    9292#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION || SOME_OTHER_MESSAGE_CONDITION))
    9393    if (decoder.messageName() == Messages::TestWithoutAttributes::TouchEvent::name())
    94         return IPC::handleMessage<Messages::TestWithoutAttributes::TouchEvent>(decoder, this, &TestWithoutAttributes::touchEvent);
     94        return IPC::handleMessage<Messages::TestWithoutAttributes::TouchEvent>(connection, decoder, this, &TestWithoutAttributes::touchEvent);
    9595#endif
    9696#if (ENABLE(TOUCH_EVENTS) && (NESTED_MESSAGE_CONDITION && SOME_OTHER_MESSAGE_CONDITION))
    9797    if (decoder.messageName() == Messages::TestWithoutAttributes::AddEvent::name())
    98         return IPC::handleMessage<Messages::TestWithoutAttributes::AddEvent>(decoder, this, &TestWithoutAttributes::addEvent);
     98        return IPC::handleMessage<Messages::TestWithoutAttributes::AddEvent>(connection, decoder, this, &TestWithoutAttributes::addEvent);
    9999#endif
    100100#if ENABLE(TOUCH_EVENTS)
    101101    if (decoder.messageName() == Messages::TestWithoutAttributes::LoadSomethingElse::name())
    102         return IPC::handleMessage<Messages::TestWithoutAttributes::LoadSomethingElse>(decoder, this, &TestWithoutAttributes::loadSomethingElse);
     102        return IPC::handleMessage<Messages::TestWithoutAttributes::LoadSomethingElse>(connection, decoder, this, &TestWithoutAttributes::loadSomethingElse);
    103103#endif
    104104    if (decoder.messageName() == Messages::TestWithoutAttributes::DidReceivePolicyDecision::name())
    105         return IPC::handleMessage<Messages::TestWithoutAttributes::DidReceivePolicyDecision>(decoder, this, &TestWithoutAttributes::didReceivePolicyDecision);
     105        return IPC::handleMessage<Messages::TestWithoutAttributes::DidReceivePolicyDecision>(connection, decoder, this, &TestWithoutAttributes::didReceivePolicyDecision);
    106106    if (decoder.messageName() == Messages::TestWithoutAttributes::Close::name())
    107         return IPC::handleMessage<Messages::TestWithoutAttributes::Close>(decoder, this, &TestWithoutAttributes::close);
     107        return IPC::handleMessage<Messages::TestWithoutAttributes::Close>(connection, decoder, this, &TestWithoutAttributes::close);
    108108    if (decoder.messageName() == Messages::TestWithoutAttributes::PreferencesDidChange::name())
    109         return IPC::handleMessage<Messages::TestWithoutAttributes::PreferencesDidChange>(decoder, this, &TestWithoutAttributes::preferencesDidChange);
     109        return IPC::handleMessage<Messages::TestWithoutAttributes::PreferencesDidChange>(connection, decoder, this, &TestWithoutAttributes::preferencesDidChange);
    110110    if (decoder.messageName() == Messages::TestWithoutAttributes::SendDoubleAndFloat::name())
    111         return IPC::handleMessage<Messages::TestWithoutAttributes::SendDoubleAndFloat>(decoder, this, &TestWithoutAttributes::sendDoubleAndFloat);
     111        return IPC::handleMessage<Messages::TestWithoutAttributes::SendDoubleAndFloat>(connection, decoder, this, &TestWithoutAttributes::sendDoubleAndFloat);
    112112    if (decoder.messageName() == Messages::TestWithoutAttributes::SendInts::name())
    113         return IPC::handleMessage<Messages::TestWithoutAttributes::SendInts>(decoder, this, &TestWithoutAttributes::sendInts);
     113        return IPC::handleMessage<Messages::TestWithoutAttributes::SendInts>(connection, decoder, this, &TestWithoutAttributes::sendInts);
    114114    if (decoder.messageName() == Messages::TestWithoutAttributes::TestParameterAttributes::name())
    115         return IPC::handleMessage<Messages::TestWithoutAttributes::TestParameterAttributes>(decoder, this, &TestWithoutAttributes::testParameterAttributes);
     115        return IPC::handleMessage<Messages::TestWithoutAttributes::TestParameterAttributes>(connection, decoder, this, &TestWithoutAttributes::testParameterAttributes);
    116116    if (decoder.messageName() == Messages::TestWithoutAttributes::TemplateTest::name())
    117         return IPC::handleMessage<Messages::TestWithoutAttributes::TemplateTest>(decoder, this, &TestWithoutAttributes::templateTest);
     117        return IPC::handleMessage<Messages::TestWithoutAttributes::TemplateTest>(connection, decoder, this, &TestWithoutAttributes::templateTest);
    118118    if (decoder.messageName() == Messages::TestWithoutAttributes::SetVideoLayerID::name())
    119         return IPC::handleMessage<Messages::TestWithoutAttributes::SetVideoLayerID>(decoder, this, &TestWithoutAttributes::setVideoLayerID);
     119        return IPC::handleMessage<Messages::TestWithoutAttributes::SetVideoLayerID>(connection, decoder, this, &TestWithoutAttributes::setVideoLayerID);
    120120#if PLATFORM(MAC)
    121121    if (decoder.messageName() == Messages::TestWithoutAttributes::DidCreateWebProcessConnection::name())
    122         return IPC::handleMessage<Messages::TestWithoutAttributes::DidCreateWebProcessConnection>(decoder, this, &TestWithoutAttributes::didCreateWebProcessConnection);
     122        return IPC::handleMessage<Messages::TestWithoutAttributes::DidCreateWebProcessConnection>(connection, decoder, this, &TestWithoutAttributes::didCreateWebProcessConnection);
    123123#endif
    124124#if ENABLE(DEPRECATED_FEATURE)
    125125    if (decoder.messageName() == Messages::TestWithoutAttributes::DeprecatedOperation::name())
    126         return IPC::handleMessage<Messages::TestWithoutAttributes::DeprecatedOperation>(decoder, this, &TestWithoutAttributes::deprecatedOperation);
     126        return IPC::handleMessage<Messages::TestWithoutAttributes::DeprecatedOperation>(connection, decoder, this, &TestWithoutAttributes::deprecatedOperation);
    127127#endif
    128128#if ENABLE(EXPERIMENTAL_FEATURE)
    129129    if (decoder.messageName() == Messages::TestWithoutAttributes::ExperimentalOperation::name())
    130         return IPC::handleMessage<Messages::TestWithoutAttributes::ExperimentalOperation>(decoder, this, &TestWithoutAttributes::experimentalOperation);
     130        return IPC::handleMessage<Messages::TestWithoutAttributes::ExperimentalOperation>(connection, decoder, this, &TestWithoutAttributes::experimentalOperation);
    131131#endif
    132132    UNUSED_PARAM(connection);
    … …  
    143143    auto protectedThis = makeRef(*this);
    144144    if (decoder.messageName() == Messages::TestWithoutAttributes::CreatePlugin::name())
    145         return IPC::handleMessage<Messages::TestWithoutAttributes::CreatePlugin>(decoder, *replyEncoder, this, &TestWithoutAttributes::createPlugin);
     145        return IPC::handleMessage<Messages::TestWithoutAttributes::CreatePlugin>(connection, decoder, *replyEncoder, this, &TestWithoutAttributes::createPlugin);
    146146    if (decoder.messageName() == Messages::TestWithoutAttributes::RunJavaScriptAlert::name())
    147         return IPC::handleMessage<Messages::TestWithoutAttributes::RunJavaScriptAlert>(decoder, *replyEncoder, this, &TestWithoutAttributes::runJavaScriptAlert);
     147        return IPC::handleMessage<Messages::TestWithoutAttributes::RunJavaScriptAlert>(connection, decoder, *replyEncoder, this, &TestWithoutAttributes::runJavaScriptAlert);
    148148    if (decoder.messageName() == Messages::TestWithoutAttributes::GetPlugins::name())
    149         return IPC::handleMessage<Messages::TestWithoutAttributes::GetPlugins>(decoder, *replyEncoder, this, &TestWithoutAttributes::getPlugins);
     149        return IPC::handleMessage<Messages::TestWithoutAttributes::GetPlugins>(connection, decoder, *replyEncoder, this, &TestWithoutAttributes::getPlugins);
    150150    if (decoder.messageName() == Messages::TestWithoutAttributes::GetPluginProcessConnection::name())
    151151        return IPC::handleMessageSynchronous<Messages::TestWithoutAttributes::GetPluginProcessConnection>(connection, decoder, replyEncoder, this, &TestWithoutAttributes::getPluginProcessConnection);
    … …  
    154154#if PLATFORM(MAC)
    155155    if (decoder.messageName() == Messages::TestWithoutAttributes::InterpretKeyEvent::name())
    156         return IPC::handleMessage<Messages::TestWithoutAttributes::InterpretKeyEvent>(decoder, *replyEncoder, this, &TestWithoutAttributes::interpretKeyEvent);
     156        return IPC::handleMessage<Messages::TestWithoutAttributes::InterpretKeyEvent>(connection, decoder, *replyEncoder, this, &TestWithoutAttributes::interpretKeyEvent);
    157157#endif
    158158    UNUSED_PARAM(connection);
  • trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp

    r281964 r282115  
    483483#if PLATFORM(COCOA)
    484484    if (decoder.messageName() == Messages::WebPageProxy::RegisterWebProcessAccessibilityToken::name()) {
    485         IPC::handleMessage<Messages::WebPageProxy::RegisterWebProcessAccessibilityToken>(decoder, this, &ProvisionalPageProxy::registerWebProcessAccessibilityToken);
     485        IPC::handleMessage<Messages::WebPageProxy::RegisterWebProcessAccessibilityToken>(connection, decoder, this, &ProvisionalPageProxy::registerWebProcessAccessibilityToken);
    486486        return;
    487487    }
    … …  
    490490#if PLATFORM(GTK) || PLATFORM(WPE)
    491491    if (decoder.messageName() == Messages::WebPageProxy::BindAccessibilityTree::name()) {
    492         IPC::handleMessage<Messages::WebPageProxy::BindAccessibilityTree>(decoder, this, &ProvisionalPageProxy::bindAccessibilityTree);
     492        IPC::handleMessage<Messages::WebPageProxy::BindAccessibilityTree>(connection, decoder, this, &ProvisionalPageProxy::bindAccessibilityTree);
    493493        return;
    494494    }
    … …  
    496496
    497497    if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess::name()) {
    498         IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageFromWebProcess);
     498        IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageFromWebProcess>(connection, decoder, this, &ProvisionalPageProxy::logDiagnosticMessageFromWebProcess);
    499499        return;
    500500    }
    501501
    502502    if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess::name()) {
    503         IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess);
     503        IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacyFromWebProcess>(connection, decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess);
    504504        return;
    505505    }
    506506
    507507    if (decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess::name()) {
    508         IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess>(decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess);
     508        IPC::handleMessage<Messages::WebPageProxy::LogDiagnosticMessageWithValueDictionaryFromWebProcess>(connection, decoder, this, &ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess);
    509509        return;
    510510    }
    511511
    512512    if (decoder.messageName() == Messages::WebPageProxy::StartURLSchemeTask::name()) {
    513         IPC::handleMessage<Messages::WebPageProxy::StartURLSchemeTask>(decoder, this, &ProvisionalPageProxy::startURLSchemeTask);
     513        IPC::handleMessage<Messages::WebPageProxy::StartURLSchemeTask>(connection, decoder, this, &ProvisionalPageProxy::startURLSchemeTask);
    514514        return;
    515515    }
    516516
    517517    if (decoder.messageName() == Messages::WebPageProxy::DecidePolicyForNavigationActionAsync::name()) {
    518         IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForNavigationActionAsync>(decoder, this, &ProvisionalPageProxy::decidePolicyForNavigationActionAsync);
     518        IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForNavigationActionAsync>(connection, decoder, this, &ProvisionalPageProxy::decidePolicyForNavigationActionAsync);
    519519        return;
    520520    }
    521521
    522522    if (decoder.messageName() == Messages::WebPageProxy::DecidePolicyForResponse::name()) {
    523         IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForResponse>(decoder, this, &ProvisionalPageProxy::decidePolicyForResponse);
     523        IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForResponse>(connection, decoder, this, &ProvisionalPageProxy::decidePolicyForResponse);
    524524        return;
    525525    }
    526526
    527527    if (decoder.messageName() == Messages::WebPageProxy::DidChangeProvisionalURLForFrame::name()) {
    528         IPC::handleMessage<Messages::WebPageProxy::DidChangeProvisionalURLForFrame>(decoder, this, &ProvisionalPageProxy::didChangeProvisionalURLForFrame);
     528        IPC::handleMessage<Messages::WebPageProxy::DidChangeProvisionalURLForFrame>(connection, decoder, this, &ProvisionalPageProxy::didChangeProvisionalURLForFrame);
    529529        return;
    530530    }
    531531
    532532    if (decoder.messageName() == Messages::WebPageProxy::DidNavigateWithNavigationData::name()) {
    533         IPC::handleMessage<Messages::WebPageProxy::DidNavigateWithNavigationData>(decoder, this, &ProvisionalPageProxy::didNavigateWithNavigationData);
     533        IPC::handleMessage<Messages::WebPageProxy::DidNavigateWithNavigationData>(connection, decoder, this, &ProvisionalPageProxy::didNavigateWithNavigationData);
    534534        return;
    535535    }
    536536
    537537    if (decoder.messageName() == Messages::WebPageProxy::DidPerformClientRedirect::name()) {
    538         IPC::handleMessage<Messages::WebPageProxy::DidPerformClientRedirect>(decoder, this, &ProvisionalPageProxy::didPerformClientRedirect);
     538        IPC::handleMessage<Messages::WebPageProxy::DidPerformClientRedirect>(connection, decoder, this, &ProvisionalPageProxy::didPerformClientRedirect);
    539539        return;
    540540    }
    541541
    542542    if (decoder.messageName() == Messages::WebPageProxy::DidCreateMainFrame::name()) {
    543         IPC::handleMessage<Messages::WebPageProxy::DidCreateMainFrame>(decoder, this, &ProvisionalPageProxy::didCreateMainFrame);
     543        IPC::handleMessage<Messages::WebPageProxy::DidCreateMainFrame>(connection, decoder, this, &ProvisionalPageProxy::didCreateMainFrame);
    544544        return;
    545545    }
    546546
    547547    if (decoder.messageName() == Messages::WebPageProxy::DidStartProvisionalLoadForFrame::name()) {
    548         IPC::handleMessage<Messages::WebPageProxy::DidStartProvisionalLoadForFrame>(decoder, this, &ProvisionalPageProxy::didStartProvisionalLoadForFrame);
     548        IPC::handleMessage<Messages::WebPageProxy::DidStartProvisionalLoadForFrame>(connection, decoder, this, &ProvisionalPageProxy::didStartProvisionalLoadForFrame);
    549549        return;
    550550    }
    551551
    552552    if (decoder.messageName() == Messages::WebPageProxy::DidFailProvisionalLoadForFrame::name()) {
    553         IPC::handleMessage<Messages::WebPageProxy::DidFailProvisionalLoadForFrame>(decoder, this, &ProvisionalPageProxy::didFailProvisionalLoadForFrame);
     553        IPC::handleMessage<Messages::WebPageProxy::DidFailProvisionalLoadForFrame>(connection, decoder, this, &ProvisionalPageProxy::didFailProvisionalLoadForFrame);
    554554        return;
    555555    }
    556556
    557557    if (decoder.messageName() == Messages::WebPageProxy::DidCommitLoadForFrame::name()) {
    558         IPC::handleMessage<Messages::WebPageProxy::DidCommitLoadForFrame>(decoder, this, &ProvisionalPageProxy::didCommitLoadForFrame);
     558        IPC::handleMessage<Messages::WebPageProxy::DidCommitLoadForFrame>(connection, decoder, this, &ProvisionalPageProxy::didCommitLoadForFrame);
    559559        return;
    560560    }
    561561
    562562    if (decoder.messageName() == Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame::name()) {
    563         IPC::handleMessage<Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame>(decoder, this, &ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame);
     563        IPC::handleMessage<Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame>(connection, decoder, this, &ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame);
    564564        return;
    565565    }
    566566
    567567    if (decoder.messageName() == Messages::WebPageProxy::DidPerformServerRedirect::name()) {
    568         IPC::handleMessage<Messages::WebPageProxy::DidPerformServerRedirect>(decoder, this, &ProvisionalPageProxy::didPerformServerRedirect);
     568        IPC::handleMessage<Messages::WebPageProxy::DidPerformServerRedirect>(connection, decoder, this, &ProvisionalPageProxy::didPerformServerRedirect);
    569569        return;
    570570    }
    … …  
    579579#if ENABLE(CONTENT_FILTERING)
    580580    if (decoder.messageName() == Messages::WebPageProxy::ContentFilterDidBlockLoadForFrame::name()) {
    581         IPC::handleMessage<Messages::WebPageProxy::ContentFilterDidBlockLoadForFrame>(decoder, this, &ProvisionalPageProxy::contentFilterDidBlockLoadForFrame);
     581        IPC::handleMessage<Messages::WebPageProxy::ContentFilterDidBlockLoadForFrame>(connection, decoder, this, &ProvisionalPageProxy::contentFilterDidBlockLoadForFrame);
    582582        return;
    583583    }
    … …  
    586586#if HAVE(VISIBILITY_PROPAGATION_VIEW)
    587587    if (decoder.messageName() == Messages::WebPageProxy::DidCreateContextInWebProcessForVisibilityPropagation::name()) {
    588         IPC::handleMessage<Messages::WebPageProxy::DidCreateContextInWebProcessForVisibilityPropagation>(decoder, this, &ProvisionalPageProxy::didCreateContextInWebProcessForVisibilityPropagation);
     588        IPC::handleMessage<Messages::WebPageProxy::DidCreateContextInWebProcessForVisibilityPropagation>(connection, decoder, this, &ProvisionalPageProxy::didCreateContextInWebProcessForVisibilityPropagation);
    589589        return;
    590590    }
Note: See TracChangeset for help on using the changeset viewer.