Bug 903283: Don't include EventTarget.h in headers r=Ms2ger
☠☠ backed out by 29c341748a6b ☠ ☠
authorDavid Zbarsky <dzbarsky@gmail.com>
Fri, 09 Aug 2013 21:17:52 -0400
changeset 142156 ea0f2d537a407efbaf6e2617ca89e878109f5690
parent 142155 08a81efba1ec0a462567d8137413d58492ad7a7b
child 142157 b5c2851c903cbe73d442e31f79cb5d2afe047319
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersMs2ger
bugs903283
milestone26.0a1
Bug 903283: Don't include EventTarget.h in headers r=Ms2ger
content/events/src/Touch.cpp
content/events/src/Touch.h
content/events/src/nsDOMEvent.h
content/events/src/nsEventListenerManager.h
content/events/src/nsEventListenerService.h
layout/printing/nsPrintPreviewListener.cpp
layout/printing/nsPrintPreviewListener.h
security/manager/ssl/src/PSMContentDownloader.h
security/manager/ssl/src/nsNSSComponent.h
widget/nsGUIEvent.h
widget/nsIWidget.h
widget/nsIWidgetListener.h
--- a/content/events/src/Touch.cpp
+++ b/content/events/src/Touch.cpp
@@ -1,26 +1,82 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/Touch.h"
 
+#include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/TouchBinding.h"
 #include "mozilla/Preferences.h"
-#include "nsContentUtils.h"
 #include "nsDOMTouchEvent.h"
