Bug 989214 Rename nsPaintRequest to mozilla::dom::PaintRequest r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 03 Apr 2014 13:18:37 +0900
changeset 176828 6a84cbff41186a58d2efdea52c13bf333d8a3dc7
parent 176827 b29352bc495f95deac11810a16af3bf5a3c07707
child 176829 0e798623921458627aa0f1b64447e8e1c77543ed
push id41854
push usermasayuki@d-toybox.com
push dateThu, 03 Apr 2014 04:18:46 +0000
treeherdermozilla-inbound@145bb26f6180 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs989214
milestone31.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 989214 Rename nsPaintRequest to mozilla::dom::PaintRequest r=smaug
dom/bindings/Bindings.conf
dom/events/NotifyPaintEvent.cpp
dom/events/NotifyPaintEvent.h
dom/events/PaintRequest.cpp
dom/events/PaintRequest.h
dom/events/moz.build
dom/events/nsPaintRequest.cpp
dom/events/nsPaintRequest.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -858,23 +858,18 @@ DOMInterfaces = {
 'OfflineResourceList': {
     'nativeType': 'nsDOMOfflineResourceList',
 },
 
 'OscillatorNode': {
     'resultNotAddRefed': [ 'frequency', 'detune' ],
 },
 
-'PaintRequest': {
-    'nativeType': 'nsPaintRequest',
-},
-
 'PaintRequestList': {
-    'nativeType': 'nsPaintRequestList',
-    'headerFile': 'nsPaintRequest.h',
+    'headerFile': 'mozilla/dom/PaintRequest.h',
     'resultNotAddRefed': [ 'item' ]
 },
 
 'PannerNode': {
     'resultNotAddRefed': [ 'coneGain', 'distanceGain' ],
 },
 
 'Path2D': {
--- a/dom/events/NotifyPaintEvent.cpp
+++ b/dom/events/NotifyPaintEvent.cpp
@@ -2,19 +2,19 @@
 /* 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/dom/PaintRequest.h"
 #include "mozilla/GfxMessageUtils.h"
 #include "nsContentUtils.h"
-#include "nsPaintRequest.h"
 
 namespace mozilla {
 namespace dom {
 
 NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
                                    nsPresContext* aPresContext,
                                    WidgetEvent* aEvent,
                                    uint32_t aEventType,
@@ -92,30 +92,30 @@ NotifyPaintEvent::ClientRects()
   }
 
   return rectList.forget();
 }
 
 NS_IMETHODIMP
 NotifyPaintEvent::GetPaintRequests(nsISupports** aResult)
 {
-  nsRefPtr<nsPaintRequestList> requests = PaintRequests();
+  nsRefPtr<PaintRequestList> requests = PaintRequests();
   requests.forget(aResult);
   return NS_OK;
 }
 
-already_AddRefed<nsPaintRequestList>
+already_AddRefed<PaintRequestList>
 NotifyPaintEvent::PaintRequests()
 {
   Event* parent = this;
-  nsRefPtr<nsPaintRequestList> requests = new nsPaintRequestList(parent);
+  nsRefPtr<PaintRequestList> requests = new PaintRequestList(parent);
 
   if (nsContentUtils::IsCallerChrome()) {
     for (uint32_t i = 0; i < mInvalidateRequests.Length(); ++i) {
-      nsRefPtr<nsPaintRequest> r = new nsPaintRequest(parent);
+      nsRefPtr<PaintRequest> r = new PaintRequest(parent);
       r->SetRequest(mInvalidateRequests[i]);
       requests->Append(r);
     }
   }
 
   return requests.forget();
 }
 
--- a/dom/events/NotifyPaintEvent.h
+++ b/dom/events/NotifyPaintEvent.h
@@ -7,23 +7,22 @@
 #define mozilla_dom_NotifyPaintEvent_h_
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsPresContext.h"
 
-class nsPaintRequestList;
-
 namespace mozilla {
 namespace dom {
 
 class DOMRect;
 class DOMRectList;
+class PaintRequestList;
 
 class NotifyPaintEvent : public Event,
                          public nsIDOMNotifyPaintEvent
 {
 
 public:
   NotifyPaintEvent(EventTarget* aOwner,
                    nsPresContext* aPresContext,
@@ -49,17 +48,17 @@ public:
   {
     return NotifyPaintEventBinding::Wrap(aCx, aScope, this);
   }
 
   already_AddRefed<DOMRectList> ClientRects();
 
   already_AddRefed<DOMRect> BoundingClientRect();
 
-  already_AddRefed<nsPaintRequestList> PaintRequests();
+  already_AddRefed<PaintRequestList> PaintRequests();
 private:
   nsRegion GetRegion();
 
   nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
 };
 
 } // namespace dom
 } // namespace mozilla
rename from dom/events/nsPaintRequest.cpp
rename to dom/events/PaintRequest.cpp
--- a/dom/events/nsPaintRequest.cpp
+++ b/dom/events/PaintRequest.cpp
@@ -1,69 +1,80 @@
 /* -*- 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 "nsPaintRequest.h"
+#include "mozilla/dom/PaintRequest.h"
 
 #include "mozilla/dom/PaintRequestBinding.h"
 #include "mozilla/dom/PaintRequestListBinding.h"
 #include "mozilla/dom/DOMRect.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequest, mParent)
+/******************************************************************************
+ * mozilla::dom::PaintRequest
+ *****************************************************************************/
 
-NS_INTERFACE_TABLE_HEAD(nsPaintRequest)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(PaintRequest, mParent)
+
+NS_INTERFACE_TABLE_HEAD(PaintRequest)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_TABLE1(nsPaintRequest, nsIDOMPaintRequest)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsPaintRequest)
+  NS_INTERFACE_TABLE1(PaintRequest, nsIDOMPaintRequest)
+  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(PaintRequest)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequest)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequest)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequest)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequest)
 
 /* virtual */ JSObject*
-nsPaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+PaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return PaintRequestBinding::Wrap(aCx, aScope, this);
 }
 
 already_AddRefed<DOMRect>
-nsPaintRequest::ClientRect()
+PaintRequest::ClientRect()
 {
   nsRefPtr<DOMRect> clientRect = new DOMRect(this);
   clientRect->SetLayoutRect(mRequest.mRect);
   return clientRect.forget();
 }
 
 NS_IMETHODIMP
-nsPaintRequest::GetClientRect(nsIDOMClientRect** aResult)
+PaintRequest::GetClientRect(nsIDOMClientRect** aResult)
 {
   nsRefPtr<DOMRect> clientRect = ClientRect();
   clientRect.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPaintRequest::GetXPCOMReason(nsAString& aResult)
+PaintRequest::GetXPCOMReason(nsAString& aResult)
 {
   GetReason(aResult);
   return NS_OK;
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequestList, mParent)
+/******************************************************************************
+ * mozilla::dom::PaintRequestList
+ *****************************************************************************/
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPaintRequestList)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(PaintRequestList, mParent)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaintRequestList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequestList)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequestList)
 
 JSObject*
-nsPaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+PaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return PaintRequestListBinding::Wrap(aCx, aScope, this);
 }
+
+} // namespace dom
+} // namespace mozilla
rename from dom/events/nsPaintRequest.h
rename to dom/events/PaintRequest.h
--- a/dom/events/nsPaintRequest.h
+++ b/dom/events/PaintRequest.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 NSPAINTREQUEST_H_
-#define NSPAINTREQUEST_H_
+#ifndef mozilla_dom_PaintRequest_h_
+#define mozilla_dom_PaintRequest_h_
 
 #include "nsIDOMPaintRequest.h"
 #include "nsPresContext.h"
 #include "nsIDOMEvent.h"
 #include "mozilla/Attributes.h"
 #include "nsWrapperCache.h"
 
 namespace mozilla {
 namespace dom {
+
 class DOMRect;
-}
-}
 
