Bug 975688 part.25 Rename nsDOMScrollAreaEvent to mozilla::dom::ScrollAreaEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 28 Feb 2014 23:58:43 +0900
changeset 171523 8c632b315211129b7671efff5f1b455ef21b8f32
parent 171522 e711121154fb15f0ad3fbc579795f54ccfaaaf82
child 171524 5db48f8fadb90d3d7d9e9d60c5e78725421dcc55
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.25 Rename nsDOMScrollAreaEvent to mozilla::dom::ScrollAreaEvent r=smaug
dom/bindings/Bindings.conf
dom/events/ScrollAreaEvent.cpp
dom/events/ScrollAreaEvent.h
dom/events/moz.build
dom/events/nsDOMScrollAreaEvent.cpp
dom/events/nsDOMScrollAreaEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -921,20 +921,16 @@ DOMInterfaces = {
     'nativeType': 'nsDOMCSSRGBColor',
     'resultNotAddRefed': [ 'alpha', 'blue', 'green', 'red' ]
 },
 
 'Screen': {
     'nativeType': 'nsScreen',
 },
 
-'ScrollAreaEvent': {
-    'nativeType': 'nsDOMScrollAreaEvent',
-},
-
 'Selection': {
     'nativeType': 'mozilla::Selection',
     'resultNotAddRefed': [ 'anchorNode', 'focusNode', 'getRangeAt' ],
 },
 
 'ShadowRoot': {
     'resultNotAddRefed': [
         'styleSheets'
rename from dom/events/nsDOMScrollAreaEvent.cpp
rename to dom/events/ScrollAreaEvent.cpp
--- a/dom/events/nsDOMScrollAreaEvent.cpp
+++ b/dom/events/ScrollAreaEvent.cpp
@@ -1,102 +1,109 @@
 /* -*- 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 "base/basictypes.h"
 #include "ipc/IPCMessageUtils.h"
+#include "mozilla/dom/DOMRect.h"
+#include "mozilla/dom/ScrollAreaEvent.h"
 #include "mozilla/ContentEvents.h"
 
-#include "nsDOMScrollAreaEvent.h"
-#include "mozilla/dom/DOMRect.h"
+namespace mozilla {
+namespace dom {
 
-using namespace mozilla;
-
-nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
-                                           nsPresContext *aPresContext,
-                                           InternalScrollAreaEvent* aEvent)
+ScrollAreaEvent::ScrollAreaEvent(EventTarget* aOwner,
+                                 nsPresContext* aPresContext,
+                                 InternalScrollAreaEvent* aEvent)
   : nsDOMUIEvent(aOwner, aPresContext, aEvent)
   , mClientArea(nullptr)
 {
   mClientArea.SetLayoutRect(aEvent ? aEvent->mArea : nsRect());
 }
 
-NS_IMPL_ADDREF_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMScrollAreaEvent, nsDOMUIEvent)
+NS_IMPL_ADDREF_INHERITED(ScrollAreaEvent, nsDOMUIEvent)
+NS_IMPL_RELEASE_INHERITED(ScrollAreaEvent, nsDOMUIEvent)
 
-NS_INTERFACE_MAP_BEGIN(nsDOMScrollAreaEvent)
+NS_INTERFACE_MAP_BEGIN(ScrollAreaEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMScrollAreaEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
 
 
-#define FORWARD_GETTER(_name)                                                   \
-  NS_IMETHODIMP                                                                 \
-  nsDOMScrollAreaEvent::Get ## _name(float* aResult)                            \
-  {                                                                             \
-    *aResult = _name();                                                         \
-    return NS_OK;                                                               \
+#define FORWARD_GETTER(_name)                                                  \
+  NS_IMETHODIMP                                                                \
+  ScrollAreaEvent::Get ## _name(float* aResult)                                \
+  {                                                                            \
+    *aResult = _name();                                                        \
+    return NS_OK;                                                              \
   }
 
 FORWARD_GETTER(X)
 FORWARD_GETTER(Y)
 FORWARD_GETTER(Width)
 FORWARD_GETTER(Height)
 
 NS_IMETHODIMP
-nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
-                                          bool aCanBubble,
-                                          bool aCancelable,
-                                          nsIDOMWindow *aView,
-                                          int32_t aDetail,
-                                          float aX, float aY,
-                                          float aWidth, float aHeight)
+ScrollAreaEvent::InitScrollAreaEvent(const nsAString& aEventType,
+                                     bool aCanBubble,
+                                     bool aCancelable,
+                                     nsIDOMWindow* aView,
+                                     int32_t aDetail,
+                                     float aX,
+                                     float aY,
+                                     float aWidth,
+                                     float aHeight)
 {
   nsresult rv = nsDOMUIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mClientArea.SetRect(aX, aY, aWidth, aHeight);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP_(void)
-nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
-                                bool aSerializeInterfaceType)
+ScrollAreaEvent::Serialize(IPC::Message* aMsg,
+                           bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
   }
 
   nsDOMEvent::Serialize(aMsg, false);
 
   IPC::WriteParam(aMsg, X());
   IPC::WriteParam(aMsg, Y());
   IPC::WriteParam(aMsg, Width());
   IPC::WriteParam(aMsg, Height());
 }
 
 NS_IMETHODIMP_(bool)
-nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
+ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
 {
   NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false);
 
   float x, y, width, height;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height), false);
   mClientArea.SetRect(x, y, width, height);
 
   return true;
 }
 
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
 nsresult
-NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
-                         mozilla::dom::EventTarget* aOwner,
-                         nsPresContext *aPresContext,
+NS_NewDOMScrollAreaEvent(nsIDOMEvent** aInstancePtrResult,
+                         EventTarget* aOwner,
+                         nsPresContext* aPresContext,
                          InternalScrollAreaEvent* aEvent)
 {
-  nsDOMScrollAreaEvent* ev =
-    new nsDOMScrollAreaEvent(aOwner, aPresContext, aEvent);
+  ScrollAreaEvent* ev = new ScrollAreaEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(ev, aInstancePtrResult);
 }
rename from dom/events/nsDOMScrollAreaEvent.h
rename to dom/events/ScrollAreaEvent.h
--- a/dom/events/nsDOMScrollAreaEvent.h
+++ b/dom/events/ScrollAreaEvent.h
@@ -1,33 +1,34 @@
 /* -*- 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/. */
 
-#ifndef nsDOMScrollAreaEvent_h__
-#define nsDOMScrollAreaEvent_h__
+#ifndef mozilla_dom_ScrollAreaEvent_h_
+#define mozilla_dom_ScrollAreaEvent_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsDOMUIEvent.h"
 
 #include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/ScrollAreaEventBinding.h"
 
-class nsDOMScrollAreaEvent : public nsDOMUIEvent,
-                             public nsIDOMScrollAreaEvent
-{
-  typedef mozilla::dom::DOMRect DOMRect;
+namespace mozilla {
+namespace dom {
 
+class ScrollAreaEvent : public nsDOMUIEvent,
+                        public nsIDOMScrollAreaEvent
+{
 public:
-  nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
-                       nsPresContext *aPresContext,
-                       mozilla::InternalScrollAreaEvent* aEvent);
+  ScrollAreaEvent(EventTarget* aOwner,
+                  nsPresContext* aPresContext,
+                  InternalScrollAreaEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMSCROLLAREAEVENT
 
   NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::)
 
   NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
@@ -36,17 +37,17 @@ public:
     return nsDOMEvent::DuplicatePrivateData();
   }
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::ScrollAreaEventBinding::Wrap(aCx, aScope, this);
+    return ScrollAreaEventBinding::Wrap(aCx, aScope, this);
   }
 
   float X() const
   {
     return mClientArea.Left();
   }
 
   float Y() const
@@ -66,19 +67,22 @@ public:
 
   void InitScrollAreaEvent(const nsAString& aType,
                            bool aCanBubble,
                            bool aCancelable,
                            nsIDOMWindow* aView,
                            int32_t aDetail,
                            float aX, float aY,
                            float aWidth, float aHeight,
-                           mozilla::ErrorResult& aRv)
+                           ErrorResult& aRv)
   {
     aRv = InitScrollAreaEvent(aType, aCanBubble, aCancelable, aView,
                               aDetail, aX, aY, aWidth, aHeight);
   }
 
 protected:
   DOMRect mClientArea;
 };
 
-#endif // nsDOMScrollAreaEvent_h__
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_ScrollAreaEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -49,16 +49,17 @@ EXPORTS.mozilla.dom += [
     'KeyboardEvent.h',
     'MessageEvent.h',
     'MouseEvent.h',
     'MouseScrollEvent.h',
     'MutationEvent.h',
     'NotifyAudioAvailableEvent.h',
     'NotifyPaintEvent.h',
     'PointerEvent.h',
+    'ScrollAreaEvent.h',
     'SimpleGestureEvent.h',
     'Touch.h',
     'TouchEvent.h',
     'TransitionEvent.h',
     'WheelEvent.h',
     'XULCommandEvent.h',
 ]
 
@@ -107,26 +108,26 @@ SOURCES += [
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
     'NotifyPaintEvent.cpp',
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
     'nsDOMEvent.cpp',
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
-    'nsDOMScrollAreaEvent.cpp',
-    # nsDOMEvent.cpp should be built separately because it includes
-    # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
     'nsDOMUIEvent.cpp',
     # nsDOMEvent.cpp should be built separately because it includes
     # mozilla/HalSensor.h, which includes ipc/IPCMessageUtils.h, which
     # on Windows includes windows.h.
     'nsEventListenerManager.cpp',
     # nsEventStateManager.cpp should be built separately because of Mac OS X headers.
     'nsEventStateManager.cpp',
+    # nsDOMEvent.cpp should be built separately because it includes
+    # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
+    'ScrollAreaEvent.cpp',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     UNIFIED_SOURCES += ['SpeechRecognitionError.cpp']
 
 FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True