Bug 975688 part.27 Rename nsDOMTimeEvent to mozilla::dom::TimeEvent r=smaug

--HG--
rename : dom/smil/nsDOMTimeEvent.cpp => dom/smil/TimeEvent.cpp
rename : dom/smil/nsDOMTimeEvent.h => dom/smil/TimeEvent.h
This commit is contained in:
Masayuki Nakano 2014-02-28 23:58:43 +09:00
parent 3d0ba958a1
commit dfb5c2e301
4 changed files with 51 additions and 38 deletions

View File

@ -1211,10 +1211,6 @@ DOMInterfaces = {
'nativeOwnership': 'owned',
},
'TimeEvent': {
'nativeType': 'nsDOMTimeEvent',
},
'TimeRanges': {
'wrapperCache': False
},

View File

@ -3,16 +3,17 @@
* 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 "nsDOMTimeEvent.h"
#include "nsPresContext.h"
#include "nsIInterfaceRequestorUtils.h"
#include "mozilla/dom/TimeEvent.h"
#include "mozilla/BasicEvents.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsPresContext.h"
using namespace mozilla;
namespace mozilla {
namespace dom {
nsDOMTimeEvent::nsDOMTimeEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
TimeEvent::TimeEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext,
aEvent ? aEvent : new InternalUIEvent(false, 0)),
mDetail(0)
@ -43,18 +44,18 @@ nsDOMTimeEvent::nsDOMTimeEvent(mozilla::dom::EventTarget* aOwner,
}
}
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(nsDOMTimeEvent, nsDOMEvent,
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(TimeEvent, nsDOMEvent,
mView)
NS_IMPL_ADDREF_INHERITED(nsDOMTimeEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMTimeEvent, nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(TimeEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(TimeEvent, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTimeEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TimeEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTimeEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP
nsDOMTimeEvent::GetView(nsIDOMWindow** aView)
TimeEvent::GetView(nsIDOMWindow** aView)
{
*aView = mView;
NS_IF_ADDREF(*aView);
@ -62,16 +63,16 @@ nsDOMTimeEvent::GetView(nsIDOMWindow** aView)
}
NS_IMETHODIMP
nsDOMTimeEvent::GetDetail(int32_t* aDetail)
TimeEvent::GetDetail(int32_t* aDetail)
{
*aDetail = mDetail;
return NS_OK;
}
NS_IMETHODIMP
nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
nsIDOMWindow* aViewArg,
int32_t aDetailArg)
TimeEvent::InitTimeEvent(const nsAString& aTypeArg,
nsIDOMWindow* aViewArg,
int32_t aDetailArg)
{
nsresult rv = nsDOMEvent::InitEvent(aTypeArg, false /*doesn't bubble*/,
false /*can't cancel*/);
@ -83,11 +84,18 @@ nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
return NS_OK;
}
nsresult NS_NewDOMTimeEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
} // namespace dom
} // namespace mozilla
using namespace mozilla;
using namespace mozilla::dom;
nsresult
NS_NewDOMTimeEvent(nsIDOMEvent** aInstancePtrResult,
EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
{
nsDOMTimeEvent* it = new nsDOMTimeEvent(aOwner, aPresContext, aEvent);
TimeEvent* it = new TimeEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -3,24 +3,27 @@
* 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 NS_DOMTIMEEVENT_H_
#define NS_DOMTIMEEVENT_H_
#ifndef mozilla_dom_TimeEvent_h_
#define mozilla_dom_TimeEvent_h_
#include "nsIDOMTimeEvent.h"
#include "nsDOMEvent.h"
#include "mozilla/dom/TimeEventBinding.h"
class nsDOMTimeEvent MOZ_FINAL : public nsDOMEvent,
public nsIDOMTimeEvent
namespace mozilla {
namespace dom {
class TimeEvent MOZ_FINAL : public nsDOMEvent,
public nsIDOMTimeEvent
{
public:
nsDOMTimeEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent);
TimeEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent);
// nsISupports interface:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMTimeEvent, nsDOMEvent)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, nsDOMEvent)
// nsIDOMTimeEvent interface:
NS_DECL_NSIDOMTIMEEVENT
@ -31,7 +34,7 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::TimeEventBinding::Wrap(aCx, aScope, this);
return TimeEventBinding::Wrap(aCx, aScope, this);
}
int32_t Detail() const
@ -45,7 +48,7 @@ public:
}
void InitTimeEvent(const nsAString& aType, nsIDOMWindow* aView,
int32_t aDetail, mozilla::ErrorResult& aRv)
int32_t aDetail, ErrorResult& aRv)
{
aRv = InitTimeEvent(aType, aView, aDetail);
}
@ -55,4 +58,7 @@ private:
int32_t mDetail;
};
#endif // NS_DOMTIMEEVENT_H_
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_TimeEvent_h_

View File

@ -7,7 +7,6 @@
TEST_TOOL_DIRS += ['test']
EXPORTS += [
'nsDOMTimeEvent.h',
'nsISMILAttr.h',
'nsISMILType.h',
'nsSMILAnimationController.h',
@ -32,8 +31,11 @@ EXPORTS += [
'nsSMILValue.h',
]
EXPORTS.mozilla.dom += [
'TimeEvent.h',
]
UNIFIED_SOURCES += [
'nsDOMTimeEvent.cpp',
'nsSMILAnimationController.cpp',
'nsSMILAnimationFunction.cpp',
'nsSMILCompositor.cpp',
@ -57,6 +59,7 @@ UNIFIED_SOURCES += [
'SMILEnumType.cpp',
'SMILIntegerType.cpp',
'SMILStringType.cpp',
'TimeEvent.cpp',
]
FAIL_ON_WARNINGS = True