-class nsPaintRequest MOZ_FINAL : public nsIDOMPaintRequest
-                               , public nsWrapperCache
+class PaintRequest MOZ_FINAL : public nsIDOMPaintRequest
+                             , public nsWrapperCache
 {
-  typedef mozilla::dom::DOMRect DOMRect;
-
 public:
-  nsPaintRequest(nsIDOMEvent* aParent)
+  PaintRequest(nsIDOMEvent* aParent)
     : mParent(aParent)
   {
     mRequest.mFlags = 0;
     SetIsDOMBinding();
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPaintRequest)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequest)
   NS_DECL_NSIDOMPAINTREQUEST
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   nsIDOMEvent* GetParentObject() const
   {
     return mParent;
@@ -48,61 +45,64 @@ public:
   {
     aResult.AssignLiteral("repaint");
   }
 
   void SetRequest(const nsInvalidateRequestList::Request& aRequest)
   { mRequest = aRequest; }
 
 private:
-  ~nsPaintRequest() {}
+  ~PaintRequest() {}
 
   nsCOMPtr<nsIDOMEvent> mParent;
   nsInvalidateRequestList::Request mRequest;
 };
 
-class nsPaintRequestList MOZ_FINAL : public nsISupports,
-                                     public nsWrapperCache
+class PaintRequestList MOZ_FINAL : public nsISupports,
+                                   public nsWrapperCache
 {
 public:
-  nsPaintRequestList(nsIDOMEvent *aParent) : mParent(aParent)
+  PaintRequestList(nsIDOMEvent *aParent) : mParent(aParent)
   {
     SetIsDOMBinding();
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPaintRequestList)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequestList)
   
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
-  void Append(nsPaintRequest* aElement)
+  void Append(PaintRequest* aElement)
   {
     mArray.AppendElement(aElement);
   }
 
   uint32_t Length()
   {
     return mArray.Length();
   }
 
-  nsPaintRequest* Item(uint32_t aIndex)
+  PaintRequest* Item(uint32_t aIndex)
   {
     return mArray.SafeElementAt(aIndex);
   }
-  nsPaintRequest* IndexedGetter(uint32_t aIndex, bool& aFound)
+  PaintRequest* IndexedGetter(uint32_t aIndex, bool& aFound)
   {
     aFound = aIndex < mArray.Length();
     return aFound ? mArray.ElementAt(aIndex) : nullptr;
   }
 
 private:
-  ~nsPaintRequestList() {}
+  ~PaintRequestList() {}
 
-  nsTArray< nsRefPtr<nsPaintRequest> > mArray;
+  nsTArray< nsRefPtr<PaintRequest> > mArray;
   nsCOMPtr<nsIDOMEvent> mParent;
 };
 
-#endif /*NSPAINTREQUEST_H_*/
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_PaintRequest_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -42,16 +42,17 @@ EXPORTS.mozilla.dom += [
     'EventTarget.h',
     'FocusEvent.h',
     'KeyboardEvent.h',
     'MessageEvent.h',
     'MouseEvent.h',
     'MouseScrollEvent.h',
     'MutationEvent.h',
     'NotifyPaintEvent.h',
+    'PaintRequest.h',
     'PointerEvent.h',
     'ScrollAreaEvent.h',
     'SimpleGestureEvent.h',
     'Touch.h',
     'TouchEvent.h',
     'TransitionEvent.h',
     'UIEvent.h',
     'WheelEvent.h',
@@ -84,17 +85,17 @@ UNIFIED_SOURCES += [
     'IMEStateManager.cpp',
     'JSEventHandler.cpp',
     'KeyboardEvent.cpp',
     'MessageEvent.cpp',
     'MouseEvent.cpp',
     'MouseScrollEvent.cpp',
     'MutationEvent.cpp',
     'NotifyPaintEvent.cpp',
-    'nsPaintRequest.cpp',
+    'PaintRequest.cpp',
     'PointerEvent.cpp',
     'ScrollAreaEvent.cpp',
     'SimpleGestureEvent.cpp',
     'TextComposition.cpp',
     'Touch.cpp',
     'TouchEvent.cpp',
     'TransitionEvent.cpp',
     'UIEvent.cpp',