Changeset 63638 in webkit


Ignore:
Timestamp:
Jul 18, 2010 5:09:01 PM (14 years ago)
Author:
andersca@apple.com
Message:

Move PluginWidget to WebKit
https://bugs.webkit.org/show_bug.cgi?id=42530

Reviewed by Sam Weinig.

WebCore:

Rename the PluginWidget class to PluginViewBase and make it an abstract base class.

This is a stopgap measure until we have a single PluginView class that we can use everywhere.

  • WebCore.exp.in:

Remove PluginWidget symbols.

  • WebCore.xcodeproj/project.pbxproj:

Update.

  • platform/Widget.h:

(WebCore::Widget::isPluginViewBase):
Return false.

  • plugins/PluginViewBase.h: Added.

(WebCore::PluginViewBase::platformLayer):
Always return 0 here now.

(WebCore::PluginViewBase::isPluginViewBase):
Return true.

  • plugins/PluginWidget.h: Removed.
  • plugins/mac/PluginWidgetMac.mm: Removed.
  • rendering/RenderEmbeddedObject.cpp:

(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing):
Cast to PluginWidgetBase instead.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
Cast to PluginWidgetBase instead.

WebKit/mac:

  • Plugins/WebBaseNetscapePluginView.h:
  • Plugins/WebBaseNetscapePluginView.mm:

(-[WebBaseNetscapePluginView pluginLayer]):
Add default pluginLayer implementation.

  • WebCoreSupport/WebFrameLoaderClient.mm:

(PluginWidget::PluginWidget):
(PluginWidget::invalidateRect):
Move the guts of PluginWidget here from WebCore.

(NetscapePluginWidget::platformLayer):
Get the layer from the plug-in view.

