Bug 975688 part.2 Rename nsDOMAnimationEvent to mozilla::dom::AnimationEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 26 Feb 2014 14:23:56 +0900
changeset 170976 8fb9f057658a74bddf8d1711860d2cb406024bdd
parent 170975 d047b89102aa6cac60f7e0a8b8d8e4f6569b8428
child 170977 4966af832a78b267f87ce876df3d28e5934242f9
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.2 Rename nsDOMAnimationEvent to mozilla::dom::AnimationEvent r=smaug
dom/bindings/Bindings.conf
dom/events/AnimationEvent.cpp
dom/events/AnimationEvent.h
dom/events/moz.build
dom/events/nsDOMAnimationEvent.cpp
dom/events/nsDOMAnimationEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -93,17 +93,17 @@ DOMInterfaces = {
     'nativeType': 'mozilla::dom::Activity',
 },
 
 'AbstractWorker': {
     'concrete': False
 },
 
 'AnimationEvent': {
-    'nativeType': 'nsDOMAnimationEvent',
+    'nativeType': 'mozilla::dom::AnimationEvent',
 },
 
 'ArchiveReader': {
     'nativeType': 'mozilla::dom::file::ArchiveReader',
 },
 
 'ArchiveRequest': {
     'nativeType': 'mozilla::dom::file::ArchiveRequest',
rename from dom/events/nsDOMAnimationEvent.cpp
rename to dom/events/AnimationEvent.cpp
--- a/dom/events/nsDOMAnimationEvent.cpp
+++ b/dom/events/AnimationEvent.cpp
@@ -1,92 +1,98 @@
 /* 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 "nsDOMAnimationEvent.h"
+#include "mozilla/dom/AnimationEvent.h"
+#include "mozilla/ContentEvents.h"
 #include "prtime.h"
-#include "mozilla/ContentEvents.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
-nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
-                                         nsPresContext *aPresContext,
-                                         InternalAnimationEvent* aEvent)
+AnimationEvent::AnimationEvent(EventTarget* aOwner,
+                               nsPresContext* aPresContext,
+                               InternalAnimationEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext,
                aEvent ? aEvent : new InternalAnimationEvent(false, 0))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
 
-NS_INTERFACE_MAP_BEGIN(nsDOMAnimationEvent)
+NS_INTERFACE_MAP_BEGIN(AnimationEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
-NS_IMPL_ADDREF_INHERITED(nsDOMAnimationEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMAnimationEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(AnimationEvent, nsDOMEvent)
+NS_IMPL_RELEASE_INHERITED(AnimationEvent, nsDOMEvent)
 
 //static
-already_AddRefed<nsDOMAnimationEvent>
-nsDOMAnimationEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
-                                 const nsAString& aType,
-                                 const mozilla::dom::AnimationEventInit& aParam,
-                                 mozilla::ErrorResult& aRv)
+already_AddRefed<AnimationEvent>
+AnimationEvent::Constructor(const GlobalObject& aGlobal,
+                            const nsAString& aType,
+                            const AnimationEventInit& aParam,
+                            ErrorResult& aRv)
 {
-  nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<nsDOMAnimationEvent> e = new nsDOMAnimationEvent(t, nullptr, nullptr);
+  nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
+  nsRefPtr<AnimationEvent> e = new AnimationEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
 
   aRv = e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable);
 
   InternalAnimationEvent* internalEvent = e->mEvent->AsAnimationEvent();
   internalEvent->animationName = aParam.mAnimationName;
   internalEvent->elapsedTime = aParam.mElapsedTime;
   internalEvent->pseudoElement = aParam.mPseudoElement;
 
   e->SetTrusted(trusted);
   return e.forget();
 }
 
 NS_IMETHODIMP
-nsDOMAnimationEvent::GetAnimationName(nsAString & aAnimationName)
+AnimationEvent::GetAnimationName(nsAString& aAnimationName)
 {
   aAnimationName = mEvent->AsAnimationEvent()->animationName;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMAnimationEvent::GetElapsedTime(float *aElapsedTime)
+AnimationEvent::GetElapsedTime(float* aElapsedTime)
 {
   *aElapsedTime = ElapsedTime();
   return NS_OK;
 }
 
 float
-nsDOMAnimationEvent::ElapsedTime()
+AnimationEvent::ElapsedTime()
 {
   return mEvent->AsAnimationEvent()->elapsedTime;
 }
 
 NS_IMETHODIMP
-nsDOMAnimationEvent::GetPseudoElement(nsAString& aPseudoElement)
+AnimationEvent::GetPseudoElement(nsAString& aPseudoElement)
 {
   aPseudoElement = mEvent->AsAnimationEvent()->pseudoElement;
   return NS_OK;
 }
 
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
 nsresult
-NS_NewDOMAnimationEvent(nsIDOMEvent **aInstancePtrResult,
-                        mozilla::dom::EventTarget* aOwner,
-                        nsPresContext *aPresContext,
-                        InternalAnimationEvent *aEvent)
+NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult,
+                        EventTarget* aOwner,
+                        nsPresContext* aPresContext,
+                        InternalAnimationEvent* aEvent)
 {
-  nsDOMAnimationEvent* it =
-    new nsDOMAnimationEvent(aOwner, aPresContext, aEvent);
+  AnimationEvent* it = new AnimationEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMAnimationEvent.h
rename to dom/events/AnimationEvent.h
--- a/dom/events/nsDOMAnimationEvent.h
+++ b/dom/events/AnimationEvent.h
@@ -1,46 +1,52 @@
 /* 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 nsDOMAnimationEvent_h_
-#define nsDOMAnimationEvent_h_
+#ifndef mozilla_dom_AnimationEvent_h_
+#define mozilla_dom_AnimationEvent_h_
 
 #include "nsDOMEvent.h"
 #include "nsIDOMAnimationEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/AnimationEventBinding.h"
 
 class nsAString;
 
-class nsDOMAnimationEvent : public nsDOMEvent,
-                            public nsIDOMAnimationEvent
+namespace mozilla {
+namespace dom {
+
+class AnimationEvent : public nsDOMEvent,
+                       public nsIDOMAnimationEvent
 {
 public:
-  nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
-                      nsPresContext *aPresContext,
-                      mozilla::InternalAnimationEvent* aEvent);
+  AnimationEvent(EventTarget* aOwner,
+                 nsPresContext* aPresContext,
+                 InternalAnimationEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_FORWARD_TO_NSDOMEVENT
   NS_DECL_NSIDOMANIMATIONEVENT
 
-  static already_AddRefed<nsDOMAnimationEvent>
-  Constructor(const mozilla::dom::GlobalObject& aGlobal,
+  static already_AddRefed<AnimationEvent>
+  Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
-              const mozilla::dom::AnimationEventInit& aParam,
-              mozilla::ErrorResult& aRv);
+              const AnimationEventInit& aParam,
+              ErrorResult& aRv);
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this);
+    return AnimationEventBinding::Wrap(aCx, aScope, this);
   }
 
   // xpidl implementation
   // GetAnimationName(nsAString& aAnimationName);
   // GetPseudoElement(nsAString& aPseudoElement);
 
   float ElapsedTime();
 };
 
-#endif /* !defined(nsDOMAnimationEvent_h_) */
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_AnimationEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -31,30 +31,31 @@ EXPORTS += [
     'nsVKList.h',
 ]
 
 EXPORTS.mozilla += [
     'MutationEvent.h',
 ]
 
 EXPORTS.mozilla.dom += [
+    'AnimationEvent.h',
     'EventTarget.h',
     'PointerEvent.h',
     'Touch.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
 UNIFIED_SOURCES += [
+    'AnimationEvent.cpp',
     'EventTarget.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
-    'nsDOMAnimationEvent.cpp',
     'nsDOMBeforeUnloadEvent.cpp',
     'nsDOMClipboardEvent.cpp',
     'nsDOMCommandEvent.cpp',
     'nsDOMCompositionEvent.cpp',
     'nsDOMDataContainerEvent.cpp',
     'nsDOMDataTransfer.cpp',
     'nsDOMDeviceMotionEvent.cpp',
     'nsDOMDragEvent.cpp',