Changeset 73419 in webkit


Ignore:
Timestamp:
Dec 6, 2010 5:14:40 PM (13 years ago)
Author:
andersca@apple.com
Message:

The plug-in process crashes if it can't load the plug-in module
https://bugs.webkit.org/show_bug.cgi?id=50601
<rdar://problem/8692654>

Reviewed by Sam Weinig.

  • PluginProcess/PluginControllerProxy.cpp:

(WebKit::PluginControllerProxy::initialize):
Handle m_plugin being 0.

  • PluginProcess/PluginProcess.cpp:

(WebKit::PluginProcess::netscapePluginModule):
Create the plug-in module if it doesn't exist.

(WebKit::PluginProcess::initialize):
Store the plug-in path.

  • PluginProcess/PluginProcess.h:
  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::create):
Return null if the plug-in module doesn't exist.

  • WebProcess/Plugins/Netscape/NetscapePlugin.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::createPlugin):
Simplify code.

Location:
trunk/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r73414 r73419  
     12010-12-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        The plug-in process crashes if it can't load the plug-in module
     6        https://bugs.webkit.org/show_bug.cgi?id=50601
     7        <rdar://problem/8692654>
     8
     9        * PluginProcess/PluginControllerProxy.cpp:
     10        (WebKit::PluginControllerProxy::initialize):
     11        Handle m_plugin being 0.
     12
     13        * PluginProcess/PluginProcess.cpp:
     14        (WebKit::PluginProcess::netscapePluginModule):
     15        Create the plug-in module if it doesn't exist.
     16
     17        (WebKit::PluginProcess::initialize):
     18        Store the plug-in path.
     19
     20        * PluginProcess/PluginProcess.h:
     21        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     22        (WebKit::NetscapePlugin::create):
     23        Return null if the plug-in module doesn't exist.
     24
     25        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
     26        * WebProcess/WebPage/WebPage.cpp:
     27        (WebKit::WebPage::createPlugin):
     28        Simplify code.
     29
    1302010-12-06  Anders Carlsson  <andersca@apple.com>
    231
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r73090 r73419  
    7171
    7272    m_plugin = NetscapePlugin::create(PluginProcess::shared().netscapePluginModule());
     73    if (!m_plugin)
     74        return false;
     75
    7376    if (!m_plugin->initialize(this, parameters)) {
    7477        m_plugin = 0;
  • trunk/WebKit2/PluginProcess/PluginProcess.cpp

    r71247 r73419  
    7777}
    7878
     79NetscapePluginModule* PluginProcess::netscapePluginModule()
     80{
     81    if (!m_pluginModule) {
     82        ASSERT(!m_pluginPath.isNull());
     83        m_pluginModule = NetscapePluginModule::getOrCreate(m_pluginPath);
     84    }
     85
     86    return m_pluginModule.get();
     87}
     88
    7989void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
    8090{
     
    97107    ASSERT(!m_pluginModule);
    98108
    99     m_pluginModule = NetscapePluginModule::getOrCreate(parameters.pluginPath);
     109    m_pluginPath = parameters.pluginPath;
    100110
    101111#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
  • trunk/WebKit2/PluginProcess/PluginProcess.h

    r72972 r73419  
    3232#include "RunLoop.h"
    3333#include <wtf/Forward.h>
     34#include <wtf/text/WTFString.h>
    3435
    3536namespace WebKit {
     
    4647    void removeWebProcessConnection(WebProcessConnection* webProcessConnection);
    4748
    48     NetscapePluginModule* netscapePluginModule() const { return m_pluginModule.get(); }
     49    NetscapePluginModule* netscapePluginModule();
    4950
    5051#if PLATFORM(MAC)
     
    7879    Vector<RefPtr<WebProcessConnection> > m_webProcessConnections;
    7980
     81    // The plug-in path.
     82    String m_pluginPath;
     83
    8084    // The plug-in module.
    8185    RefPtr<NetscapePluginModule> m_pluginModule;
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r73387 r73419  
    4444static NetscapePlugin* currentNPPNewPlugin;
    4545
     46PassRefPtr<NetscapePlugin> NetscapePlugin::create(PassRefPtr<NetscapePluginModule> pluginModule)
     47{
     48    if (!pluginModule)
     49        return 0;
     50
     51    return adoptRef(new NetscapePlugin(pluginModule));
     52}
     53   
    4654NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule)
    4755    : m_pluginController(0)
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r73391 r73419  
    4646class NetscapePlugin : public Plugin {
    4747public:
    48     static PassRefPtr<NetscapePlugin> create(PassRefPtr<NetscapePluginModule> pluginModule)
    49     {
    50         return adoptRef(new NetscapePlugin(pluginModule));
    51     }
     48    static PassRefPtr<NetscapePlugin> create(PassRefPtr<NetscapePluginModule> pluginModule);
    5249    virtual ~NetscapePlugin();
    5350
  • trunk/WebKit2/WebProcess/WebPage/WebPage.cpp

    r73410 r73419  
    228228    return PluginProxy::create(pluginProcessConnection);
    229229#else
    230     RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
    231     if (!pluginModule)
    232         return 0;
    233 
    234     return NetscapePlugin::create(pluginModule.release());
     230    return NetscapePlugin::create(NetscapePluginModule::getOrCreate(pluginPath));
    235231#endif
    236232}
Note: See TracChangeset for help on using the changeset viewer.