Remove some includes of CachedImage.h
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 06:22:14 +0000 (06:22 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2013 06:22:14 +0000 (06:22 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=114411

        Reviewed by Dan Bernstein.

        * css/CSSCrossfadeValue.h: Initializing CachedResourceHandle with 0 requires a
        definition of a class it holds, but default construction does not.

        * rendering/RenderImageResource.cpp:
        * rendering/RenderImageResource.h:
        Moved definitions of virtual functions to a .cpp file. There is no win from having
        them inline, and now we don't need CachedImage.h in the header.

        * bindings/js/JSNodeCustom.cpp:
        * dom/Clipboard.cpp:
        (WebCore::Clipboard::Clipboard):
        * platform/mac/ClipboardMac.h:
        * rendering/InlineFlowBox.cpp:
        * rendering/RenderBox.cpp:
        * rendering/RenderListItem.cpp:
        * rendering/RenderListMarker.cpp:
        * rendering/RenderTableCol.cpp:
        * rendering/RenderTableRow.cpp:
        * rendering/RenderTableSection.cpp:
        * svg/graphics/SVGImageCache.cpp:
        Removed unnecessary includes.

        * platform/mac/PasteboardMac.mm:
        * rendering/RenderSnapshottedPlugIn.cpp:
        Added ones where they are now necessary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/css/CSSCrossfadeValue.h
Source/WebCore/dom/Clipboard.cpp
Source/WebCore/platform/mac/ClipboardMac.h
Source/WebCore/platform/mac/PasteboardMac.mm
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderImageResource.h
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderTableCol.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/svg/graphics/SVGImageCache.cpp

index a002f1a..ca3d775 100644 (file)
@@ -1,3 +1,36 @@
+2013-04-10  Alexey Proskuryakov  <ap@apple.com>
+
+        Remove some includes of CachedImage.h
+        https://bugs.webkit.org/show_bug.cgi?id=114411
+
+        Reviewed by Dan Bernstein.
+
+        * css/CSSCrossfadeValue.h: Initializing CachedResourceHandle with 0 requires a
+        definition of a class it holds, but default construction does not.
+
+        * rendering/RenderImageResource.cpp:
+        * rendering/RenderImageResource.h:
+        Moved definitions of virtual functions to a .cpp file. There is no win from having
+        them inline, and now we don't need CachedImage.h in the header.
+
+        * bindings/js/JSNodeCustom.cpp:
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::Clipboard):
+        * platform/mac/ClipboardMac.h:
+        * rendering/InlineFlowBox.cpp:
+        * rendering/RenderBox.cpp:
+        * rendering/RenderListItem.cpp:
+        * rendering/RenderListMarker.cpp:
+        * rendering/RenderTableCol.cpp:
+        * rendering/RenderTableRow.cpp:
+        * rendering/RenderTableSection.cpp:
+        * svg/graphics/SVGImageCache.cpp:
+        Removed unnecessary includes.
+
+        * platform/mac/PasteboardMac.mm:
+        * rendering/RenderSnapshottedPlugIn.cpp:
+        Added ones where they are now necessary.
+
 2013-04-10  No'am Rosenthal  <noam@webkit.org>
 
         Allow direct compositing of background images
index 7124be4..f7a74a7 100644 (file)
@@ -27,8 +27,6 @@
 #include "JSNode.h"
 
 #include "Attr.h"
-#include "CachedImage.h"
-#include "CachedScript.h"
 #include "CDATASection.h"
 #include "Comment.h"
 #include "Document.h"
index fc2e8c8..8cea24f 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef CSSCrossfadeValue_h
 #define CSSCrossfadeValue_h
 
-#include "CachedImage.h"
 #include "CachedImageClient.h"
 #include "CachedResourceHandle.h"
 #include "CSSImageGeneratorValue.h"
@@ -75,15 +74,17 @@ private:
         : CSSImageGeneratorValue(CrossfadeClass)
         , m_fromValue(fromValue)
         , m_toValue(toValue)
-        , m_cachedFromImage(0)
-        , m_cachedToImage(0)
-        , m_crossfadeSubimageObserver(this) { }
+        , m_crossfadeSubimageObserver(this)
+    {
+    }
 
     class CrossfadeSubimageObserverProxy : public CachedImageClient {
     public:
         CrossfadeSubimageObserverProxy(CSSCrossfadeValue* ownerValue)
-        : m_ownerValue(ownerValue)
-        , m_ready(false) { }
+            : m_ownerValue(ownerValue)
+            , m_ready(false)
+        {
+        }
 
         virtual ~CrossfadeSubimageObserverProxy() { }
         virtual void imageChanged(CachedImage*, const IntRect* = 0) OVERRIDE;
index 6910f95..b2c0716 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "Clipboard.h"
 
-#include "CachedImage.h"
 #include "FileList.h"
 #include "Frame.h"
 #include "FrameLoader.h"
@@ -40,7 +39,6 @@ Clipboard::Clipboard(ClipboardAccessPolicy policy, ClipboardType clipboardType)
     , m_effectAllowed("uninitialized")
     , m_dragStarted(false)
     , m_clipboardType(clipboardType)
-    , m_dragImage(0)
 {
 }
     
index 305a92f..df35137 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef ClipboardMac_h
 #define ClipboardMac_h
 
-#include "CachedImage.h"
 #include "CachedImageClient.h"
 #include "Clipboard.h"
 #include <wtf/RetainPtr.h>
index e4952d7..c380771 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "Pasteboard.h"
 
-#import "CachedResource.h"
+#import "CachedImage.h"
 #import "ClipboardMac.h"
 #import "DOMRangeInternal.h"
 #import "Document.h"
index 2f419b9..58d399e 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #include "InlineFlowBox.h"
 
-#include "CachedImage.h"
 #include "CSSPropertyNames.h"
 #include "Document.h"
 #include "EllipsisBox.h"
index 0b96d2a..583386f 100644 (file)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "RenderBox.h"
 
-#include "CachedImage.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "Document.h"
index 91b3aac..a0b46d3 100644 (file)
@@ -37,7 +37,6 @@ namespace WebCore {
 
 RenderImageResource::RenderImageResource()
     : m_renderer(0)
-    , m_cachedImage(0)
 {
 }
 
@@ -90,6 +89,16 @@ void RenderImageResource::resetAnimation()
         m_renderer->repaint();
 }
 
+PassRefPtr<Image> RenderImageResource::image(int, int) const
+{
+    return m_cachedImage ? m_cachedImage->imageForRenderer(m_renderer) : nullImage();
+}
+
+bool RenderImageResource::errorOccurred() const
+{
+    return m_cachedImage && m_cachedImage->errorOccurred();
+}
+
 void RenderImageResource::setContainerSizeForRenderer(const IntSize& imageContainerSize)
 {
     ASSERT(m_renderer);
@@ -102,4 +111,24 @@ Image* RenderImageResource::nullImage()
     return Image::nullImage();
 }
 
+bool RenderImageResource::usesImageContainerSize() const
+{
+    return m_cachedImage ? m_cachedImage->usesImageContainerSize() : false;
+}
+
+bool RenderImageResource::imageHasRelativeWidth() const
+{
+    return m_cachedImage ? m_cachedImage->imageHasRelativeWidth() : false;
+}
+
+bool RenderImageResource::imageHasRelativeHeight() const
+{
+    return m_cachedImage ? m_cachedImage->imageHasRelativeHeight() : false;
+}
+
+LayoutSize RenderImageResource::imageSize(float multiplier) const
+{
+    return m_cachedImage ? m_cachedImage->imageSizeForRenderer(m_renderer, multiplier) : LayoutSize();
+}
+
 } // namespace WebCore
index 4bc6e97..28dbd31 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef RenderImageResource_h
 #define RenderImageResource_h
 
-#include "CachedImage.h"
 #include "CachedResourceHandle.h"
 #include "Image.h"
 #include "LayoutSize.h"
@@ -55,15 +54,15 @@ public:
 
     void resetAnimation();
 
-    virtual PassRefPtr<Image> image(int /* width */ = 0, int /* height */ = 0) const { return m_cachedImage ? m_cachedImage->imageForRenderer(m_renderer) : nullImage(); }
-    virtual bool errorOccurred() const { return m_cachedImage && m_cachedImage->errorOccurred(); }
+    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const;
+    virtual bool errorOccurred() const;
 
     virtual void setContainerSizeForRenderer(const IntSize&);
-    virtual bool usesImageContainerSize() const { return m_cachedImage ? m_cachedImage->usesImageContainerSize() : false; }
-    virtual bool imageHasRelativeWidth() const { return m_cachedImage ? m_cachedImage->imageHasRelativeWidth() : false; }
-    virtual bool imageHasRelativeHeight() const { return m_cachedImage ? m_cachedImage->imageHasRelativeHeight() : false; }
+    virtual bool usesImageContainerSize() const;
+    virtual bool imageHasRelativeWidth() const;
+    virtual bool imageHasRelativeHeight() const;
 
-    virtual LayoutSize imageSize(float multiplier) const { return m_cachedImage ? m_cachedImage->imageSizeForRenderer(m_renderer, multiplier) : LayoutSize(); }
+    virtual LayoutSize imageSize(float multiplier) const;
 
     virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); }
 
index 111e6bd..53d6d27 100644 (file)
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "RenderListItem.h"
 
-#include "CachedImage.h"
 #include "HTMLNames.h"
 #include "HTMLOListElement.h"
 #include "NodeTraversal.h"
index cd21cea..56a2e4a 100644 (file)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "RenderListMarker.h"
 
-#include "CachedImage.h"
 #include "Document.h"
 #include "Font.h"
 #include "GraphicsContext.h"
index eaa78db..ef799dc 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "RenderSnapshottedPlugIn.h"
 
+#include "CachedImage.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "Cursor.h"
index 4d70e42..700fe60 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "RenderTableCol.h"
 
-#include "CachedImage.h"
 #include "HTMLNames.h"
 #include "HTMLTableColElement.h"
 #include "RenderTable.h"
index 93c384c..1ed4350 100644 (file)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "RenderTableRow.h"
 
-#include "CachedImage.h"
 #include "Document.h"
 #include "HTMLNames.h"
 #include "HitTestResult.h"
index ff8e33f..f00b950 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "config.h"
 #include "RenderTableSection.h"
-#include "CachedImage.h"
 #include "Document.h"
 #include "HitTestResult.h"
 #include "HTMLNames.h"
index a8f9c0d..7c98e1b 100644 (file)
@@ -22,7 +22,6 @@
 #include "SVGImageCache.h"
 
 #if ENABLE(SVG)
-#include "CachedImage.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"