-#include "nsGUIEvent.h"
 #include "nsPresContext.h"
 
 namespace mozilla {
 namespace dom {
 
-/* static */ bool
+Touch::Touch(mozilla::dom::EventTarget* aTarget,
+             int32_t aIdentifier,
+             int32_t aPageX,
+             int32_t aPageY,
+             int32_t aScreenX,
+             int32_t aScreenY,
+             int32_t aClientX,
+             int32_t aClientY,
+             int32_t aRadiusX,
+             int32_t aRadiusY,
+             float aRotationAngle,
+             float aForce)
+{
+  SetIsDOMBinding();
+  mTarget = aTarget;
+  mIdentifier = aIdentifier;
+  mPagePoint = CSSIntPoint(aPageX, aPageY);
+  mScreenPoint = nsIntPoint(aScreenX, aScreenY);
+  mClientPoint = CSSIntPoint(aClientX, aClientY);
+  mRefPoint = nsIntPoint(0, 0);
+  mPointsInitialized = true;
+  mRadius.x = aRadiusX;
+  mRadius.y = aRadiusY;
+  mRotationAngle = aRotationAngle;
+  mForce = aForce;
+
+  mChanged = false;
+  mMessage = 0;
+  nsJSContext::LikelyShortLivingObjectCreated();
+}
+
+Touch::Touch(int32_t aIdentifier,
+             nsIntPoint aPoint,
+             nsIntPoint aRadius,
+             float aRotationAngle,
+             float aForce)
+{
+  SetIsDOMBinding();
+  mIdentifier = aIdentifier;
+  mPagePoint = CSSIntPoint(0, 0);
+  mScreenPoint = nsIntPoint(0, 0);
+  mClientPoint = CSSIntPoint(0, 0);
+  mRefPoint = aPoint;
+  mPointsInitialized = false;
+  mRadius = aRadius;
+  mRotationAngle = aRotationAngle;
+  mForce = aForce;
+
+  mChanged = false;
+  mMessage = 0;
+  nsJSContext::LikelyShortLivingObjectCreated();
+}
+
+Touch::~Touch()
+{
+}
+
+ /* static */ bool
 Touch::PrefEnabled()
 {
   return nsDOMTouchEvent::PrefEnabled();
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(Touch, mTarget)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Touch)
@@ -55,16 +111,22 @@ Touch::InitializePoints(nsPresContext* a
   mPagePoint = nsDOMEvent::GetPageCoords(
     aPresContext, aEvent, LayoutDeviceIntPoint::FromUntyped(mRefPoint),
     mClientPoint);
   mScreenPoint = nsDOMEvent::GetScreenCoords(aPresContext, aEvent,
     LayoutDeviceIntPoint::FromUntyped(mRefPoint));
   mPointsInitialized = true;
 }
 
+void
+Touch::SetTarget(mozilla::dom::EventTarget* aTarget)
+{
+  mTarget = aTarget;
+}
+
 bool
 Touch::Equals(Touch* aTouch)
 {
   return mRefPoint == aTouch->mRefPoint &&
          mForce == aTouch->Force() &&
          mRotationAngle == aTouch->RotationAngle() &&
          mRadius.x == aTouch->RadiusX() &&
          mRadius.y == aTouch->RadiusY();
--- a/content/events/src/Touch.h
+++ b/content/events/src/Touch.h
@@ -1,27 +1,28 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_Touch_h
 #define mozilla_dom_Touch_h
 
-#include "nsString.h"
-#include "nsTArray.h"
 #include "mozilla/Attributes.h"
-#include "nsJSEnvironment.h"
 #include "nsWrapperCache.h"
-#include "mozilla/dom/EventTarget.h"
 #include "Units.h"
 
+class nsPresContext;
+class nsEvent;
+
 namespace mozilla {
 namespace dom {
 
+class EventTarget;
+
 class Touch MOZ_FINAL : public nsISupports
                       , public nsWrapperCache
 {
 public:
   static bool PrefEnabled();
 
   Touch(mozilla::dom::EventTarget* aTarget,
         int32_t aIdentifier,
@@ -29,65 +30,32 @@ public:
         int32_t aPageY,
         int32_t aScreenX,
         int32_t aScreenY,
         int32_t aClientX,
         int32_t aClientY,
         int32_t aRadiusX,
         int32_t aRadiusY,
         float aRotationAngle,
-        float aForce)
-    {
-      SetIsDOMBinding();
-      mTarget = aTarget;
-      mIdentifier = aIdentifier;
-      mPagePoint = CSSIntPoint(aPageX, aPageY);
-      mScreenPoint = nsIntPoint(aScreenX, aScreenY);
-      mClientPoint = CSSIntPoint(aClientX, aClientY);
-      mRefPoint = nsIntPoint(0, 0);
-      mPointsInitialized = true;
-      mRadius.x = aRadiusX;
-      mRadius.y = aRadiusY;
-      mRotationAngle = aRotationAngle;
-      mForce = aForce;
-
-      mChanged = false;
-      mMessage = 0;
-      nsJSContext::LikelyShortLivingObjectCreated();
-    }
+        float aForce);
   Touch(int32_t aIdentifier,
         nsIntPoint aPoint,
         nsIntPoint aRadius,
         float aRotationAngle,
-        float aForce)
-    {
-      SetIsDOMBinding();
-      mIdentifier = aIdentifier;
-      mPagePoint = CSSIntPoint(0, 0);
-      mScreenPoint = nsIntPoint(0, 0);
-      mClientPoint = CSSIntPoint(0, 0);
-      mRefPoint = aPoint;
-      mPointsInitialized = false;
-      mRadius = aRadius;
-      mRotationAngle = aRotationAngle;
-      mForce = aForce;
+        float aForce);
 
-      mChanged = false;
-      mMessage = 0;
-      nsJSContext::LikelyShortLivingObjectCreated();
-    }
+  ~Touch();
+
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
 
   void InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent);
 
-  void SetTarget(mozilla::dom::EventTarget *aTarget)
-  {
-    mTarget = aTarget;
-  }
+  void SetTarget(mozilla::dom::EventTarget* aTarget);
+
   bool Equals(Touch* aTouch);
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
   EventTarget* GetParentObject() { return mTarget; }
 
   // WebIDL
   int32_t Identifier() const { return mIdentifier; }
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -5,32 +5,37 @@
 
 #ifndef nsDOMEvent_h__
 #define nsDOMEvent_h__
 
 #include "mozilla/Attributes.h"
 #include "nsIDOMEvent.h"
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
-#include "nsIDOMEventTarget.h"
 #include "nsPIDOMWindow.h"
 #include "nsPoint.h"
 #include "nsGUIEvent.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsAutoPtr.h"
-#include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/EventBinding.h"
 #include "nsIScriptGlobalObject.h"
 #include "Units.h"
 
 class nsIContent;
+class nsIDOMEventTarget;
 class nsPresContext;
 struct JSContext;
 class JSObject;
 
+namespace mozilla {
+namespace dom {
+class EventTarget;
+}
+}
+
 // Dummy class so we can cast through it to get from nsISupports to
 // nsDOMEvent subclasses with only two non-ambiguous static casts.
 class nsDOMEventBase : public nsIDOMEvent
 {
 };
 
 class nsDOMEvent : public nsDOMEventBase,
                    public nsWrapperCache
--- a/content/events/src/nsEventListenerManager.h
+++ b/content/events/src/nsEventListenerManager.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsEventListenerManager_h__
 #define nsEventListenerManager_h__
 
 #include "jsapi.h"
 #include "mozilla/dom/EventListenerBinding.h"
-#include "mozilla/dom/EventTarget.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsCxPusher.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsGkAtoms.h"
 #include "nsGUIEvent.h"
@@ -33,16 +32,18 @@ class nsCxPusher;
 class nsIEventListenerInfo;
 
 struct nsListenerStruct;
 class nsEventListenerManager;
 
 namespace mozilla {
 namespace dom {
 
+class EventTarget;
+
 typedef CallbackObjectHolder<EventListener, nsIDOMEventListener>
   EventListenerHolder;
 
 struct EventListenerFlags
 {
   friend struct ::nsListenerStruct;
   friend class  ::nsEventListenerManager;
 private:
--- a/content/events/src/nsEventListenerService.h
+++ b/content/events/src/nsEventListenerService.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsEventListenerService_h__
 #define nsEventListenerService_h__
 #include "nsIEventListenerService.h"
 #include "nsAutoPtr.h"
 #include "nsIDOMEventListener.h"
-#include "nsIDOMEventTarget.h"
 #include "nsString.h"
 #include "nsCycleCollectionParticipant.h"
 #include "jsapi.h"
 #include "mozilla/Attributes.h"
 
 
 class nsEventListenerInfo : public nsIEventListenerInfo
 {
--- a/layout/printing/nsPrintPreviewListener.cpp
+++ b/layout/printing/nsPrintPreviewListener.cpp
@@ -29,16 +29,19 @@ NS_IMPL_ISUPPORTS1(nsPrintPreviewListene
 // nsPrintPreviewListener ctor
 //
 nsPrintPreviewListener::nsPrintPreviewListener(EventTarget* aTarget)
   : mEventTarget(aTarget)
 {
   NS_ADDREF_THIS();
 } // ctor
 
+nsPrintPreviewListener::~nsPrintPreviewListener()
+{
+}
 
 //-------------------------------------------------------
 //
 // AddListeners
 //
 // Subscribe to the events that will allow us to track various events. 
 //
 nsresult
--- a/layout/printing/nsPrintPreviewListener.h
+++ b/layout/printing/nsPrintPreviewListener.h
@@ -4,37 +4,43 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrintPreviewListener_h__
 #define nsPrintPreviewListener_h__
 
 // Interfaces needed to be included
 #include "nsIDOMEventListener.h"
-#include "mozilla/dom/EventTarget.h"
 // Helper Classes
 #include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
 
+namespace mozilla {
+namespace dom {
+class EventTarget;
+}
+}
+
 //
 // class nsPrintPreviewListener
 //
 // The class that listens to the chrome events and tells the embedding
 // chrome to show context menus, as appropriate. Handles registering itself
 // with the DOM with AddChromeListeners() and removing itself with
 // RemoveChromeListeners().
 //
 class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener
 
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 
   nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget);
+  ~nsPrintPreviewListener();
 
   // Add/remove the relevant listeners, based on what interfaces
   // the embedding chrome implements.
   nsresult AddListeners();
   nsresult RemoveListeners();
 
 private:
 
--- a/security/manager/ssl/src/PSMContentDownloader.h
+++ b/security/manager/ssl/src/PSMContentDownloader.h
@@ -15,17 +15,16 @@
 #include "nsIStreamListener.h"
 #include "nsIEntropyCollector.h"
 #include "nsIStringBundle.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsWeakReference.h"
 #ifndef MOZ_DISABLE_CRYPTOLEGACY
-#include "nsIDOMEventTarget.h"
 #endif
 #include "nsINSSErrorsService.h"
 #include "nsNetUtil.h"
 #include "nsNSSCallbacks.h"
 #include "ScopedNSSTypes.h"
 #include "nsNSSHelper.h"
 #include "nsClientAuthRemember.h"
 #include "prerror.h"
--- a/security/manager/ssl/src/nsNSSComponent.h
+++ b/security/manager/ssl/src/nsNSSComponent.h
@@ -12,25 +12,25 @@
 #include "nsCOMPtr.h"
 #include "nsISignatureVerifier.h"
 #include "nsIEntropyCollector.h"
 #include "nsIStringBundle.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #ifndef MOZ_DISABLE_CRYPTOLEGACY
-#include "nsIDOMEventTarget.h"
 #endif
 #include "nsINSSErrorsService.h"
 #include "nsNSSCallbacks.h"
 #include "ScopedNSSTypes.h"
 #include "nsNSSHelper.h"
 #include "nsClientAuthRemember.h"
 #include "prerror.h"
 
+class nsIDOMWindow;
 class nsIPrompt;
 class SmartCardThreadList;
 
 namespace mozilla { namespace psm {
 
 class CertVerifier;
 
 } } // namespace mozilla::psm
--- a/widget/nsGUIEvent.h
+++ b/widget/nsGUIEvent.h
@@ -3,34 +3,31 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsGUIEvent_h__
 #define nsGUIEvent_h__
 
 #include "mozilla/MathAlgorithms.h"
 
-#include "nsCOMArray.h"
 #include "nsPoint.h"
 #include "nsRect.h"
-#include "nsRegion.h"
 #include "nsEvent.h"
 #include "nsStringGlue.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMWheelEvent.h"
 #include "nsIDOMDataTransfer.h"
 #include "nsWeakPtr.h"
 #include "nsIWidget.h"
 #include "nsTArray.h"
 #include "nsTraceRefcnt.h"
 #include "nsITransferable.h"
-#include "nsIVariant.h"
 #include "nsStyleConsts.h"
 #include "nsAutoPtr.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/Touch.h"
 #include "Units.h"
 
 namespace mozilla {
 namespace dom {
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -6,24 +6,23 @@
 #ifndef nsIWidget_h__
 #define nsIWidget_h__
 
 #include "nsISupports.h"
 #include "nsColor.h"
 #include "nsCoord.h"
 #include "nsRect.h"
 #include "nsPoint.h"
-#include "nsStringGlue.h"
 
-#include "prthread.h"
 #include "nsEvent.h"
 #include "nsCOMPtr.h"
 #include "nsITheme.h"
 #include "nsNativeWidget.h"
 #include "nsWidgetInitData.h"
+#include "nsString.h"
 #include "nsTArray.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/RefPtr.h"
 
 // forward declarations
 class   nsFontMetrics;
 class   nsRenderingContext;
--- a/widget/nsIWidgetListener.h
+++ b/widget/nsIWidgetListener.h
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsIWidgetListener_h__
 #define nsIWidgetListener_h__
 
 #include "nscore.h"
 #include "nsGUIEvent.h"
 #include "nsIXULWindow.h"
+#include "nsRegion.h"
 
 class nsView;
 class nsIPresShell;
 
 class nsIWidgetListener
 {
 public: