Changeset 86812 in webkit


Ignore:
Timestamp:
May 18, 2011 6:36:41 PM (13 years ago)
Author:
Darin Adler
Message:

2011-05-18 Darin Adler <Darin Adler>

Reviewed by Anders Carlsson.

[WebKit2] handleMessageDelayed leaks replyEncoder if decoding fails
https://bugs.webkit.org/show_bug.cgi?id=60872

Eliminate the concept of SyncReplyMode and instead hand around ownership
of the reply decoder using an OwnPtr.

  • Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::dispatchSyncMessage): Eliminated comments that say the same things the code itself does. Removed code that handles the reply mode. Instead, pass the OwnPtr to the message handling function and make the call to sendSyncReply conditional on whether the reply encoder is still non-null.
  • Platform/CoreIPC/Connection.h: Removed SyncReplyMode. Made didReceiveSyncMessage return void, and take OwnPtr<ArgumentEncoder>& for the reply encoder.
  • Platform/CoreIPC/HandleMessage.h: (CoreIPC::handleMessageDelayed): Take an OwnPtr&. Replaced the call to adoptPtr with a call to release.
  • PluginProcess/PluginControllerProxy.h: Updated to take an OwnPtr& and not return SyncReplyMode.
  • PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::didReceiveSyncMessage): Ditto.
  • PluginProcess/WebProcessConnection.h: Ditto.
  • Scripts/webkit2/messages.py: Updated for changes to sync messages. Eliminated unneeded return types and use get() when apporopriate to call the handleMessage functions.
  • Scripts/webkit2/messages_unittest.py: Tried to update this too. I don't know how to run the test, though.
  • Shared/Plugins/NPObjectMessageReceiver.h: Updated to take an OwnPtr& and not return SyncReplyMode.
  • Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::didReceiveSyncMessage): Ditto.
  • Shared/Plugins/NPRemoteObjectMap.h: Ditto.
  • UIProcess/Downloads/DownloadProxy.h: Ditto.
  • UIProcess/WebContext.cpp: (WebKit::WebContext::didReceiveSyncMessage): Ditto.
  • UIProcess/WebContext.h: Ditto.
  • UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::didReceiveSyncMessage): Ditto.
  • UIProcess/WebFullScreenManagerProxy.h: Ditto.
  • UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::didReceiveSyncMessage): Ditto.
  • UIProcess/WebIconDatabase.h: Ditto.
  • UIProcess/WebInspectorProxy.h: Ditto.
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
  • UIProcess/WebPageProxy.h: Ditto.
  • UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didReceiveSyncMessage): Ditto.
  • UIProcess/WebProcessProxy.h: Ditto.
  • WebProcess/Plugins/Netscape/JSNPObject.cpp: Added a missing include.
  • WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::PluginProcessConnection::didReceiveSyncMessage): Updated to take an OwnPtr& and not return SyncReplyMode.
  • WebProcess/Plugins/PluginProcessConnection.h: Ditto.
  • WebProcess/Plugins/PluginProxy.h: Ditto.
  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceiveSyncMessage): Ditto.
  • WebProcess/WebPage/WebPage.h: Ditto.
  • WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveSyncMessage): Ditto.
  • WebProcess/WebProcess.h: Ditto.
