Changeset 70347 in webkit


Ignore:
Timestamp:
Oct 22, 2010 2:58:29 PM (14 years ago)
Author:
andersca@apple.com
Message:

Fix assert when a NetscapePluginModule loses its last NetscapePlugin.
https://bugs.webkit.org/show_bug.cgi?id=48155

Reviewed by Adam Roben.

(The assert in question is ASSERT(pluginModuleIndex != notFound) in
NetscapePluginModule::shutdown()).

  • WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:

(WebKit::NetscapePluginModule::pluginCreated):
If we didn't have any live plug-ins, load the plug-in module.

(WebKit::NetscapePluginModule::pluginDestroyed):
If this was the last plug-in, unload the plug-in module.

(WebKit::NetscapePluginModule::shutdown):
Set m_isInitialized to false.

(WebKit::NetscapePluginModule::load):
Don't do anything if the plug-in module has already been initialized.

(WebKit::NetscapePluginModule::unload):
Assert that we're not initialized.

  • WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:

(WebKit::NetscapePlugin::platformPostInitialize):
Assert that we successfully created the window.

Location:
trunk/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70346 r70347  
     12010-10-22  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Fix assert when a NetscapePluginModule loses its last NetscapePlugin.
     6        https://bugs.webkit.org/show_bug.cgi?id=48155
     7
     8        (The assert in question is ASSERT(pluginModuleIndex != notFound) in
     9        NetscapePluginModule::shutdown()).
     10
     11        * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp:
     12        (WebKit::NetscapePluginModule::pluginCreated):
     13        If we didn't have any live plug-ins, load the plug-in module.
     14
     15        (WebKit::NetscapePluginModule::pluginDestroyed):
     16        If this was the last plug-in, unload the plug-in module.
     17
     18        (WebKit::NetscapePluginModule::shutdown):
     19        Set m_isInitialized to false.
     20
     21        (WebKit::NetscapePluginModule::load):
     22        Don't do anything if the plug-in module has already been initialized.
     23
     24        (WebKit::NetscapePluginModule::unload):
     25        Assert that we're not initialized.
     26
     27        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
     28        (WebKit::NetscapePlugin::platformPostInitialize):
     29        Assert that we successfully created the window.
     30
    1312010-10-22  Jessie Berlin  <jberlin@apple.com>
    232
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp

    r66025 r70347  
    5454void NetscapePluginModule::pluginCreated()
    5555{
     56    if (!m_pluginCount) {
     57        // Load the plug-in module if necessary.
     58        load();
     59    }
     60       
    5661    m_pluginCount++;
    5762}
     
    6267    m_pluginCount--;
    6368   
    64     if (!m_pluginCount)
     69    if (!m_pluginCount) {
    6570        shutdown();
     71        unload();
     72    }
    6673}
    6774
     
    7178
    7279    m_shutdownProcPtr();
     80
     81    m_isInitialized = false;
    7382
    7483    size_t pluginModuleIndex = initializedNetscapePluginModules().find(this);
     
    99108bool NetscapePluginModule::load()
    100109{
     110    if (m_isInitialized) {
     111        ASSERT(initializedNetscapePluginModules().find(this) != notFound);
     112        return true;
     113    }
     114
    101115    if (!tryLoad()) {
    102116        unload();
     
    149163void NetscapePluginModule::unload()
    150164{
     165    ASSERT(!m_isInitialized);
     166
    151167    m_module = 0;
    152168}
  • trunk/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm

    r70265 r70347  
    133133        Rect bounds = { 0, 0, 0, 0 };
    134134        CreateNewWindow(kDocumentWindowClass, 0, &bounds, reinterpret_cast<WindowRef*>(&m_npCGContext.window));
     135        ASSERT(m_npCGContext.window);
    135136       
    136137        // FIXME: Disable the backing store.
Note: See TracChangeset for help on using the changeset viewer.