Commit 569b13f7 authored by darin@apple.com's avatar darin@apple.com

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 08fec633
2013-02-18 Darin Adler <darin@apple.com>
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 <darin@apple.com>
StringHasher functions require alignment that call sites do not all guarantee
......@@ -73,6 +73,7 @@ __ZN7WebCore10CredentialC1Ev
__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
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include "ClipboardEvent.h"
#include "Clipboard.h"
#include "EventNames.h"
namespace WebCore {
......
......@@ -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 @@ namespace WebCore {
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;
};
......
......@@ -33,8 +33,6 @@
#if ENABLE(DATA_TRANSFER_ITEMS)
#include "Clipboard.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
......
......@@ -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 @@ PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRef
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)
......
......@@ -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 @@ public:
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);
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include "WheelEvent.h"
#include "Clipboard.h"
#include "EventDispatcher.h"
#include "EventNames.h"
#include "PlatformWheelEvent.h"
......
......@@ -30,6 +30,8 @@
namespace WebCore {
class PlatformWheelEvent;
struct WheelEventInit : public MouseEventInit {
WheelEventInit();
......
......@@ -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"
......
......@@ -53,8 +53,6 @@
#include "ResourceResponse.h"
#include "ScriptFunctionCall.h"
#include "UserGestureIndicator.h"
#include <wtf/RefPtr.h>
#include <wtf/StdLibExtras.h>
using namespace std;
......
......@@ -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"
......
......@@ -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 @@ namespace WebCore {
class AutoscrollController;
class Clipboard;
class Document;
class Element;
class Event;
class EventTarget;
class FloatPoint;
......@@ -80,6 +82,8 @@ class VisibleSelection;
class WheelEvent;
class Widget;
struct DragState;
#if ENABLE(GESTURE_EVENTS)
class PlatformGestureEvent;
#endif
......
2013-02-18 Darin Adler <darin@apple.com>
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 <ap@apple.com>
Reduce amount of rebuilding when touching networking headers
......
2013-02-18 Darin Adler <darin@apple.com>
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 <bpoulain@apple.com>
Move computedStyleIncludingVisitedInfo from TestRunner to Internals
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment