Title: [144553] trunk/Source
Revision
144553
Author
[email protected]
Date
2013-03-02 21:55:53 -0800 (Sat, 02 Mar 2013)

Log Message

Cut down the number of source files that depend on Clipboard.h
https://bugs.webkit.org/show_bug.cgi?id=110030

Reviewed by Ryosuke Niwa.

Source/WebCore:

I am doing some work on Clipboard and it's better to recompile 50 files
each time we touch the header instead of 700. Also cut down on includes
of DragState.h.

* WebCore.exp.in: Updated for new MouseEvent::create function.

* dom/ClipboardEvent.cpp: Added include of Clipboard.h since we use it
here and the world no longer includes it everywhere.

* dom/ClipboardEvent.h: Forward declared Clipboard instead of including
Clipboard.h. Also made some overrides private because they can be.

* dom/DataTransferItem.h: Removed unneeded include of Clipboard.h.

* dom/MouseEvent.cpp: Added include of Clipboard.h since we use it
here and the world no longer includes it everywhere.
(WebCore::MouseEvent::create): Made the create function non-inline
since we can't compile it without including Clipboard.h and we don't
want to include Clipboard.h in the header. This is not so commonly
used or so hot that this needs to be inlined.

* dom/MouseEvent.h: Forward declared Clipboard instead of including
Clipboard.h. Made MouseEvent::create a non-inline function and also
used overloading instead of default arguments, since we can't compile
a default argument of type PassRefPtr<Clipboard> without including
Clipboard.h.

* dom/WheelEvent.cpp: Added include of Clipboard.h since we use it
here and the world no longer includes it everywhere.

* dom/WheelEvent.h: Forward declare PlatformWheelEvent since it is used
in this header. Previously we'd get it indirectly from including a header
that included Clipboard.h.

* editing/Editor.cpp: Added include of Clipboard.h since we use it here
and the world no longer includes it everywhere.

* inspector/InspectorDebuggerAgent.cpp: Added include of CachedResource.h.
We used to get this indirectly through Clipboard.h.

* inspector/InspectorFrontendHost.cpp: Added includes of ResourceError.h
and ResourceResponse.h. We used to get these indirectly through Clipboard.h.
Also removed unneeded include of <wtf/RefPtr.h>.

* inspector/NetworkResourcesData.cpp: Added include of CachedResource.h.
We used to get this indirectly through Clipboard.h.

* loader/PingLoader.cpp: Added include of ResourceResponse.h.
We used to get this indirectly through Clipboard.h.

* page/DragController.cpp: Added include of DragState.h.
We used to get this indirectly through EventHandler.h

* page/EventHandler.h: Forward declared DragState and Element instead of
including DragState.h. Also added an include of LayoutPoint.h, which we
used to get indirectly through DragState.h.

Source/WebKit/chromium:

* src/SharedWorkerRepository.cpp: Add include of ResourceResponse.h
here. We used to get this indirectly through Clipboard.h.

Source/WebKit/mac:

* WebView/WebPDFView.mm: Add include of Clipboard.h since we use it
here and the world no longer includes it everywhere.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (144552 => 144553)


