Changeset 152403 in webkit


Ignore:
Timestamp:
Jul 4, 2013 11:42:16 AM (11 years ago)
Author:
andersca@apple.com
Message:

Crash when createPluginInternal ends up destroying the plug-in
https://bugs.webkit.org/show_bug.cgi?id=118397
<rdar://problem/14155051>

Reviewed by Simon Fraser.

Keep the WebProcessConnection object alive while calling createPluginInternal and handle
the IPC connection going away.

  • PluginProcess/WebProcessConnection.cpp:

(WebKit::WebProcessConnection::createPluginAsynchronously):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r152382 r152403  
     12013-07-04  Anders Carlsson  <andersca@apple.com>
     2
     3        Crash when createPluginInternal ends up destroying the plug-in
     4        https://bugs.webkit.org/show_bug.cgi?id=118397
     5        <rdar://problem/14155051>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Keep the WebProcessConnection object alive while calling createPluginInternal and handle
     10        the IPC connection going away.
     11
     12        * PluginProcess/WebProcessConnection.cpp:
     13        (WebKit::WebProcessConnection::createPluginAsynchronously):
     14
    1152013-07-03  Gordon Sheridan  <gordon_sheridan@apple.com>
    216
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp

    r151480 r152403  
    290290    // We can force it to do so by incrementing the "DispatchMessageMarkedDispatchWhenWaitingForSyncReply" count.
    291291    m_connection->incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
     292
     293    // The call to createPluginInternal can potentially cause the plug-in to be destroyed and
     294    // thus free the WebProcessConnection object. Protect it.
     295    RefPtr<WebProcessConnection> protect(this);
    292296    createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
     297
     298    if (!m_connection) {
     299        // createPluginInternal caused the connection to go away.
     300        return;
     301    }
     302
    293303    m_connection->decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
    294304
Note: See TracChangeset for help on using the changeset viewer.