[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 14:52:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3ec681edf003043a79a843f4e5fe91c366872e87
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 22 21:58:29 2010 +0000

    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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70347 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2b9fd24..bdd89af 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,33 @@
+2010-10-22  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Fix assert when a NetscapePluginModule loses its last NetscapePlugin.
+        https://bugs.webkit.org/show_bug.cgi?id=48155
+
+        (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.
+
 2010-10-22  Jessie Berlin  <jberlin at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp
index b7d4a8e..6c14c4d 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp
@@ -53,6 +53,11 @@ NetscapePluginModule::~NetscapePluginModule()
 
 void NetscapePluginModule::pluginCreated()
 {
+    if (!m_pluginCount) {
+        // Load the plug-in module if necessary.
+        load();
+    }
+        
     m_pluginCount++;
 }
 
@@ -61,8 +66,10 @@ void NetscapePluginModule::pluginDestroyed()
     ASSERT(m_pluginCount > 0);
     m_pluginCount--;
     
-    if (!m_pluginCount)
+    if (!m_pluginCount) {
         shutdown();
+        unload();
+    }
 }
 
 void NetscapePluginModule::shutdown()
@@ -71,6 +78,8 @@ void NetscapePluginModule::shutdown()
 
     m_shutdownProcPtr();
 
+    m_isInitialized = false;
+
     size_t pluginModuleIndex = initializedNetscapePluginModules().find(this);
     ASSERT(pluginModuleIndex != notFound);
     
@@ -98,6 +107,11 @@ PassRefPtr<NetscapePluginModule> NetscapePluginModule::getOrCreate(const String&
 
 bool NetscapePluginModule::load()
 {
+    if (m_isInitialized) {
+        ASSERT(initializedNetscapePluginModules().find(this) != notFound);
+        return true;
+    }
+
     if (!tryLoad()) {
         unload();
         return false;
@@ -148,6 +162,8 @@ bool NetscapePluginModule::tryLoad()
 
 void NetscapePluginModule::unload()
 {
+    ASSERT(!m_isInitialized);
+
     m_module = 0;
 }
 
diff --git a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 08e4643..fb9c1df 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -132,6 +132,7 @@ bool NetscapePlugin::platformPostInitialize()
         // Initialize the fake Carbon window.
         Rect bounds = { 0, 0, 0, 0 };
         CreateNewWindow(kDocumentWindowClass, 0, &bounds, reinterpret_cast<WindowRef*>(&m_npCGContext.window));
+        ASSERT(m_npCGContext.window);
         
         // FIXME: Disable the backing store.
         

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list