--- trunk/Source/WebCore/ChangeLog	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/ChangeLog	2013-03-03 05:55:53 UTC (rev 144553)
@@ -1,3 +1,67 @@
+2013-02-18  Darin Adler  <[email protected]>
+
+        Cut down the number of source files that depend on Clipboard.h
+        https://bugs.webkit.org/show_bug.cgi?id=110030
+
+        Reviewed by Ryosuke Niwa.
+
+        I am doing some work on Clipboard and it's better to recompile 50 files
+        each time we touch the header instead of 700. Also cut down on includes
+        of DragState.h.
+
+        * WebCore.exp.in: Updated for new MouseEvent::create function.
+
+        * dom/ClipboardEvent.cpp: Added include of Clipboard.h since we use it
+        here and the world no longer includes it everywhere.
+
+        * dom/ClipboardEvent.h: Forward declared Clipboard instead of including
+        Clipboard.h. Also made some overrides private because they can be.
+
+        * dom/DataTransferItem.h: Removed unneeded include of Clipboard.h.
+
+        * dom/MouseEvent.cpp: Added include of Clipboard.h since we use it
+        here and the world no longer includes it everywhere.
+        (WebCore::MouseEvent::create): Made the create function non-inline
+        since we can't compile it without including Clipboard.h and we don't
+        want to include Clipboard.h in the header. This is not so commonly
+        used or so hot that this needs to be inlined.
+
+        * dom/MouseEvent.h: Forward declared Clipboard instead of including
+        Clipboard.h. Made MouseEvent::create a non-inline function and also
+        used overloading instead of default arguments, since we can't compile
+        a default argument of type PassRefPtr<Clipboard> without including
+        Clipboard.h.
+
+        * dom/WheelEvent.cpp: Added include of Clipboard.h since we use it
+        here and the world no longer includes it everywhere.
+
+        * dom/WheelEvent.h: Forward declare PlatformWheelEvent since it is used
+        in this header. Previously we'd get it indirectly from including a header
+        that included Clipboard.h.
+
+        * editing/Editor.cpp: Added include of Clipboard.h since we use it here
+        and the world no longer includes it everywhere.
+
+        * inspector/InspectorDebuggerAgent.cpp: Added include of CachedResource.h.
+        We used to get this indirectly through Clipboard.h.
+
+        * inspector/InspectorFrontendHost.cpp: Added includes of ResourceError.h
+        and ResourceResponse.h. We used to get these indirectly through Clipboard.h.
+        Also removed unneeded include of <wtf/RefPtr.h>.
+
+        * inspector/NetworkResourcesData.cpp: Added include of CachedResource.h.
+        We used to get this indirectly through Clipboard.h.
+
+        * loader/PingLoader.cpp: Added include of ResourceResponse.h.
+        We used to get this indirectly through Clipboard.h.
+
+        * page/DragController.cpp: Added include of DragState.h.
+        We used to get this indirectly through EventHandler.h
+
+        * page/EventHandler.h: Forward declared DragState and Element instead of
+        including DragState.h. Also added an include of LayoutPoint.h, which we
+        used to get indirectly through DragState.h.
+
 2013-02-27  Darin Adler  <[email protected]>
 
         StringHasher functions require alignment that call sites do not all guarantee

Modified: trunk/Source/WebCore/WebCore.exp.in (144552 => 144553)


--- trunk/Source/WebCore/WebCore.exp.in	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/WebCore.exp.in	2013-03-03 05:55:53 UTC (rev 144553)
@@ -73,6 +73,7 @@
 __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
 __ZN7WebCore10JSDocument6s_infoE
 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
+__ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
 __ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
 __ZN7WebCore10RenderView10compositorEv
 __ZN7WebCore10ScrollView17setUseFixedLayoutEb

Modified: trunk/Source/WebCore/dom/ClipboardEvent.cpp (144552 => 144553)


--- trunk/Source/WebCore/dom/ClipboardEvent.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/ClipboardEvent.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "ClipboardEvent.h"
 
+#include "Clipboard.h"
 #include "EventNames.h"
 
 namespace WebCore {

Modified: trunk/Source/WebCore/dom/ClipboardEvent.h (144552 => 144553)


--- trunk/Source/WebCore/dom/ClipboardEvent.h	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/ClipboardEvent.h	2013-03-03 05:55:53 UTC (rev 144553)
@@ -24,11 +24,12 @@
 #ifndef ClipboardEvent_h
 #define ClipboardEvent_h
 
-#include "Clipboard.h"
 #include "Event.h"
 
 namespace WebCore {
 
+    class Clipboard;
+
     class ClipboardEvent : public Event {
     public:
         virtual ~ClipboardEvent();
@@ -44,13 +45,13 @@
 
         Clipboard* clipboard() const { return m_clipboard.get(); }
 
-        virtual const AtomicString& interfaceName() const;
-        virtual bool isClipboardEvent() const;
-
     private:
         ClipboardEvent();
         ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, PassRefPtr<Clipboard>);
 
+        virtual const AtomicString& interfaceName() const OVERRIDE;
+        virtual bool isClipboardEvent() const OVERRIDE;
+
         RefPtr<Clipboard> m_clipboard;
     };
 

Modified: trunk/Source/WebCore/dom/DataTransferItem.h (144552 => 144553)


--- trunk/Source/WebCore/dom/DataTransferItem.h	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/DataTransferItem.h	2013-03-03 05:55:53 UTC (rev 144553)
@@ -33,8 +33,6 @@
 
 #if ENABLE(DATA_TRANSFER_ITEMS)
 
-#include "Clipboard.h"
-
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 

Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (144552 => 144553)


--- trunk/Source/WebCore/dom/MouseEvent.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "MouseEvent.h"
 
+#include "Clipboard.h"
 #include "EventDispatcher.h"
 #include "EventNames.h"
 #include "EventRetargeter.h"
@@ -67,6 +68,39 @@
         relatedTarget, 0, false);
 }
 
+PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view,
+    int detail, int screenX, int screenY, int pageX, int pageY,
+#if ENABLE(POINTER_LOCK)
+    int movementX, int movementY,
+#endif
+    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
+    PassRefPtr<EventTarget> relatedTarget)
+
+{
+    return MouseEvent::create(type, canBubble, cancelable, view,
+        detail, screenX, screenY, pageX, pageY,
+#if ENABLE(POINTER_LOCK)
+        movementX, movementY,
+#endif
+        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, 0, false);
+}
+
+PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view,
+    int detail, int screenX, int screenY, int pageX, int pageY,
+#if ENABLE(POINTER_LOCK)
+    int movementX, int movementY,
+#endif
+    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
+    PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard> clipboard, bool isSimulated)
+{
+    return adoptRef(new MouseEvent(type, canBubble, cancelable, view,
+        detail, screenX, screenY, pageX, pageY,
+#if ENABLE(POINTER_LOCK)
+        movementX, movementY,
+#endif
+        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, clipboard, isSimulated));
+}
+
 MouseEvent::MouseEvent()
     : m_button(0)
     , m_buttonDown(false)

Modified: trunk/Source/WebCore/dom/MouseEvent.h (144552 => 144553)


--- trunk/Source/WebCore/dom/MouseEvent.h	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/MouseEvent.h	2013-03-03 05:55:53 UTC (rev 144553)
@@ -24,12 +24,12 @@
 #ifndef MouseEvent_h
 #define MouseEvent_h
 
-#include "Clipboard.h"
 #include "EventDispatchMediator.h"
 #include "MouseRelatedEvent.h"
 
 namespace WebCore {
 
+class Clipboard;
 class EventDispatcher;
 class PlatformMouseEvent;
 
@@ -55,20 +55,21 @@
         return adoptRef(new MouseEvent);
     }
 
-    static PassRefPtr<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view,
+    static PassRefPtr<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>,
         int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
         int movementX, int movementY,
 #endif
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
-        PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard> clipboard = 0, bool isSimulated = false)
-    {
-        return adoptRef(new MouseEvent(type, canBubble, cancelable, view, detail, screenX, screenY, pageX, pageY,
+        PassRefPtr<EventTarget> relatedTarget);
+
+    static PassRefPtr<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>,
+        int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
-        movementX, movementY,
+        int movementX, int movementY,
 #endif
-        ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, clipboard, isSimulated));
-    }
+        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
+        PassRefPtr<EventTarget> relatedTarget, PassRefPtr<Clipboard>, bool isSimulated = false);
 
     static PassRefPtr<MouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
 

Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (144552 => 144553)


--- trunk/Source/WebCore/dom/WheelEvent.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "WheelEvent.h"
 
+#include "Clipboard.h"
 #include "EventDispatcher.h"
 #include "EventNames.h"
 #include "PlatformWheelEvent.h"

Modified: trunk/Source/WebCore/dom/WheelEvent.h (144552 => 144553)


--- trunk/Source/WebCore/dom/WheelEvent.h	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/dom/WheelEvent.h	2013-03-03 05:55:53 UTC (rev 144553)
@@ -30,6 +30,8 @@
 
 namespace WebCore {
 
+class PlatformWheelEvent;
+
 struct WheelEventInit : public MouseEventInit {
     WheelEventInit();
 

Modified: trunk/Source/WebCore/editing/Editor.cpp (144552 => 144553)


--- trunk/Source/WebCore/editing/Editor.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/editing/Editor.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -34,6 +34,7 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "CachedResourceLoader.h"
+#include "Clipboard.h"
 #include "ClipboardEvent.h"
 #include "CompositionEvent.h"
 #include "CreateLinkCommand.h"

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (144552 => 144553)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -53,8 +53,6 @@
 #include "ResourceResponse.h"
 #include "ScriptFunctionCall.h"
 #include "UserGestureIndicator.h"
-
-#include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 
 using namespace std;

Modified: trunk/Source/WebCore/page/DragController.cpp (144552 => 144553)


--- trunk/Source/WebCore/page/DragController.cpp	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/page/DragController.cpp	2013-03-03 05:55:53 UTC (rev 144553)
@@ -27,6 +27,7 @@
 #include "DragController.h"
 
 #if ENABLE(DRAG_SUPPORT)
+
 #include "CachedImage.h"
 #include "Clipboard.h"
 #include "ClipboardAccessPolicy.h"
@@ -37,6 +38,7 @@
 #include "DragClient.h"
 #include "DragData.h"
 #include "DragSession.h"
+#include "DragState.h"
 #include "Editor.h"
 #include "EditorClient.h"
 #include "Element.h"

Modified: trunk/Source/WebCore/page/EventHandler.h (144552 => 144553)


--- trunk/Source/WebCore/page/EventHandler.h	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebCore/page/EventHandler.h	2013-03-03 05:55:53 UTC (rev 144553)
@@ -28,9 +28,9 @@
 
 #include "Cursor.h"
 #include "DragActions.h"
-#include "DragState.h"
 #include "FocusDirection.h"
 #include "HitTestRequest.h"
+#include "LayoutPoint.h"
 #include "PlatformMouseEvent.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollTypes.h"
@@ -54,6 +54,8 @@
 
 class AutoscrollController;
 class Clipboard;
+class Document;
+class Element;
 class Event;
 class EventTarget;
 class FloatPoint;
@@ -80,6 +82,8 @@
 class WheelEvent;
 class Widget;
 
+struct DragState;
+
 #if ENABLE(GESTURE_EVENTS)
 class PlatformGestureEvent;
 #endif

Modified: trunk/Source/WebKit/chromium/ChangeLog (144552 => 144553)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-03-03 05:55:53 UTC (rev 144553)
@@ -1,3 +1,13 @@
+2013-02-18  Darin Adler  <[email protected]>
+
+        Cut down the number of source files that depend on Clipboard.h
+        https://bugs.webkit.org/show_bug.cgi?id=110030
+
+        Reviewed by Ryosuke Niwa.
+
+        * src/SharedWorkerRepository.cpp: Add include of ResourceResponse.h
+        here. We used to get this indirectly through Clipboard.h.
+
 2013-02-28  Alexey Proskuryakov  <[email protected]>
 
         Reduce amount of rebuilding when touching networking headers

Modified: trunk/Source/WebKit/mac/ChangeLog (144552 => 144553)


--- trunk/Source/WebKit/mac/ChangeLog	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-03-03 05:55:53 UTC (rev 144553)
@@ -1,3 +1,13 @@
+2013-02-18  Darin Adler  <[email protected]>
+
+        Cut down the number of source files that depend on Clipboard.h
+        https://bugs.webkit.org/show_bug.cgi?id=110030
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebPDFView.mm: Add include of Clipboard.h since we use it
+        here and the world no longer includes it everywhere.
+
 2013-03-02  Benjamin Poulain  <[email protected]>
 
         Move computedStyleIncludingVisitedInfo from TestRunner to Internals

Modified: trunk/Source/WebKit/mac/WebView/WebPDFView.mm (144552 => 144553)


--- trunk/Source/WebKit/mac/WebView/WebPDFView.mm	2013-03-03 05:47:27 UTC (rev 144552)
+++ trunk/Source/WebKit/mac/WebView/WebPDFView.mm	2013-03-03 05:55:53 UTC (rev 144553)
@@ -48,6 +48,7 @@
 #import "WebView.h"
 #import "WebViewInternal.h"
 #import <PDFKit/PDFKit.h>
+#import <WebCore/Clipboard.h>
 #import <WebCore/EventNames.h>
 #import <WebCore/FormState.h>
 #import <WebCore/Frame.h>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to