[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

kdecker at apple.com kdecker at apple.com
Thu Oct 29 20:39:08 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 72674251b1ff8e2ad2980144c4356ba2688bded7
Author: kdecker at apple.com <kdecker at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 5 18:57:25 2009 +0000

            Reviewed by Sam Weinig.
    
            <rdar://problem/7273363> Plug-ins should use PluginHalter
    
            * Plugins/WebBaseNetscapePluginView.h: Add WebHaltablePlugin forward declare and _haltable ivar.
            * Plugins/WebBaseNetscapePluginView.mm:
            (WebHaltablePlugin::WebHaltablePlugin): Added.
            (WebHaltablePlugin::halt): New method that stops a plug-in.
            (WebHaltablePlugin::restart): New method that starts a plug-in.
            (WebHaltablePlugin::node): Added. Provides the DOMNode corresponding to the plug-in in WebBaseNetscapePluginView.
            (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
            Initialize new _haltable ivar.
            (-[WebBaseNetscapePluginView start]): Call the page's didStartPlugin() upon starting a plug-in.
            (-[WebBaseNetscapePluginView stop]): Call the page's didStopPlugin() upon stopping a plug-in.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 335272e..af94422 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-04  Kevin Decker  <kdecker at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/7273363> Plug-ins should use PluginHalter
+        
+        * Plugins/WebBaseNetscapePluginView.h: Add WebHaltablePlugin forward declare and _haltable ivar.
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (WebHaltablePlugin::WebHaltablePlugin): Added.
+        (WebHaltablePlugin::halt): New method that stops a plug-in.
+        (WebHaltablePlugin::restart): New method that starts a plug-in.
+        (WebHaltablePlugin::node): Added. Provides the DOMNode corresponding to the plug-in in WebBaseNetscapePluginView.
+        (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+        Initialize new _haltable ivar.
+        (-[WebBaseNetscapePluginView start]): Call the page's didStartPlugin() upon starting a plug-in.
+        (-[WebBaseNetscapePluginView stop]): Call the page's didStopPlugin() upon stopping a plug-in.
+
 2009-10-05  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index a9fb188..bd05ebe 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -31,6 +31,7 @@
 
 #import "WebNetscapePluginPackage.h"
 #import "WebPluginContainerCheck.h"
+#import <wtf/OwnPtr.h>
 #import <wtf/PassRefPtr.h>
 #import <wtf/RefPtr.h>
 #import <wtf/RetainPtr.h>
@@ -45,6 +46,8 @@ namespace WebCore {
     class HTMLPlugInElement;
 }
 
+class WebHaltablePlugin;
+
 @interface WebBaseNetscapePluginView : NSView
 {
     RetainPtr<WebNetscapePluginPackage> _pluginPackage;
@@ -65,6 +68,8 @@ namespace WebCore {
     RetainPtr<NSURL> _baseURL;
     RetainPtr<NSURL> _sourceURL;
     
+    OwnPtr<WebHaltablePlugin> _haltable;
+    
     NSTrackingRectTag _trackingTag;
 }
 
@@ -101,6 +106,7 @@ namespace WebCore {
 - (void)startTimers;
 - (void)restartTimers;
 
+- (void)start;
 - (void)stop;
 
 - (void)addWindowObservers;
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index 324dff9..e730419 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -51,6 +51,7 @@
 #import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
 #import <WebCore/HTMLPlugInElement.h>
+#import <WebCore/HaltablePlugin.h>
 #import <WebCore/Page.h>
 #import <WebCore/ProtectionSpace.h>
 #import <WebCore/RenderView.h>
@@ -63,6 +64,21 @@
 
 using namespace WebCore;
 
+class WebHaltablePlugin : public HaltablePlugin {
+public:
+    WebHaltablePlugin(WebBaseNetscapePluginView* view)
+        : m_view(view)
+    {
+    }
+    
+private:
+    virtual void halt() { [m_view stop]; }
+    virtual void restart() { [m_view start]; }
+    virtual Node* node() const { return [m_view element]; }
+
+    WebBaseNetscapePluginView* m_view;
+};
+
 @implementation WebBaseNetscapePluginView
 
 + (void)initialize
@@ -114,7 +130,7 @@ using namespace WebCore;
         _mode = NP_EMBED;
     
     _loadManually = loadManually;
-
+    _haltable = new WebHaltablePlugin(self);
     return self;
 }
 
@@ -391,6 +407,8 @@ using namespace WebCore;
     }
     
     _isStarted = YES;
+    page->didStartPlugin(_haltable.get());
+
     [[self webView] addPluginInstanceView:self];
 
     if ([self currentWindow])
@@ -418,6 +436,11 @@ using namespace WebCore;
     
     if (!_isStarted)
         return;
+
+    if (Frame* frame = core([self webFrame])) {
+        if (Page* page = frame->page())
+            page->didStopPlugin(_haltable.get());
+    }
     
     _isStarted = NO;
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list