Bug 903283: Don't include EventTarget.h in headers r=Ms2ger
authorDavid Zbarsky <dzbarsky@gmail.com>
Mon, 19 Aug 2013 06:15:55 -0400
changeset 156008 d608711909f43b57154ce4ba11a45c656c95b826
parent 155958 9b4c4e56f4bb76d04bd2119bd08d05cd03316823
child 156009 5b5a0de73c74fcdfc414627358b45c795f3faecc
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs903283
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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/generic/nsIFrame.h
layout/printing/nsPrintPreviewListener.cpp
layout/printing/nsPrintPreviewListener.h
security/manager/ssl/src/PSMContentDownloader.h
security/manager/ssl/src/nsNSSComponent.h
widget/gonk/nsWindow.h
widget/nsGUIEvent.h
widget/nsIWidget.h
widget/nsIWidgetListener.h
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.h
--- a/content/events/src/Touch.cpp
+++ b/content/events/src/Touch.cpp
@@ -1,26 +1,83 @@
 /* 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 +112,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/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -17,16 +17,17 @@
 
 /* nsIFrame is in the process of being deCOMtaminated, i.e., this file is eventually
    going to be eliminated, and all callers will use nsFrame instead.  At the moment
    we're midway through this process, so you will see inlined functions and member
    variables in this file.  -dwh */
 
 #include <stdio.h>
 #include "nsQueryFrame.h"
+#include "nsRegion.h"
 #include "nsStyleContext.h"
 #include "nsStyleStruct.h"
 #include "nsStyleStructFwd.h"
 #include "nsHTMLReflowMetrics.h"
 #include "nsFrameList.h"
 #include "nsIContent.h"
 #include "nsAlgorithm.h"
 #include "mozilla/layout/FrameChildList.h"
--- 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/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -12,16 +12,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #ifndef nsWindow_h
 #define nsWindow_h
 
 #include "nsBaseWidget.h"
+#include "nsRegion.h"
 #include "nsIIdleServiceInternal.h"
 
 extern nsIntRect gScreenBounds;
 
 namespace mozilla {
 namespace gl {
 class GLContext;
 }
--- 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
@@ -4,21 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsIWidget_h__
 #define nsIWidget_h__
 
 #include "nsISupports.h"
 #include "nsColor.h"
 #include "nsRect.h"
-#include "nsStringGlue.h"
 
 #include "nsEvent.h"
 #include "nsCOMPtr.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:
 
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1,13 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/DebugOnly.h"
 #include "mozilla/Util.h"
 
 #include "KeyboardLayout.h"
 #include "nsIMM32Handler.h"
 
 #include "nsMemory.h"
 #include "nsToolkit.h"
 #include "nsQuickSort.h"
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -18,16 +18,17 @@
 #include "nsToolkit.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsEvent.h"
 #include "gfxWindowsSurface.h"
 #include "nsWindowDbg.h"
 #include "cairo.h"
 #include "nsITimer.h"
+#include "nsRegion.h"
 #include "mozilla/TimeStamp.h"
 
 #ifdef CAIRO_HAS_D2D_SURFACE
 #include "gfxD2DSurface.h"
 #endif
 
 #include "nsWinGesture.h"
 
@@ -47,16 +48,17 @@
 
 /**
  * Forward class definitions
  */
 
 class nsNativeDragTarget;
 class nsIRollupListener;
 class nsIFile;
+class nsIntRegion;
 class imgIContainer;
 
 namespace mozilla {
 namespace widget {
 class NativeKey;
 class ModifierKeyState;
 struct MSGResult;
 } // namespace widget