From beb0ea20224a7222087a755b77e0a030661eadf6 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 28 Feb 2014 23:58:43 +0900 Subject: [PATCH] Bug 975688 part.24 Rename nsDOMNotifyPaintEvent to mozilla::dom::NotifyPaintEvent r=smaug --HG-- rename : dom/events/nsDOMNotifyPaintEvent.cpp => dom/events/NotifyPaintEvent.cpp rename : dom/events/nsDOMNotifyPaintEvent.h => dom/events/NotifyPaintEvent.h --- dom/bindings/Bindings.conf | 4 -- ...ifyPaintEvent.cpp => NotifyPaintEvent.cpp} | 69 ++++++++++--------- ...MNotifyPaintEvent.h => NotifyPaintEvent.h} | 30 ++++---- dom/events/moz.build | 5 +- widget/android/nsAppShell.cpp | 1 - 5 files changed, 55 insertions(+), 54 deletions(-) rename dom/events/{nsDOMNotifyPaintEvent.cpp => NotifyPaintEvent.cpp} (71%) rename dom/events/{nsDOMNotifyPaintEvent.h => NotifyPaintEvent.h} (66%) diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index f8dc65fc3982..a924dd943867 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -828,10 +828,6 @@ DOMInterfaces = { 'resultNotAddRefed': [ 'item' ] }, -'NotifyPaintEvent': { - 'nativeType': 'nsDOMNotifyPaintEvent', -}, - 'OfflineAudioCompletionEvent': { 'resultNotAddRefed': [ 'renderedBuffer' ], }, diff --git a/dom/events/nsDOMNotifyPaintEvent.cpp b/dom/events/NotifyPaintEvent.cpp similarity index 71% rename from dom/events/nsDOMNotifyPaintEvent.cpp rename to dom/events/NotifyPaintEvent.cpp index 81796a527b20..4d9dc9e8ded7 100644 --- a/dom/events/nsDOMNotifyPaintEvent.cpp +++ b/dom/events/NotifyPaintEvent.cpp @@ -5,20 +5,20 @@ #include "base/basictypes.h" #include "ipc/IPCMessageUtils.h" +#include "mozilla/dom/DOMRect.h" +#include "mozilla/dom/NotifyPaintEvent.h" #include "mozilla/GfxMessageUtils.h" -#include "nsDOMNotifyPaintEvent.h" #include "nsContentUtils.h" #include "nsPaintRequest.h" -#include "mozilla/dom/DOMRect.h" -using namespace mozilla; -using namespace mozilla::dom; +namespace mozilla { +namespace dom { -nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent, - uint32_t aEventType, - nsInvalidateRequestList* aInvalidateRequests) +NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner, + nsPresContext* aPresContext, + WidgetEvent* aEvent, + uint32_t aEventType, + nsInvalidateRequestList* aInvalidateRequests) : nsDOMEvent(aOwner, aPresContext, aEvent) { if (mEvent) { @@ -29,15 +29,15 @@ nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner, } } -NS_INTERFACE_MAP_BEGIN(nsDOMNotifyPaintEvent) +NS_INTERFACE_MAP_BEGIN(NotifyPaintEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMNotifyPaintEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) -NS_IMPL_ADDREF_INHERITED(nsDOMNotifyPaintEvent, nsDOMEvent) -NS_IMPL_RELEASE_INHERITED(nsDOMNotifyPaintEvent, nsDOMEvent) +NS_IMPL_ADDREF_INHERITED(NotifyPaintEvent, nsDOMEvent) +NS_IMPL_RELEASE_INHERITED(NotifyPaintEvent, nsDOMEvent) nsRegion -nsDOMNotifyPaintEvent::GetRegion() +NotifyPaintEvent::GetRegion() { nsRegion r; if (!nsContentUtils::IsCallerChrome()) { @@ -51,14 +51,14 @@ nsDOMNotifyPaintEvent::GetRegion() } NS_IMETHODIMP -nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult) +NotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult) { *aResult = BoundingClientRect().get(); return NS_OK; } already_AddRefed -nsDOMNotifyPaintEvent::BoundingClientRect() +NotifyPaintEvent::BoundingClientRect() { nsRefPtr rect = new DOMRect(ToSupports(this)); @@ -70,14 +70,14 @@ nsDOMNotifyPaintEvent::BoundingClientRect() } NS_IMETHODIMP -nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult) +NotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult) { *aResult = ClientRects().get(); return NS_OK; } already_AddRefed -nsDOMNotifyPaintEvent::ClientRects() +NotifyPaintEvent::ClientRects() { nsISupports* parent = ToSupports(this); nsRefPtr rectList = new DOMRectList(parent); @@ -95,7 +95,7 @@ nsDOMNotifyPaintEvent::ClientRects() } NS_IMETHODIMP -nsDOMNotifyPaintEvent::GetPaintRequests(nsISupports** aResult) +NotifyPaintEvent::GetPaintRequests(nsISupports** aResult) { nsRefPtr requests = PaintRequests(); requests.forget(aResult); @@ -103,7 +103,7 @@ nsDOMNotifyPaintEvent::GetPaintRequests(nsISupports** aResult) } already_AddRefed -nsDOMNotifyPaintEvent::PaintRequests() +NotifyPaintEvent::PaintRequests() { nsDOMEvent* parent = this; nsRefPtr requests = new nsPaintRequestList(parent); @@ -120,8 +120,8 @@ nsDOMNotifyPaintEvent::PaintRequests() } NS_IMETHODIMP_(void) -nsDOMNotifyPaintEvent::Serialize(IPC::Message* aMsg, - bool aSerializeInterfaceType) +NotifyPaintEvent::Serialize(IPC::Message* aMsg, + bool aSerializeInterfaceType) { if (aSerializeInterfaceType) { IPC::WriteParam(aMsg, NS_LITERAL_STRING("notifypaintevent")); @@ -138,7 +138,7 @@ nsDOMNotifyPaintEvent::Serialize(IPC::Message* aMsg, } NS_IMETHODIMP_(bool) -nsDOMNotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter) +NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter) { NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), false); @@ -155,16 +155,21 @@ nsDOMNotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter) return true; } -nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult, - mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - WidgetEvent* aEvent, - uint32_t aEventType, - nsInvalidateRequestList* aInvalidateRequests) -{ - nsDOMNotifyPaintEvent* it = - new nsDOMNotifyPaintEvent(aOwner, aPresContext, aEvent, aEventType, - aInvalidateRequests); +} // namespace dom +} // namespace mozilla +using namespace mozilla; +using namespace mozilla::dom; + +nsresult +NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult, + EventTarget* aOwner, + nsPresContext* aPresContext, + WidgetEvent* aEvent, + uint32_t aEventType, + nsInvalidateRequestList* aInvalidateRequests) +{ + NotifyPaintEvent* it = new NotifyPaintEvent(aOwner, aPresContext, aEvent, + aEventType, aInvalidateRequests); return CallQueryInterface(it, aInstancePtrResult); } diff --git a/dom/events/nsDOMNotifyPaintEvent.h b/dom/events/NotifyPaintEvent.h similarity index 66% rename from dom/events/nsDOMNotifyPaintEvent.h rename to dom/events/NotifyPaintEvent.h index af6ec3cb2e92..9f5f0996a705 100644 --- a/dom/events/nsDOMNotifyPaintEvent.h +++ b/dom/events/NotifyPaintEvent.h @@ -3,8 +3,8 @@ * 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 nsDOMNotifyPaintEvent_h_ -#define nsDOMNotifyPaintEvent_h_ +#ifndef mozilla_dom_NotifyPaintEvent_h_ +#define mozilla_dom_NotifyPaintEvent_h_ #include "mozilla/Attributes.h" #include "nsIDOMNotifyPaintEvent.h" @@ -16,23 +16,20 @@ class nsPaintRequestList; namespace mozilla { namespace dom { + class DOMRect; class DOMRectList; -} -} -class nsDOMNotifyPaintEvent : public nsDOMEvent, - public nsIDOMNotifyPaintEvent +class NotifyPaintEvent : public nsDOMEvent, + public nsIDOMNotifyPaintEvent { - typedef mozilla::dom::DOMRect DOMRect; - typedef mozilla::dom::DOMRectList DOMRectList; public: - nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner, - nsPresContext* aPresContext, - mozilla::WidgetEvent* aEvent, - uint32_t aEventType, - nsInvalidateRequestList* aInvalidateRequests); + NotifyPaintEvent(EventTarget* aOwner, + nsPresContext* aPresContext, + WidgetEvent* aEvent, + uint32_t aEventType, + nsInvalidateRequestList* aInvalidateRequests); NS_DECL_ISUPPORTS_INHERITED @@ -50,7 +47,7 @@ public: virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aScope) MOZ_OVERRIDE { - return mozilla::dom::NotifyPaintEventBinding::Wrap(aCx, aScope, this); + return NotifyPaintEventBinding::Wrap(aCx, aScope, this); } already_AddRefed ClientRects(); @@ -64,4 +61,7 @@ private: nsTArray mInvalidateRequests; }; -#endif // nsDOMNotifyPaintEvent_h_ +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_NotifyPaintEvent_h_ diff --git a/dom/events/moz.build b/dom/events/moz.build index 52df1f2bdce3..3b40f2c8f678 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -52,6 +52,7 @@ EXPORTS.mozilla.dom += [ 'MouseScrollEvent.h', 'MutationEvent.h', 'NotifyAudioAvailableEvent.h', + 'NotifyPaintEvent.h', 'PointerEvent.h', 'SimpleGestureEvent.h', 'Touch.h', @@ -105,10 +106,10 @@ UNIFIED_SOURCES += [ SOURCES += [ # nsDOMEvent.cpp should be built separately because it includes # ipc/IPCMessageUtils.h, which on Windows includes windows.h. - 'nsDOMEvent.cpp', + 'NotifyPaintEvent.cpp', # nsDOMEvent.cpp should be built separately because it includes # ipc/IPCMessageUtils.h, which on Windows includes windows.h. - 'nsDOMNotifyPaintEvent.cpp', + 'nsDOMEvent.cpp', # nsDOMEvent.cpp should be built separately because it includes # ipc/IPCMessageUtils.h, which on Windows includes windows.h. 'nsDOMScrollAreaEvent.cpp', diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index d1fb2745bf1b..58fa05937f6d 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -19,7 +19,6 @@ #include "nsIGeolocationProvider.h" #include "nsCacheService.h" #include "nsIDOMEventListener.h" -#include "nsDOMNotifyPaintEvent.h" #include "nsIDOMClientRectList.h" #include "nsIDOMClientRect.h" #include "nsIDOMWakeLockListener.h"