Location:
trunk/Source/WebKit2
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r86806 r86812  
     12011-05-18  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        [WebKit2] handleMessageDelayed leaks replyEncoder if decoding fails
     6        https://bugs.webkit.org/show_bug.cgi?id=60872
     7
     8        Eliminate the concept of SyncReplyMode and instead hand around ownership
     9        of the reply decoder using an OwnPtr.
     10
     11        * Platform/CoreIPC/Connection.cpp:
     12        (CoreIPC::Connection::dispatchSyncMessage): Eliminated comments that say
     13        the same things the code itself does. Removed code that handles the
     14        reply mode. Instead, pass the OwnPtr to the message handling function and
     15        make the call to sendSyncReply conditional on whether the reply encoder
     16        is still non-null.
     17
     18        * Platform/CoreIPC/Connection.h: Removed SyncReplyMode. Made
     19        didReceiveSyncMessage return void, and take OwnPtr<ArgumentEncoder>& for
     20        the reply encoder.
     21
     22        * Platform/CoreIPC/HandleMessage.h:
     23        (CoreIPC::handleMessageDelayed): Take an OwnPtr&. Replaced the call to
     24        adoptPtr with a call to release.
     25
     26        * PluginProcess/PluginControllerProxy.h: Updated to take an OwnPtr& and
     27        not return SyncReplyMode.
     28        * PluginProcess/WebProcessConnection.cpp:
     29        (WebKit::WebProcessConnection::didReceiveSyncMessage): Ditto.
     30        * PluginProcess/WebProcessConnection.h: Ditto.
     31
     32        * Scripts/webkit2/messages.py: Updated for changes to sync messages.
     33        Eliminated unneeded return types and use get() when apporopriate to call
     34        the handleMessage functions.
     35
     36        * Scripts/webkit2/messages_unittest.py: Tried to update this too.
     37        I don't know how to run the test, though.
     38
     39        * Shared/Plugins/NPObjectMessageReceiver.h: Updated to take an OwnPtr& and
     40        not return SyncReplyMode.
     41        * Shared/Plugins/NPRemoteObjectMap.cpp:
     42        (WebKit::NPRemoteObjectMap::didReceiveSyncMessage): Ditto.
     43        * Shared/Plugins/NPRemoteObjectMap.h: Ditto.
     44        * UIProcess/Downloads/DownloadProxy.h: Ditto.
     45        * UIProcess/WebContext.cpp:
     46        (WebKit::WebContext::didReceiveSyncMessage): Ditto.
     47        * UIProcess/WebContext.h: Ditto.
     48        * UIProcess/WebFullScreenManagerProxy.cpp:
     49        (WebKit::WebFullScreenManagerProxy::didReceiveSyncMessage): Ditto.
     50        * UIProcess/WebFullScreenManagerProxy.h: Ditto.
     51        * UIProcess/WebIconDatabase.cpp:
     52        (WebKit::WebIconDatabase::didReceiveSyncMessage): Ditto.
     53        * UIProcess/WebIconDatabase.h: Ditto.
     54        * UIProcess/WebInspectorProxy.h: Ditto.
     55        * UIProcess/WebPageProxy.cpp:
     56        (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
     57        * UIProcess/WebPageProxy.h: Ditto.
     58        * UIProcess/WebProcessProxy.cpp:
     59        (WebKit::WebProcessProxy::didReceiveSyncMessage): Ditto.
     60        * UIProcess/WebProcessProxy.h: Ditto.
     61
     62        * WebProcess/Plugins/Netscape/JSNPObject.cpp: Added a missing include.
     63
     64        * WebProcess/Plugins/PluginProcessConnection.cpp:
     65        (WebKit::PluginProcessConnection::didReceiveSyncMessage): Updated to take
     66        an OwnPtr& and not return SyncReplyMode.
     67        * WebProcess/Plugins/PluginProcessConnection.h: Ditto.
     68        * WebProcess/Plugins/PluginProxy.h: Ditto.
     69        * WebProcess/WebPage/WebPage.cpp:
     70        (WebKit::WebPage::didReceiveSyncMessage): Ditto.
     71        * WebProcess/WebPage/WebPage.h: Ditto.
     72        * WebProcess/WebProcess.cpp:
     73        (WebKit::WebProcess::didReceiveSyncMessage): Ditto.
     74        * WebProcess/WebProcess.h: Ditto.
     75
    1762011-05-18  Chris Fleizach  <cfleizach@apple.com>
    277
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r86175 r86812  
    620620    ASSERT(messageID.isSync());
    621621
    622     // Decode the sync request ID.
    623622    uint64_t syncRequestID = 0;
    624 
    625623    if (!arguments->decodeUInt64(syncRequestID) || !syncRequestID) {
    626624        // We received an invalid sync message.
     
    629627    }
    630628
    631     // Create our reply encoder.
    632629    OwnPtr<ArgumentEncoder> replyEncoder = ArgumentEncoder::create(syncRequestID);
    633    
     630
    634631    // Hand off both the decoder and encoder to the client.
    635     SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder.get());
     632    m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder);
    636633
    637634    // FIXME: If the message was invalid, we should send back a SyncMessageError.
    638635    ASSERT(!arguments->isInvalid());
    639636
    640     if (syncReplyMode == ManualReply) {
    641         // The client will take ownership of the reply encoder and send it at some point in the future.
    642         ArgumentEncoder *encoder = replyEncoder.leakPtr();
    643         (void)encoder;
    644 
    645         return;
    646     }
    647 
    648     // Send the reply.
    649     sendSyncReply(replyEncoder.release());
     637    if (replyEncoder)
     638        sendSyncReply(replyEncoder.release());
    650639}
    651640
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.h

    r86585 r86812  
    5757class MessageID;
    5858   
    59 enum SyncReplyMode {
    60     AutomaticReply,
    61     ManualReply
    62 };
    63 
    6459enum MessageSendFlags {
    6560    // Whether this message should be dispatched when waiting for a sync reply.
     
    8176    public:
    8277        virtual void didReceiveMessage(Connection*, MessageID, ArgumentDecoder*) = 0;
    83         virtual SyncReplyMode didReceiveSyncMessage(Connection*, MessageID, ArgumentDecoder*, ArgumentEncoder*) { ASSERT_NOT_REACHED(); return AutomaticReply; }
     78        virtual void didReceiveSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&) { ASSERT_NOT_REACHED(); }
    8479
    8580    protected:
  • trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h

    r86477 r86812  
    313313
    314314template<typename T, typename C, typename MF>
    315 void handleMessageDelayed(Connection* connection, ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncoder, C* object, MF function)
    316 {
    317     typename T::DecodeType::ValueType arguments;
    318     if (!argumentDecoder->decode(arguments))
    319         return;
    320 
    321     RefPtr<typename T::DelayedReply> delayedReply = adoptRef(new typename T::DelayedReply(connection, adoptPtr(replyEncoder)));
     315void handleMessageDelayed(Connection* connection, ArgumentDecoder* argumentDecoder, OwnPtr<ArgumentEncoder>& replyEncoder, C* object, MF function)
     316{
     317    typename T::DecodeType::ValueType arguments;
     318    if (!argumentDecoder->decode(arguments))
     319        return;
     320
     321    RefPtr<typename T::DelayedReply> delayedReply = adoptRef(new typename T::DelayedReply(connection, replyEncoder.release()));
    322322    callMemberFunction(arguments, delayedReply.release(), object, function);
    323323}
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r86578 r86812  
    6666
    6767    void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    68     CoreIPC::SyncReplyMode didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     68    void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6969
    7070#if PLATFORM(MAC)
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp

    r86522 r86812  
    115115}
    116116
    117 CoreIPC::SyncReplyMode WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     117void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    118118{
    119119    uint64_t destinationID = arguments->destinationID();
    120120
    121     if (!destinationID)
    122         return didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
     121    if (!destinationID) {
     122        didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
     123        return;
     124    }
    123125
    124     if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>())
    125         return m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
     126    if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>()) {
     127        m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
     128        return;
     129    }
    126130
    127131    PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
    128132    if (!pluginControllerProxy)
    129         return CoreIPC::AutomaticReply;
     133        return;
    130134
    131135    PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
    132     CoreIPC::SyncReplyMode replyMode = pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
    133 
    134     return replyMode;
     136    pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
    135137}
    136138
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h

    r86489 r86812  
    6060    // CoreIPC::Connection::Client
    6161    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    62     virtual CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     62    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6363    virtual void didClose(CoreIPC::Connection*);
    6464    virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
     
    6666
    6767    // Message handlers.
    68     CoreIPC::SyncReplyMode didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     68    void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6969    void createPlugin(const PluginCreationParameters&, bool& result, uint32_t& remoteLayerClientID);
    7070    void destroyPlugin(uint64_t pluginInstanceID);
  • trunk/Source/WebKit2/Scripts/webkit2/messages.py

    r86489 r86812  
    402402    result = []
    403403    result.append('    case Messages::%s::%s:\n' % (receiver.name, message.id()))
    404     result.append('        CoreIPC::%s<Messages::%s::%s>(%sarguments, reply, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if message.is_delayed else '', handler_function(receiver, message)))
    405 
    406     if message.is_delayed:
    407         result.append('        return CoreIPC::ManualReply;\n')
    408     else:
    409         result.append('        return CoreIPC::AutomaticReply;\n')
     404    result.append('        CoreIPC::%s<Messages::%s::%s>(%sarguments, reply%s, this, &%s);\n' % (dispatch_function, receiver.name, message.name, 'connection, ' if message.is_delayed else '', '' if message.is_delayed else '.get()', handler_function(receiver, message)))
     405    result.append('        return;\n')
    410406
    411407    return surround_in_condition(''.join(result), message.condition)
     
    623619    if sync_messages:
    624620        result.append('\n')
    625         result.append('CoreIPC::SyncReplyMode %s::didReceiveSync%sMessage(CoreIPC::Connection*%s, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)\n' % (receiver.name, receiver.name, ' connection' if sync_delayed_messages else ''))
     621        result.append('void %s::didReceiveSync%sMessage(CoreIPC::Connection*%s, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)\n' % (receiver.name, receiver.name, ' connection' if sync_delayed_messages else ''))
    626622        result.append('{\n')
    627623        result.append('    switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
     
    631627        result.append('    }\n\n')
    632628        result.append('    ASSERT_NOT_REACHED();\n')
    633         result.append('    return CoreIPC::AutomaticReply;\n')
    634629        result.append('}\n')
    635630
  • trunk/Source/WebKit2/Scripts/webkit2/messages_unittest.py

    r85571 r86812  
    657657}
    658658
    659 CoreIPC::SyncReplyMode WebPage::didReceiveSyncWebPageMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     659void WebPage::didReceiveSyncWebPageMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    660660{
    661661    switch (messageID.get<Messages::WebPage::Kind>()) {
    662662    case Messages::WebPage::CreatePluginID:
    663         CoreIPC::handleMessage<Messages::WebPage::CreatePlugin>(arguments, reply, this, &WebPage::createPlugin);
     663        CoreIPC::handleMessage<Messages::WebPage::CreatePlugin>(arguments, reply.get(), this, &WebPage::createPlugin);
    664664        return CoreIPC::AutomaticReply;
    665665    case Messages::WebPage::RunJavaScriptAlertID:
    666         CoreIPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(arguments, reply, this, &WebPage::runJavaScriptAlert);
     666        CoreIPC::handleMessage<Messages::WebPage::RunJavaScriptAlert>(arguments, reply.get(), this, &WebPage::runJavaScriptAlert);
    667667        return CoreIPC::AutomaticReply;
    668668    case Messages::WebPage::GetPluginProcessConnectionID:
    669         CoreIPC::handleMessageDelayed<Messages::WebPage::GetPluginProcessConnection>(connection, arguments, reply, this, &WebPage::getPluginProcessConnection);
     669        CoreIPC::handleMessageDelayed<Messages::WebPage::GetPluginProcessConnection>(connection, arguments, reply.release(), this, &WebPage::getPluginProcessConnection);
    670670        return CoreIPC::ManualReply;
    671671#if PLATFORM(MAC)
    672672    case Messages::WebPage::InterpretKeyEventID:
    673         CoreIPC::handleMessage<Messages::WebPage::InterpretKeyEvent>(arguments, reply, this, &WebPage::interpretKeyEvent);
     673        CoreIPC::handleMessage<Messages::WebPage::InterpretKeyEvent>(arguments, reply.get(), this, &WebPage::interpretKeyEvent);
    674674        return CoreIPC::AutomaticReply;
    675675#endif
  • trunk/Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.h

    r81370 r86812  
    4848    ~NPObjectMessageReceiver();
    4949
    50     CoreIPC::SyncReplyMode didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     50    void didReceiveSyncNPObjectMessageReceiverMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    5151
    5252    Plugin* plugin() const { return m_plugin; }
  • trunk/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp

    r81370 r86812  
    220220}
    221221
    222 CoreIPC::SyncReplyMode NPRemoteObjectMap::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     222void NPRemoteObjectMap::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    223223{
    224224    NPObjectMessageReceiver* messageReceiver = m_registeredNPObjects.get(arguments->destinationID());
    225225    if (!messageReceiver)
    226         return CoreIPC::AutomaticReply;
    227 
    228     return messageReceiver->didReceiveSyncNPObjectMessageReceiverMessage(connection, messageID, arguments, reply);
     226        return;
     227
     228    messageReceiver->didReceiveSyncNPObjectMessageReceiverMessage(connection, messageID, arguments, reply);
    229229}
    230230
  • trunk/Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.h

    r81370 r86812  
    6565    void pluginDestroyed(Plugin*);
    6666
    67     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
     67    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
    6868
    6969private:
  • trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h

    r82364 r86812  
    6262
    6363    void didReceiveDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    64     CoreIPC::SyncReplyMode didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     64    void didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6565
    6666private:
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r85983 r86812  
    648648}
    649649
    650 CoreIPC::SyncReplyMode WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
    651 {
    652     if (messageID.is<CoreIPC::MessageClassWebContext>())
    653         return didReceiveSyncWebContextMessage(connection, messageID, arguments, reply);
     650void WebContext::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
     651{
     652    if (messageID.is<CoreIPC::MessageClassWebContext>()) {
     653        didReceiveSyncWebContextMessage(connection, messageID, arguments, reply);
     654        return;
     655    }
    654656
    655657    if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
    656658        if (DownloadProxy* downloadProxy = m_downloads.get(arguments->destinationID()).get())
    657             return downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, arguments, reply);
    658 
    659         return CoreIPC::AutomaticReply;
    660     }
    661    
    662     if (messageID.is<CoreIPC::MessageClassWebIconDatabase>())
    663         return m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply);
     659            downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, arguments, reply);
     660        return;
     661    }
     662   
     663    if (messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
     664        m_iconDatabase->didReceiveSyncMessage(connection, messageID, arguments, reply);
     665        return;
     666    }
    664667   
    665668    switch (messageID.get<WebContextLegacyMessage::Kind>()) {
     
    671674            WebContextUserMessageDecoder messageDecoder(messageBody, this);
    672675            if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder)))
    673                 return CoreIPC::AutomaticReply;
     676                return;
    674677
    675678            RefPtr<APIObject> returnData;
    676679            didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody.get(), returnData);
    677680            reply->encode(CoreIPC::In(WebContextUserMessageEncoder(returnData.get())));
    678             return CoreIPC::AutomaticReply;
     681            return;
    679682        }
    680683        case WebContextLegacyMessage::PostMessage:
    681684            ASSERT_NOT_REACHED();
    682685    }
    683 
    684     return CoreIPC::AutomaticReply;
    685686}
    686687
  • trunk/Source/WebKit2/UIProcess/WebContext.h

    r85983 r86812  
    119119
    120120    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    121     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     121    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    122122
    123123    void setCacheModel(CacheModel);
     
    200200    // Implemented in generated WebContextMessageReceiver.cpp
    201201    void didReceiveWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    202     CoreIPC::SyncReplyMode didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     202    void didReceiveSyncWebContextMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    203203
    204204    static void languageChanged(void* context);
  • trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp

    r82906 r86812  
    6565}
    6666
    67 CoreIPC::SyncReplyMode WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     67void WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    6868{
    69     return didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, arguments, reply);
     69    didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, arguments, reply);
    7070}
    7171
  • trunk/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h

    r82084 r86812  
    7474
    7575    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    76     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
     76    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
    7777
    7878    void willEnterFullScreen();
     
    101101
    102102    void didReceiveWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    103     CoreIPC::SyncReplyMode didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
     103    void didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
    104104};
    105105
  • trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp

    r83193 r86812  
    265265}
    266266
    267 CoreIPC::SyncReplyMode WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder, CoreIPC::ArgumentEncoder* reply)
    268 {
    269     return didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply);
     267void WebIconDatabase::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* decoder, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
     268{
     269    didReceiveSyncWebIconDatabaseMessage(connection, messageID, decoder, reply);
    270270}
    271271
  • trunk/Source/WebKit2/UIProcess/WebIconDatabase.h

    r83193 r86812  
    9494   
    9595    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    96     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     96    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    9797
    9898private:
     
    102102
    103103    void didReceiveWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    104     CoreIPC::SyncReplyMode didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     104    void didReceiveSyncWebIconDatabaseMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    105105
    106106    WebContext* m_webContext;
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h

    r86459 r86812  
    104104    // Implemented in generated WebInspectorProxyMessageReceiver.cpp
    105105    void didReceiveWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    106     CoreIPC::SyncReplyMode didReceiveSyncWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     106    void didReceiveSyncWebInspectorProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    107107#endif
    108108
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r86645 r86812  
    13681368}
    13691369
    1370 void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     1370void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    13711371{
    13721372#if ENABLE(INSPECTOR)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r86806 r86812  
    438438#endif
    439439    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    440     void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     440    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    441441
    442442    void processDidBecomeUnresponsive();
     
    544544    // Implemented in generated WebPageProxyMessageReceiver.cpp
    545545    void didReceiveWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    546     CoreIPC::SyncReplyMode didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     546    void didReceiveSyncWebPageProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    547547
    548548    void didCreateMainFrame(uint64_t frameID);
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r84434 r86812  
    261261}
    262262
    263 CoreIPC::SyncReplyMode WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
    264 {
    265     if (messageID.is<CoreIPC::MessageClassWebProcessProxy>())
    266         return didReceiveSyncWebProcessProxyMessage(connection, messageID, arguments, reply);
     263void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
     264{
     265    if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) {
     266        didReceiveSyncWebProcessProxyMessage(connection, messageID, arguments, reply);
     267        return;
     268    }
    267269
    268270    if (messageID.is<CoreIPC::MessageClassWebContext>() || messageID.is<CoreIPC::MessageClassWebContextLegacy>()
    269         || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>())
    270         return m_context->didReceiveSyncMessage(connection, messageID, arguments, reply);
     271        || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>()) {
     272        m_context->didReceiveSyncMessage(connection, messageID, arguments, reply);
     273    }
    271274
    272275    uint64_t pageID = arguments->destinationID();
    273276    if (!pageID)
    274         return CoreIPC::AutomaticReply;
     277        return;
    275278   
    276279    WebPageProxy* pageProxy = webPage(pageID);
    277280    if (!pageProxy)
    278         return CoreIPC::AutomaticReply;
     281        return;
    279282   
    280283    pageProxy->didReceiveSyncMessage(connection, messageID, arguments, reply);
    281     return CoreIPC::AutomaticReply;
    282284}
    283285
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.h

    r86692 r86812  
    139139    // CoreIPC::Connection::Client
    140140    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    141     virtual CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     141    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    142142    virtual void didClose(CoreIPC::Connection*);
    143143    virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
     
    162162    // Implemented in generated WebProcessProxyMessageReceiver.cpp
    163163    void didReceiveWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    164     CoreIPC::SyncReplyMode didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
     164    void didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
    165165
    166166    ResponsivenessTimer m_responsivenessTimer;
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

    r86499 r86812  
    3636#include <JavaScriptCore/ObjectPrototype.h>
    3737#include <WebCore/IdentifierRep.h>
     38#include <wtf/Assertions.h>
    3839#include <wtf/text/WTFString.h>
    3940
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp

    r84302 r86812  
    110110}
    111111
    112 CoreIPC::SyncReplyMode PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     112void PluginProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    113113{
    114     if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>())
    115         return m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
     114    if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>()) {
     115        m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
     116        return;
     117    }
    116118
    117     if (PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID()))
    118         return pluginProxy->didReceiveSyncPluginProxyMessage(connection, messageID, arguments, reply);
     119    if (PluginProxy* pluginProxy = m_plugins.get(arguments->destinationID())) {
     120        pluginProxy->didReceiveSyncPluginProxyMessage(connection, messageID, arguments, reply);
     121        return;
     122    }
    119123
    120124    ASSERT_NOT_REACHED();
    121     return CoreIPC::AutomaticReply;
    122125}
    123126
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h

    r84293 r86812  
    6464    // CoreIPC::Connection::Client
    6565    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    66     virtual CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     66    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6767    virtual void didClose(CoreIPC::Connection*);
    6868    virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h

    r86522 r86812  
    5858
    5959    void didReceivePluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments);
    60     CoreIPC::SyncReplyMode didReceiveSyncPluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     60    void didReceiveSyncPluginProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    6161
    6262private:
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r86612 r86812  
    19951995}
    19961996
    1997 CoreIPC::SyncReplyMode WebPage::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     1997void WebPage::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    19981998{   
    1999     return didReceiveSyncWebPageMessage(connection, messageID, arguments, reply);
     1999    didReceiveSyncWebPageMessage(connection, messageID, arguments, reply);
    20002000}
    20012001   
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r86305 r86812  
    192192    // -- Called from WebProcess.
    193193    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    194     CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     194    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    195195
    196196    // -- InjectedBundle methods
     
    435435
    436436    void didReceiveWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    437     CoreIPC::SyncReplyMode didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     437    void didReceiveSyncWebPageMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    438438
    439439#if !PLATFORM(MAC)
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r85573 r86812  
    560560}
    561561
    562 CoreIPC::SyncReplyMode WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
     562void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
    563563{   
    564564    uint64_t pageID = arguments->destinationID();
    565565    if (!pageID)
    566         return CoreIPC::AutomaticReply;
     566        return;
    567567   
    568568    WebPage* page = webPage(pageID);
    569569    if (!page)
    570         return CoreIPC::AutomaticReply;
     570        return;
    571571   
    572572    page->didReceiveSyncMessage(connection, messageID, arguments, reply);
    573     return CoreIPC::AutomaticReply;
    574573}
    575574
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r86678 r86812  
    182182    // CoreIPC::Connection::Client
    183183    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
    184     virtual CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
     184    virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
    185185    virtual void didClose(CoreIPC::Connection*);
    186186    virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
Note: See TracChangeset for help on using the changeset viewer.