[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:46:10 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit d3098acce735c8fe4dabfa21b57f9369f67cf024
Author: kdecker at apple.com <kdecker at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 16 18:33:49 2009 +0000

            Reviewed by Anders.
    
            <rdar://problem/7273354>
    
            * Plugins/WebBaseNetscapePluginView.h: Added _isHalted ivar and three new methods: -halt, -resumeFromHalt, and -isHalted
            * Plugins/WebBaseNetscapePluginView.mm:
            (WebHaltablePlugin::halt): Call -halt instead of -stop.
            (WebHaltablePlugin::restart):Call -resumeFromHalt instead of -start.
            (-[WebBaseNetscapePluginView halt]): Added. Stop the plug-in, update _isHalted.
            (-[WebBaseNetscapePluginView resumeFromHalt]): Added. Start the plug-in, update _isHalted.
            (-[WebBaseNetscapePluginView isHalted]): Added.
            * WebView/WebView.mm:
            (-[WebView _isNodeHaltedPlugin:]): Added. Queries a DOMNode to determine if it's a halted plug-in.
            * WebView/WebViewPrivate.h: Added _isNodeHaltedPlugin.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index fcee346..326422e 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-16  Kevin Decker  <kdecker at apple.com>
+
+        Reviewed by Anders.
+
+        <rdar://problem/7273354> 
+
+        * Plugins/WebBaseNetscapePluginView.h: Added _isHalted ivar and three new methods: -halt, -resumeFromHalt, and -isHalted
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (WebHaltablePlugin::halt): Call -halt instead of -stop.  
+        (WebHaltablePlugin::restart):Call -resumeFromHalt instead of -start. 
+        (-[WebBaseNetscapePluginView halt]): Added. Stop the plug-in, update _isHalted.
+        (-[WebBaseNetscapePluginView resumeFromHalt]): Added. Start the plug-in, update _isHalted.
+        (-[WebBaseNetscapePluginView isHalted]): Added.
+        * WebView/WebView.mm:
+        (-[WebView _isNodeHaltedPlugin:]): Added. Queries a DOMNode to determine if it's a halted plug-in.
+        * WebView/WebViewPrivate.h: Added _isNodeHaltedPlugin.
+
 2009-10-15  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Adele Peterson.
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index a5dbdca..e37f3f0 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -63,6 +63,7 @@ class WebHaltablePlugin;
     BOOL _hasFocus;
     BOOL _isCompletelyObscured;
     BOOL _isPrivateBrowsingEnabled;
+    BOOL _isHalted;
     
     RefPtr<WebCore::HTMLPlugInElement> _element;
     RetainPtr<NSString> _MIMEType;
@@ -110,6 +111,10 @@ class WebHaltablePlugin;
 - (void)start;
 - (void)stop;
 
+- (void)halt;
+- (void)resumeFromHalt;
+- (BOOL)isHalted;
+
 - (void)addWindowObservers;
 - (void)removeWindowObservers;
 
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index bce4dcb..ea66bf4 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -96,7 +96,7 @@ void WebHaltablePlugin::halt()
     RefPtr<Image> nodeImage = BitmapImage::create(cgImage);
     ASSERT(element->renderer());
     toRenderWidget(element->renderer())->showSubstituteImage(nodeImage);
-    [m_view stop];
+    [m_view halt];
 }
 
 void WebHaltablePlugin::restart()
@@ -104,7 +104,7 @@ void WebHaltablePlugin::restart()
     Element* element = [m_view element];
     ASSERT(element->renderer());
     toRenderWidget(element->renderer())->showSubstituteImage(0);
-    [m_view start];
+    [m_view resumeFromHalt];
 }
     
 Node* WebHaltablePlugin::node() const
@@ -492,6 +492,27 @@ Node* WebHaltablePlugin::node() const
     [self destroyPlugin];
 }
 
+- (void)halt
+{
+    ASSERT(!_isHalted && _isStarted);
+    [self stop];
+    _isHalted = YES;
+}
+
+- (void)resumeFromHalt
+{
+    ASSERT(_isHalted && !_isStarted);
+    [self start];
+    
+    if (_isStarted)
+        _isHalted = NO;
+}
+
+- (BOOL)isHalted
+{
+    return _isHalted;
+}
+
 - (void)viewWillMoveToWindow:(NSWindow *)newWindow
 {
     // We must remove the tracking rect before we move to the new window.
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 40b6379..d8c551c 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -34,6 +34,7 @@
 #import "DOMNodeInternal.h"
 #import "DOMRangeInternal.h"
 #import "WebBackForwardListInternal.h"
+#import "WebBaseNetscapePluginView.h"
 #import "WebCache.h"
 #import "WebChromeClient.h"
 #import "WebContextMenuClient.h"
@@ -124,6 +125,7 @@
 #import <WebCore/PageGroup.h>
 #import <WebCore/PlatformMouseEvent.h>
 #import <WebCore/ProgressTracker.h>
+#import <WebCore/RenderWidget.h>
 #import <WebCore/ResourceHandle.h>
 #import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/ScriptController.h>
@@ -2114,6 +2116,30 @@ static inline IMP getMethod(id o, SEL s)
 #endif
 }
 
+- (BOOL)_isNodeHaltedPlugin:(DOMNode *)node
+{
+    if (!node)
+        return NO;
+        
+    Node* coreNode = core(node);
+    if (!coreNode)
+        return NO;
+    
+    RenderObject* renderer = coreNode->renderer();
+    if (!renderer)
+        return NO;
+    
+    Widget* widget = toRenderWidget(renderer)->widget();
+    if (!widget || !widget->platformWidget())
+        return NO;
+
+    NSView *view = widget->platformWidget();
+    if (![view isKindOfClass:[WebBaseNetscapePluginView class]])
+        return NO;
+    
+    return [(WebBaseNetscapePluginView *)view isHalted];
+}
+
 - (NSPasteboard *)_insertionPasteboard
 {
     return _private ? _private->insertionPasteboard : nil;
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 20610cc..2b32e6e 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -462,6 +462,9 @@ Could be worth adding to the API.
 // SPI for DumpRenderTree
 - (BOOL)_isUsingAcceleratedCompositing;
 
+// SPI for PluginHalter
+- (BOOL)_isNodeHaltedPlugin:(DOMNode *)node;
+
 // Which pasteboard text is coming from in editing delegate methods such as shouldInsertNode.
 - (NSPasteboard *)_insertionPasteboard;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list