[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric.carlson at apple.com eric.carlson at apple.com
Wed Apr 7 23:15:24 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 436c4e3450e683fa63adae0e701dcb9a21f3de69
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 29 22:32:20 2009 +0000

    2009-10-29  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Kevin Decker.
    
            Refactor some duplicate plug-in clean up code into shared functions.
    
            * Plugins/WebPluginController.mm:
            (-[WebPluginController stopOnePlugin:]): New, stop a plug-in.
            (-[WebPluginController destroyOnePlugin:]): New, destroy plug-in.
            (-[WebPluginController stopAllPlugins]): Call stopOnePlugin.
            (-[WebPluginController destroyPlugin:]): Call stopOnePlugin and destroyOnePlugin.
            (-[WebPluginController destroyAllPlugins]): Call destroyOnePlugin.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 9104b89..1951d71 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-29  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Kevin Decker.
+
+        Refactor some duplicate plug-in clean up code into shared functions.
+
+        * Plugins/WebPluginController.mm:
+        (-[WebPluginController stopOnePlugin:]): New, stop a plug-in.
+        (-[WebPluginController destroyOnePlugin:]): New, destroy plug-in.
+        (-[WebPluginController stopAllPlugins]): Call stopOnePlugin.
+        (-[WebPluginController destroyPlugin:]): Call stopOnePlugin and destroyOnePlugin.
+        (-[WebPluginController destroyAllPlugins]): Call destroyOnePlugin.
+
 2009-10-28  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebKit/mac/Plugins/WebPluginController.mm b/WebKit/mac/Plugins/WebPluginController.mm
index 357cf7b..4343119 100644
--- a/WebKit/mac/Plugins/WebPluginController.mm
+++ b/WebKit/mac/Plugins/WebPluginController.mm
@@ -135,6 +135,28 @@ static NSMutableSet *pluginViews = nil;
     [super dealloc];
 }
 
+- (void)stopOnePlugin:(NSView *)view
+{
+    if ([view respondsToSelector:@selector(webPlugInStop)]) {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+        [view webPlugInStop];
+    } else if ([view respondsToSelector:@selector(pluginStop)]) {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+        [view pluginStop];
+    }
+}
+
+- (void)destroyOnePlugin:(NSView *)view
+{
+    if ([view respondsToSelector:@selector(webPlugInDestroy)]) {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+        [view webPlugInDestroy];
+    } else if ([view respondsToSelector:@selector(pluginDestroy)]) {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+        [view pluginDestroy];
+    }
+}
+
 - (void)startAllPlugins
 {
     if (_started)
@@ -167,16 +189,9 @@ static NSMutableSet *pluginViews = nil;
     }
     
     int i, count = [_views count];
-    for (i = 0; i < count; i++) {
-        id aView = [_views objectAtIndex:i];
-        if ([aView respondsToSelector:@selector(webPlugInStop)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [aView webPlugInStop];
-        } else if ([aView respondsToSelector:@selector(pluginStop)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [aView pluginStop];
-        }
-    }
+    for (i = 0; i < count; i++)
+        [self stopOnePlugin:[_views objectAtIndex:i]];
+
     _started = NO;
 }
 
@@ -228,23 +243,9 @@ static NSMutableSet *pluginViews = nil;
 - (void)destroyPlugin:(NSView *)view
 {
     if ([_views containsObject:view]) {
-        if (_started) {
-            if ([view respondsToSelector:@selector(webPlugInStop)]) {
-                JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-                [view webPlugInStop];
-            } else if ([view respondsToSelector:@selector(pluginStop)]) {
-                JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-                [view pluginStop];
-            }
-        }
-        
-        if ([view respondsToSelector:@selector(webPlugInDestroy)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [view webPlugInDestroy];
-        } else if ([view respondsToSelector:@selector(pluginDestroy)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [view pluginDestroy];
-        }
+        if (_started)
+            [self stopOnePlugin:view];
+        [self destroyOnePlugin:view];
         
 #if ENABLE(NETSCAPE_PLUGIN_API)
         if (Frame* frame = core([self webFrame]))
@@ -290,13 +291,7 @@ static void cancelOutstandingCheck(const void *item, void *context)
     int i, count = [_views count];
     for (i = 0; i < count; i++) {
         id aView = [_views objectAtIndex:i];
-        if ([aView respondsToSelector:@selector(webPlugInDestroy)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [aView webPlugInDestroy];
-        } else if ([aView respondsToSelector:@selector(pluginDestroy)]) {
-            JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
-            [aView pluginDestroy];
-        }
+        [self destroyOnePlugin:aView];
         
 #if ENABLE(NETSCAPE_PLUGIN_API)
         if (Frame* frame = core([self webFrame]))

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list