Location:
trunk
Files:
1 deleted
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63634 r63638  
     12010-07-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Move PluginWidget to WebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=42530
     7
     8        Rename the PluginWidget class to PluginViewBase and make it an abstract base class.
     9       
     10        This is a stopgap measure until we have a single PluginView class that we can use everywhere.
     11
     12        * WebCore.exp.in:
     13        Remove PluginWidget symbols.
     14
     15        * WebCore.xcodeproj/project.pbxproj:
     16        Update.
     17
     18        * platform/Widget.h:
     19        (WebCore::Widget::isPluginViewBase):
     20        Return false.
     21
     22        * plugins/PluginViewBase.h: Added.
     23        (WebCore::PluginViewBase::platformLayer):
     24        Always return 0 here now.
     25
     26        (WebCore::PluginViewBase::isPluginViewBase):
     27        Return true.
     28
     29        * plugins/PluginWidget.h: Removed.
     30        * plugins/mac/PluginWidgetMac.mm: Removed.
     31        * rendering/RenderEmbeddedObject.cpp:
     32        (WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing):
     33        Cast to PluginWidgetBase instead.
     34       
     35        * rendering/RenderLayerBacking.cpp:
     36        (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
     37        Cast to PluginWidgetBase instead.
     38
    1392010-07-18  Dean Jackson  <dino@apple.com>
    240
  • trunk/WebCore/WebCore.exp.in

    r63631 r63638  
    250250__ZN7WebCore12IconDatabase5closeEv
    251251__ZN7WebCore12IconDatabase9setClientEPNS_18IconDatabaseClientE
    252 __ZN7WebCore12PluginWidget14invalidateRectERKNS_7IntRectE
    253252__ZN7WebCore12PrintContext12pagePropertyEPNS_5FrameEPKci
    254253__ZN7WebCore12PrintContext13numberOfPagesEPNS_5FrameERKNS_9FloatSizeE
     
    10101009__ZNK7WebCore9PageCache21autoreleasedPageCountEv
    10111010__ZTVN7WebCore12ChromeClientE
    1012 __ZTVN7WebCore12PluginWidgetE
    10131011__ZTVN7WebCore17FileChooserClientE
    10141012__ZTVN7WebCore17FrameLoaderClientE
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r63634 r63638  
    196196                08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; };
    197197                0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; };
    198                 0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */; };
    199                 0AFDAC3D10F5448C00E1F3D2 /* PluginWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */; settings = {ATTRIBUTES = (Private, ); }; };
     198                0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    200199                0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */; };
    201200                0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */; };
     
    58275826                08FB84B10ECE373300DC064E /* WMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLElementFactory.h; sourceTree = "<group>"; };
    58285827                0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; };
    5829                 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PluginWidgetMac.mm; path = mac/PluginWidgetMac.mm; sourceTree = "<group>"; };
    5830                 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginWidget.h; sourceTree = "<group>"; };
     5828                0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; };
    58315829                0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; };
    58325830                0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; };
     
    1107711075                        usesTabs = 0;
    1107811076                };
    11079                 0AFDAC3610F5447400E1F3D2 /* mac */ = {
    11080                         isa = PBXGroup;
    11081                         children = (
    11082                                 0AFDAC3A10F5448300E1F3D2 /* PluginWidgetMac.mm */,
    11083                         );
    11084                         name = mac;
    11085                         sourceTree = "<group>";
    11086                 };
    1108711077                14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
    1108811078                        isa = PBXGroup;
     
    1203012020                        isa = PBXGroup;
    1203112021                        children = (
    12032                                 0AFDAC3610F5447400E1F3D2 /* mac */,
    1203312022                                A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */,
    1203412023                                A9C6E4E20D745E05006442E9 /* DOMMimeType.h */,
     
    1204912038                                1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */,
    1205012039                                1AA8798F11CBE846003C664F /* PluginStrategy.h */,
     12040                                0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */,
    1205112041                                76FF17E211235673001D61B5 /* PluginViewNone.cpp */,
    12052                                 0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */,
    1205312042                        );
    1205412043                        path = plugins;
     
    1909619085                                1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */,
    1909719086                                1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */,
    19098                                 0AFDAC3D10F5448C00E1F3D2 /* PluginWidget.h in Headers */,
     19087                                0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */,
    1909919088                                B2B1F7170D00CAA8004AEA64 /* PointerEventsHitRules.h in Headers */,
    1910019089                                97059978107D975200A50A7C /* PolicyCallback.h in Headers */,
     
    2157121560                                1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
    2157221561                                76FF17E311235673001D61B5 /* PluginViewNone.cpp in Sources */,
    21573                                 0AFDAC3B10F5448300E1F3D2 /* PluginWidgetMac.mm in Sources */,
    2157421562                                B2B1F7160D00CAA8004AEA64 /* PointerEventsHitRules.cpp in Sources */,
    2157521563                                97059977107D975200A50A7C /* PolicyCallback.cpp in Sources */,
  • trunk/WebCore/platform/Widget.h

    r62443 r63638  
    183183    virtual bool isFrameView() const { return false; }
    184184    virtual bool isPluginView() const { return false; }
    185     // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginWidget and PluginView can become one class.
    186     virtual bool isPluginWidget() const { return false; }
     185    // FIXME: The Mac plug-in code should inherit from PluginView. When this happens PluginViewBase and PluginView can become one class.
     186    virtual bool isPluginViewBase() const { return false; }
    187187    virtual bool isScrollbar() const { return false; }
    188188
  • trunk/WebCore/plugins/PluginViewBase.h

    r63637 r63638  
    3131namespace WebCore {
    3232
    33 class PluginWidget : public Widget {
    34    
     33// PluginViewBase is a widget that all plug-in views inherit from, both in Webkit and WebKit2.
     34// It's intended as a stopgap measure until we can merge all plug-in views into a single plug-in view.
     35class PluginViewBase : public Widget {
    3536public:
    36     PluginWidget(PlatformWidget widget = 0) : Widget(widget) { }
    3737#if USE(ACCELERATED_COMPOSITING)
    38     PlatformLayer* platformLayer() const;
     38    virtual PlatformLayer* platformLayer() const { return 0; }
    3939#endif
     40
     41protected:
     42    PluginViewBase(PlatformWidget widget) : Widget(widget) { }
    4043   
    4144private:
    42     virtual void invalidateRect(const IntRect&);
    43     virtual bool isPluginWidget() const { return true; }
     45    virtual bool isPluginViewBase() const { return true; }
    4446};
    45 
    46 #if USE(ACCELERATED_COMPOSITING) && !PLATFORM(MAC)
    47 inline PlatformLayer* PluginWidget::platformLayer() const
    48 {
    49     return 0;
    50 }
    51 #endif
    5247
    5348} // namespace WebCore
  • trunk/WebCore/rendering/RenderEmbeddedObject.cpp

    r62875 r63638  
    4343#include "Page.h"
    4444#include "Path.h"
    45 #include "PluginWidget.h"
     45#include "PluginViewBase.h"
    4646#include "RenderTheme.h"
    4747#include "RenderView.h"
     
    5252#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    5353#include "HTMLVideoElement.h"
    54 #endif
    55 
    56 #if USE(ACCELERATED_COMPOSITING)
    57 #include "PluginWidget.h"
    5854#endif
    5955
     
    10399bool RenderEmbeddedObject::allowsAcceleratedCompositing() const
    104100{
    105     return widget() && widget()->isPluginWidget() && static_cast<PluginWidget*>(widget())->platformLayer();
     101    return widget() && widget()->isPluginViewBase() && static_cast<PluginViewBase*>(widget())->platformLayer();
    106102}
    107103#endif
  • trunk/WebCore/rendering/RenderLayerBacking.cpp

    r63576 r63638  
    4444#include "InspectorTimelineAgent.h"
    4545#include "KeyframeList.h"
    46 #include "PluginWidget.h"
     46#include "PluginViewBase.h"
    4747#include "RenderBox.h"
    4848#include "RenderIFrame.h"
     
    263263
    264264    if (renderer()->isEmbeddedObject() && toRenderEmbeddedObject(renderer())->allowsAcceleratedCompositing()) {
    265         PluginWidget* pluginWidget = static_cast<PluginWidget*>(toRenderEmbeddedObject(renderer())->widget());
    266         m_graphicsLayer->setContentsToMedia(pluginWidget->platformLayer());
     265        PluginViewBase* pluginViewBase = static_cast<PluginViewBase*>(toRenderEmbeddedObject(renderer())->widget());
     266        m_graphicsLayer->setContentsToMedia(pluginViewBase->platformLayer());
    267267    }
    268268#if ENABLE(VIDEO)
  • trunk/WebKit/mac/ChangeLog

    r63632 r63638  
     12010-07-18  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Move PluginWidget to WebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=42530
     7
     8        * Plugins/WebBaseNetscapePluginView.h:
     9        * Plugins/WebBaseNetscapePluginView.mm:
     10        (-[WebBaseNetscapePluginView pluginLayer]):
     11        Add default pluginLayer implementation.
     12
     13        * WebCoreSupport/WebFrameLoaderClient.mm:
     14        (PluginWidget::PluginWidget):
     15        (PluginWidget::invalidateRect):
     16        Move the guts of PluginWidget here from WebCore.
     17       
     18        (NetscapePluginWidget::platformLayer):
     19        Get the layer from the plug-in view.
     20
    1212010-07-18  David Kilzer  <ddkilzer@apple.com>
    222
  • trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h

    r56825 r63638  
    141141- (void)invalidatePluginContentRect:(NSRect)rect;
    142142
     143#ifndef BUILDING_ON_TIGER
     144- (CALayer *)pluginLayer;
     145#endif
     146
    143147@end
    144148
  • trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

    r61581 r63638  
    949949}
    950950
     951#ifndef BUILDING_ON_TIGER
     952- (CALayer *)pluginLayer
     953{
     954    ASSERT_NOT_REACHED();
     955    return nil;
     956}
     957#endif
     958
    951959@end
    952960
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r61581 r63638  
    104104#import <WebCore/Page.h>
    105105#import <WebCore/PlatformString.h>
    106 #import <WebCore/PluginWidget.h>
     106#import <WebCore/PluginViewBase.h>
    107107#import <WebCore/ResourceError.h>
    108108#import <WebCore/ResourceHandle.h>
     
    15031503}
    15041504
     1505class PluginWidget : public PluginViewBase {
     1506public:
     1507    PluginWidget(NSView *view = 0)
     1508        : PluginViewBase(view)
     1509    {
     1510    }
     1511   
     1512private:
     1513    virtual void invalidateRect(const IntRect& rect)
     1514    {
     1515        [platformWidget() setNeedsDisplayInRect:rect];
     1516    }
     1517};
     1518
    15051519#if ENABLE(NETSCAPE_PLUGIN_API)
    15061520
     
    15121526    }
    15131527   
     1528#if USE(ACCELERATED_COMPOSITING)
     1529    virtual PlatformLayer* platformLayer() const
     1530    {
     1531        return [(WebBaseNetscapePluginView *)platformWidget() pluginLayer];
     1532    }
     1533#endif
     1534
    15141535    virtual void handleEvent(Event* event)
    15151536    {
Note: See TracChangeset for help on using the changeset viewer.