[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:44:49 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 76311d005f8fbae3341d449376aeb88640323555
Author: kdecker at apple.com <kdecker at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 15 00:14:08 2009 +0000

            Reviewed by Anders Carlsson and Jon Honeycutt
    
            <rdar://problem/7304295> snapshots of halted plug-ins are missing
    
            * Plugins/WebBaseNetscapePluginView.mm: Move bodies of WebHaltablePlugin virtual functions from WebHaltablePlugin class definition.
            (WebHaltablePlugin::halt): Provide a substitute image to the RenderWidget for the plug-in view.
            (WebHaltablePlugin::restart): Clear the substitute image.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49603 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 992de38..398284b 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-14  Kevin Decker  <kdecker at apple.com>
+
+        Reviewed by Anders Carlsson and Jon Honeycutt
+
+        <rdar://problem/7304295> snapshots of halted plug-ins are missing
+        
+        * Plugins/WebBaseNetscapePluginView.mm: Move bodies of WebHaltablePlugin virtual functions from WebHaltablePlugin class definition.
+        (WebHaltablePlugin::halt): Provide a substitute image to the RenderWidget for the plug-in view.
+        (WebHaltablePlugin::restart): Clear the substitute image.
+
 2009-10-13  Dave Hyatt  <hyatt at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index 2c9a630..f95f3d1 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -43,6 +43,7 @@
 
 #import <WebCore/WebCoreObjCExtras.h>
 #import <WebCore/AuthenticationMac.h>
+#import <WebCore/BitmapImage.h>
 #import <WebCore/Credential.h>
 #import <WebCore/CredentialStorage.h>
 #import <WebCore/CString.h>
@@ -55,6 +56,7 @@
 #import <WebCore/Page.h>
 #import <WebCore/ProtectionSpace.h>
 #import <WebCore/RenderView.h>
+#import <WebCore/RenderWidget.h>
 #import <WebKit/DOMPrivate.h>
 #import <runtime/InitializeThreading.h>
 #import <wtf/Assertions.h>
@@ -72,13 +74,43 @@ public:
     }
     
 private:
-    virtual void halt() { [m_view stop]; }
-    virtual void restart() { [m_view start]; }
-    virtual Node* node() const { return [m_view element]; }
+    virtual void halt();
+    virtual void restart();
+    virtual Node* node() const;
 
     WebBaseNetscapePluginView* m_view;
 };
 
+void WebHaltablePlugin::halt()
+{
+    Element* element = [m_view element];
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+    CGImageRef cgImage = CGImageRetain([core([m_view webFrame])->nodeImage(element) CGImageForProposedRect:nil context:nil hints:nil]);
+#else
+    RetainPtr<CGImageSourceRef> imageRef(AdoptCF, CGImageSourceCreateWithData((CFDataRef)[core([m_view webFrame])->nodeImage(element) TIFFRepresentation], 0));
+    CGImageRef cgImage = CGImageSourceCreateImageAtIndex(imageRef.get(), 0, 0);
+#endif
+    ASSERT(cgImage);
+    
+    // BitmapImage will release the passed in CGImage on destruction.
+    RefPtr<Image> nodeImage = BitmapImage::create(cgImage);
+    ASSERT(element->renderer());
+    toRenderWidget(element->renderer())->showSubstituteImage(nodeImage);
+    [m_view stop];
+}
+
+void WebHaltablePlugin::restart()
+{ 
+    ASSERT(element->renderer());
+    toRenderWidget(element->renderer())->showSubstituteImage(0);
+    [m_view start];
+}
+    
+Node* WebHaltablePlugin::node() const
+{
+    return [m_view element];
+}
+
 @implementation WebBaseNetscapePluginView
 
 + (void)initialize

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list