Bug 975688 part.24 Rename nsDOMNotifyPaintEvent to mozilla::dom::NotifyPaintEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 28 Feb 2014 23:58:43 +0900
changeset 189483 e711121154fb15f0ad3fbc579795f54ccfaaaf82
parent 189482 cb9e4644b197eb538117ba52368896d4a22cb985
child 189484 8c632b315211129b7671efff5f1b455ef21b8f32
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs975688
milestone30.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 975688 part.24 Rename nsDOMNotifyPaintEvent to mozilla::dom::NotifyPaintEvent r=smaug
dom/bindings/Bindings.conf
dom/events/NotifyPaintEvent.cpp
dom/events/NotifyPaintEvent.h
dom/events/moz.build
dom/events/nsDOMNotifyPaintEvent.cpp
dom/events/nsDOMNotifyPaintEvent.h
widget/android/nsAppShell.cpp
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -823,20 +823,16 @@ DOMInterfaces = {
     'resultNotAddRefed': [ 'root', 'referenceNode' ],
 },
 
 'NodeList': {
     'nativeType': 'nsINodeList',
     'resultNotAddRefed': [ 'item' ]
 },
 
-'NotifyPaintEvent': {
-    'nativeType': 'nsDOMNotifyPaintEvent',
-},
-
 'OfflineAudioCompletionEvent': {
     'resultNotAddRefed': [ 'renderedBuffer' ],
 },
 
 'OfflineAudioContext': {
     'nativeType': 'mozilla::dom::AudioContext',
     'resultNotAddRefed': [ 'destination', 'listener' ],
 },
rename from dom/events/nsDOMNotifyPaintEvent.cpp
rename to dom/events/NotifyPaintEvent.cpp
--- a/dom/events/nsDOMNotifyPaintEvent.cpp
+++ b/dom/events/NotifyPaintEvent.cpp
@@ -1,88 +1,88 @@
 /* -*- 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/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) {
     mEvent->message = aEventType;
   }
   if (aInvalidateRequests) {
     mInvalidateRequests.MoveElementsFrom(aInvalidateRequests->mRequests);
   }
 }
 
-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()) {
     return r;
   }
   for (uint32_t i = 0; i < mInvalidateRequests.Length(); ++i) {
     r.Or(r, mInvalidateRequests[i].mRect);
     r.SimplifyOutward(10);
   }
   return r;
 }
 
 NS_IMETHODIMP
-nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
+NotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
 {
   *aResult = BoundingClientRect().get();
   return NS_OK;
 }
 
 already_AddRefed<DOMRect>
-nsDOMNotifyPaintEvent::BoundingClientRect()
+NotifyPaintEvent::BoundingClientRect()
 {
   nsRefPtr<DOMRect> rect = new DOMRect(ToSupports(this));
 
   if (mPresContext) {
     rect->SetLayoutRect(GetRegion().GetBounds());
   }
 
   return rect.forget();
 }
 
 NS_IMETHODIMP
-nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
+NotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
 {
   *aResult = ClientRects().get();
   return NS_OK;
 }
 
 already_AddRefed<DOMRectList>
-nsDOMNotifyPaintEvent::ClientRects()
+NotifyPaintEvent::ClientRects()
 {
   nsISupports* parent = ToSupports(this);
   nsRefPtr<DOMRectList> rectList = new DOMRectList(parent);
 
   nsRegion r = GetRegion();
   nsRegionRectIterator iter(r);
   for (const nsRect* rgnRect = iter.Next(); rgnRect; rgnRect = iter.Next()) {
     nsRefPtr<DOMRect> rect = new DOMRect(parent);
@@ -90,81 +90,86 @@ nsDOMNotifyPaintEvent::ClientRects()
     rect->SetLayoutRect(*rgnRect);
     rectList->Append(rect);
   }
 
   return rectList.forget();
 }
 
 NS_IMETHODIMP
-nsDOMNotifyPaintEvent::GetPaintRequests(nsISupports** aResult)
+NotifyPaintEvent::GetPaintRequests(nsISupports** aResult)
 {
   nsRefPtr<nsPaintRequestList> requests = PaintRequests();
   requests.forget(aResult);
   return NS_OK;
 }
 
 already_AddRefed<nsPaintRequestList>
-nsDOMNotifyPaintEvent::PaintRequests()
+NotifyPaintEvent::PaintRequests()
 {
   nsDOMEvent* parent = this;
   nsRefPtr<nsPaintRequestList> requests = new nsPaintRequestList(parent);
 
   if (nsContentUtils::IsCallerChrome()) {
     for (uint32_t i = 0; i < mInvalidateRequests.Length(); ++i) {
       nsRefPtr<nsPaintRequest> r = new nsPaintRequest(parent);
       r->SetRequest(mInvalidateRequests[i]);
       requests->Append(r);
     }
   }
 
   return requests.forget();
 }
 
 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"));
   }
 
   nsDOMEvent::Serialize(aMsg, false);
 
   uint32_t length = mInvalidateRequests.Length();
   IPC::WriteParam(aMsg, length);
   for (uint32_t i = 0; i < length; ++i) {
     IPC::WriteParam(aMsg, mInvalidateRequests[i].mRect);
     IPC::WriteParam(aMsg, mInvalidateRequests[i].mFlags);
   }
 }
 
 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);
 
   uint32_t length = 0;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &length), false);
   mInvalidateRequests.SetCapacity(length);
   for (uint32_t i = 0; i < length; ++i) {
     nsInvalidateRequestList::Request req;
     NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mRect), false);
     NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &req.mFlags), false);
     mInvalidateRequests.AppendElement(req);
   }
 
   return true;
 }
 
-nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult,
-                                   mozilla::dom::EventTarget* aOwner,
-                                   nsPresContext* aPresContext,
-                                   WidgetEvent* aEvent,
-                                   uint32_t aEventType,
-                                   nsInvalidateRequestList* 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) 
 {
-  nsDOMNotifyPaintEvent* it =
-    new nsDOMNotifyPaintEvent(aOwner, aPresContext, aEvent, aEventType,
-                              aInvalidateRequests);
-
+  NotifyPaintEvent* it = new NotifyPaintEvent(aOwner, aPresContext, aEvent,
+                                              aEventType, aInvalidateRequests);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMNotifyPaintEvent.h
rename to dom/events/NotifyPaintEvent.h
--- a/dom/events/nsDOMNotifyPaintEvent.h
+++ b/dom/events/NotifyPaintEvent.h
@@ -1,43 +1,40 @@
 /* -*- 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 nsDOMNotifyPaintEvent_h_
-#define nsDOMNotifyPaintEvent_h_
+#ifndef mozilla_dom_NotifyPaintEvent_h_
+#define mozilla_dom_NotifyPaintEvent_h_
 
 #include "mozilla/Attributes.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsDOMEvent.h"
 #include "nsPresContext.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 
 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
 
   NS_DECL_NSIDOMNOTIFYPAINTEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION
   NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE
@@ -45,23 +42,26 @@ 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::NotifyPaintEventBinding::Wrap(aCx, aScope, this);
+    return NotifyPaintEventBinding::Wrap(aCx, aScope, this);
   }
 
   already_AddRefed<DOMRectList> ClientRects();
 
   already_AddRefed<DOMRect> BoundingClientRect();
 
   already_AddRefed<nsPaintRequestList> PaintRequests();
 private:
   nsRegion GetRegion();
 
   nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
 };
 
-#endif // nsDOMNotifyPaintEvent_h_
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_NotifyPaintEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -47,16 +47,17 @@ EXPORTS.mozilla.dom += [
     'EventTarget.h',
     'FocusEvent.h',
     'KeyboardEvent.h',
     'MessageEvent.h',
     'MouseEvent.h',
     'MouseScrollEvent.h',
     'MutationEvent.h',
     'NotifyAudioAvailableEvent.h',
+    'NotifyPaintEvent.h',
     'PointerEvent.h',
     'SimpleGestureEvent.h',
     'Touch.h',
     'TouchEvent.h',
     'TransitionEvent.h',
     'WheelEvent.h',
     'XULCommandEvent.h',
 ]
@@ -100,20 +101,20 @@ UNIFIED_SOURCES += [
     'TransitionEvent.cpp',
     'WheelEvent.cpp',
     'XULCommandEvent.cpp',
 ]
 
 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',
     # 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
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -14,17 +14,16 @@
 #include "nsWindow.h"
 #include "nsThreadUtils.h"
 #include "nsICommandLineRunner.h"
 #include "nsIObserverService.h"
 #include "nsIAppStartup.h"
 #include "nsIGeolocationProvider.h"
 #include "nsCacheService.h"
 #include "nsIDOMEventListener.h"
-#include "nsDOMNotifyPaintEvent.h"
 #include "nsIDOMClientRectList.h"
 #include "nsIDOMClientRect.h"
 #include "nsIDOMWakeLockListener.h"
 #include "nsIPowerManagerService.h"
 #include "nsFrameManager.h"
 #include "nsINetworkLinkService.h"
 
 #include "mozilla/Services.h"